
Tutorial on dynamic tabs has been given before by me,however the tutorial have some basic instructions related to tabs.This post will give you the idea about the implementation of lava lamp in dynamic tabs.Have a look on demo:
Description
The things working behind is the calculation of the movement of lamp on click.Actually,it work under simple method of adding and removing
classes
.When a lava lamp have a specific class
then it will move accordingly.Firstly,a
class
that is content1
is added in the lamp on which CSS
is applied that is left
at 0px
.As the lava lamp is at position absolute
,it means the height
of the button will set the value of top
attribute.Secondly,when a button is clicked then the class
is removed and a new class
of the clicked button is added which gives the lamp the magnitude or value of left;according to which it moves.Limitations
The limitations behind this idea are:
- The width of the lamp have to set according to the number of buttons that is 100 divide by the number of buttons and the product will be the
width
of lamp. - Each
class
of button will have differentstyle
with lamp to set the value that how much will it move.
Beside these limitations,this lava lamp gives a new look and no doubt user will click again and again.Want to add something,comments are open.
Post A Comment:
0 comments: