jquery - Animation not working in wordpress -
am ripping hair out trying implement simple jquery animation worked on site did. change i've made in wanting affect animation different object selector (hoping i'm using these terms correctly). oddly, when test use exact same scenario previous site, no results.
can see obvious reason isn't working?
this jquery:
jquery(document).ready(function($){ $(".themelist li").hover( function () { $(".themedescription").animate({opacity:"1"}); }, function () { $(".themedescription").animate({opacity:'0'}, "fast"); } ); });
this loop (wordpress):
echo "<div class='themelist'><ul>"; foreach ( $terms $term ) { echo "<li>" . $term->name ."</li><div class='theme-description'>". $term->description. "</div>"; } echo "</ul></div>";
this css:
.themelist { position: relative; cursor: pointer; } .themelist li {width:200px;} .theme-description { text-align: left; color: #ccc; background: #333; width:300px; position: absolute; padding: 20px; top:0; left:200px; opacity:0; }
ideas? have searched on , cannot figure out i'm going wrong.
update
making progress, , have whole new problem. following adjusted jquery finallyw works far making animation run:
$(document).ready(function() { $(".themelist li").hover(function() { $(".themedescription").filter(':not(:animated)').animate({opacity:"1"}); }, (function() { $(".themedescription").animate({opacity:"0"}); } )); });
but can imagine, instead of div appearing 1 one, each corresponding link in list, appear @ same time. gah. should have seen coming, sort of assumed behave similar css display:none, , show 1 @ time.
is there effect can use fix this? or need generate individual classes div .themedescription becomes .themedescription1, .themedescription2, etc?
many again. ideas appreciated. -jennyb
.themedescription
on jquery code typo error against html/wordpress code...
please use .theme-description
on jquery code.... dash...
Comments
Post a Comment