Jump to content

jQuery Animate

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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...