css - Jquery "this" context -



css - Jquery "this" context -

im trying

$(".classname").click(function() { $(this).(".anotherclass").css("z-index","1"); $(this).(".anotherclass").toggle( "slide",{ direction: "left" } ); });

and seek with

$(".classname").click(function(){ $(this).find(".anotherclass").css("z-index","1"); $(this).find(".anotherclass").toggle( "slide",{ direction: "left" } ); });

and keeps saying " (this) not defined", dont know how (this) context of .anotherclass

im trying start animation if click .classname div, there lot of .classname divs, , if click 1 .classname .anotherclass div shoul animated, actual divs

<div class="streamplayer"> <div class="albumart"> </div> <div class="onplay"> <div class="hiddenonplay"> </div> </div> <div class="addplaylist"></div> <div class="downloadsong"></div> </div>

the jquery

$(".albumart").click(function() { $(".hiddenonplay").css("z-index","1"); $(".hiddenonplay").toggle( "slide",{ direction: "left" } ); });

demo

use .next().find()this should work you,

$(".albumart").click(function() { var hiddenplay = $(this).next().find(".hiddenonplay"); hiddenplay.css("z-index","1"); hiddenplay.toggle(); });

jquery css

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -