Reputation: 83
$(document).ready(function(){
$('.more').click(function() {
var thumbsBlock = $(this).siblings('.thubmnailsWrap');
$($(this), thumbsBlock).animate({
'left' : "-=60px" //moves left
});
});
});
I use siblings and expect .thubmnailsWrap to move along with .more but failed. check my demo here http://jsfiddle.net/pdjkh69m/4/
I solved it, here is the code http://jsfiddle.net/pdjkh69m/8/ but I wonder why in my previous code, the multiple selector jst does not work, any idea? I kinda want to continue with duplicated code.
Upvotes: 1
Views: 119
Reputation: 760
$($(this), thumbsBlock)
this is wrong method
this works
http://jsfiddle.net/pdjkh69m/10/
Upvotes: 0
Reputation: 1797
$(document).ready(function () {
$('.more').click(function () {
var thumbsBlock = $(this).siblings('.thubmnailsWrap');
$(thumbsBlock).animate({
'left': "-=60px"
});
});
});
this is the code are you looking for
Upvotes: 0