javascript - Change background-position of an image? -
this question has answer here:
- change background position jquery 5 answers
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; } } });
you should use background-position
not backgroudposition
in ''
, there syntax error did not close brackets
$(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
Post a Comment