javascript - Change background-position of an image? -


this question has answer here:

hello afternoon community. want move background-position in xa image act video not mistake have before hand

$(document).ready(function() {     $('.imagen').mouseenter(function(){         var numero = -535;         var suma;         (var = 1; <= 10; i++) {             $(this).css({'backgroundposition': suma+"px 0px"}, "-10");             suma = numero * i;         }     } }); 

http://jsfiddle.net/kiokotzu/zw8rb/

you should use background-position not backgroudposition in '' , there syntax error did not close brackets

http://jsfiddle.net/zw8rb/2/

$(document).ready(function() {     $('.imagen').mouseenter(function(){         var numero = -535;         var suma;         (var = 1; <= 10; i++) {             $(this).css({'background-position': suma+"px 0px"}, "-10");             suma = numero * i;         }     } );     }); 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -