Jump to content

jQuery Animate


driz
 Share

Recommended Posts

I want to animate a div by changing it's top property like so:

	var loadingFrame = 1; loadingFrame = (loadingFrame + 1) % 12;		// Loading animation	jQuery('div.ModalLoading div').css('top', (loadingFrame * -40) + 'px');

div.ModalLoading	{		height: 40px; width: 40px; margin: 0 auto 20px; overflow: hidden; z-index: 1104; position: relative;	}	div.ModalLoading div	{		position: absolute; top: 0; left: 0; width: 40px; height: 480px; background: url('loading.png');	}

The idea is that the inner div will look like it is sliding up inside the ModalLoading div, and needs to continue infinite. At the moment the div is stationary. Thanks.EDIT: This is based upon the loading in FancyBox --> http://fancybox.net/ if that helps anyone debug my code.

Edited by driz
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...