smoth movig background IE adaptation


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $(document).ready(function(){
  2. var div_pics_top_css = {
  3. 'position':'absolute',
  4. 'top':'13px',
  5. 'left':'343px',
  6. 'height':'80px',
  7. 'width':'450px',
  8. 'background':'url(/images/all.jpg) repeat-x 0px 0px '
  9. }
  10.  
  11. $('div#pics_top').css(div_pics_top_css);
  12. setInterval ("move_gall()", 33);
  13. })
  14.  
  15.  
  16. function move_gall(){
  17. var b = $('div#pics_top').css('background').replace(/px/gi,'').split(' ');
  18. var l_pos = String(b[b.length-2]-1)+'px'
  19. $('div.pics_top').css('background-position',l_pos)
  20. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.