how to animate div at fixed postion with jquery -


i have divs side side i.e

<table><tr> <td><div id="div1"></div></td> <td><div id="div2></div></td> </tr></table> 

where div1 has content in , div2 hidden have link in div1 on clicking link want show div2 animate() slide left right on position... div2 has position:fixed in css how can that

firstly should consider using using non tabular layout. floating 's next each other better starting point.

but answer question like:

$(function(){     $('#div1 a').toggle(         function(){             $('#div2').animate({width:$('#div1').width()},'slow');         },         function(){             $('#div2').animate({width:0},'slow');         }     ); }); 

this assumes have got css properties overflow:hidden , width:0px set on second div. make div2 same width first div.

the slideup , slidedown functions used achieve this.


Comments

Popular posts from this blog

silverlight - Applying a style to ItemContainerStyle in C# -

c# - NullReferenceException in MySqlClient.NativeDriver -

php - Updating recent updates - Problem in procedure - Any other approach? -