Posted By

almazom on 10/08/09


Tagged

jqueryanimation


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

sulfurito


smoth movig background


 / Published in: jQuery
 

URL: http://www.youtube.com/watch?v=EzolxzuBXjo

  1. $(document).ready(function(){
  2. setInterval ("move_gall()", 100);
  3. })
  4.  
  5.  
  6. function move_gall(){
  7. var backpos = $('div.pics_top').css('background-position').replace(/px/gi,'').split(' ');
  8. var l_pos = String(backpos[0]-3)+'px 0px'
  9. $('div.pics_top').css('background-position',l_pos)
  10. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: almazom on October 13, 2009

IE correction

$(document).ready(function(){ var divpicstop_css = { 'position':'absolute', 'top':'13px', 'left':'343px', 'height':'80px', 'width':'450px', 'background':'url(/images/all.jpg) repeat-x 0px 0px ' }

$('div#pics_top').css(div_pics_top_css);

setInterval ("move_gall()", 33);

})

function movegall(){ var b = $('div#picstop').css('background').replace(/px/gi,'').split(' '); var lpos = String(b[b.length-2]-1)+'px' $('div.picstop').css('background-position',l_pos) }

You need to login to post a comment.