driz Posted September 15, 2010 Share Posted September 15, 2010 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.