Tuesday, April 24, 2012

Jquery how to animate a div ONLY if at a certain position?

hope your all well... Is there a way to animate a div (slide down) for example if its ONLY at a certain position on the page?
For example, there are four Divs that all have the same class .ALLCONTENT but when a button is clicked (.BUTTONS) only the Div thats at 30px from the top will animate downwards, the rest will remain in the same place.



Basically, slide down a div to a certain position, if that divs in that position already it wont slide further down (the problem im having now with



$(".BUTTONS").click(function(){
$(".ALLCONTENT").animate({"top":"+=558px"}, 250, 'linear');
});


Thanks, Tom





No comments:

Post a Comment