jquery - Floated element's absolute positioned content broke layout and crashes animation -


i creating image gallery , want add each element expanding menu on click.

i want recreate itunes 11 album view effect.

i put images grid using html unordered list

<ul>     <li><div class="box"></div></li>     <li><div class="box"></div></li>     <li><div class="box"></div></li>     ...     <li><div class="box"></div></li>     <li class="clear"></li> </ul> 

then using jquery wrote function triggered when click on li element, adding div, , div loads menu.

$("li").click( function() {      $(this).append("<div class='container'></div>");      var cont = $(".container", $(this));      cont.html("<div class='menu'><div class='content'></div></div>");      var item_height = $(this).outerheight();     var cont_height = $(".content", cont).outerheight();      $(".content", cont).css({ height:0 });      $(".content", cont).stop().animate({ height: cont_height + "px" });         $(this).css({height: (item_height+cont_height) + "px"});   } ); 

and major problem when click on li element "itunes effect" doesn't work - menu appears without animation, , go further breaking whole layout.

demo: http://jsfiddle.net/puz219/vmreg/

is there way fix animation , layout.

did small changes, added 1 bar can open @ same time with

.remove() 

check out here http://jsfiddle.net/vmreg/3/

here new fiddle rows. can add elements in row like

http://jsfiddle.net/vmreg/6/


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -