View Single Post
Old 12-03-2012, 04:16 PM   PM User | #1
wylie233
New Coder

 
Join Date: Jul 2012
Location: UK
Posts: 38
Thanks: 1
Thanked 0 Times in 0 Posts
wylie233 is an unknown quantity at this point
jquery, scrolling

Hi!

on a jquery trigger, i want to add more margin-left pixels to how it it is currenty.
to lets say i have a div, and it is 350px left, and on the jquery trigger, i want it to animate a further pixel,
the trigger is scrolling, so as i scroll, the div moves further along.

$(window).scroll(function(){
("#div").animate({ marginLeft: "+1px"}, 1);
});



...does not work, i guessed it.


$(window).scroll(function(){
alert("scrolled");
});


..does work, (just proving that the trigger works).

Any help would be appreciated!

Last edited by wylie233; 12-03-2012 at 05:38 PM..
wylie233 is offline   Reply With Quote