javascript - Affecting only one element with jQuery toggle -


so have got code

$('.item').click(function () {     if ($(".secondary", this).is(":hidden")) {         $(".primary", this).toggle('slide', {             direction: 'right'         }, 500, function () {             $('.secondary', this).toggle('slide', {                 direction: 'left'             }, 500);         });      } }); 

current behavior when click .item, .primary slides right, .secondary doesn't slide in @ all.

fiddle: http://jsfiddle.net/zm3zp6ax/

$('.item').click(function () {     var $this = $(this);     if ($(".secondary", this).is(":hidden")) {         $(".primary", $this).toggle('slide', {             direction: 'right'         }, 500, function () {             $('.secondary', $this).toggle('slide', {                 direction: 'left'             }, 500);         });      } }); 

demo


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -