我需要在每次鼠标移动时改变背景位置。图像被设置为背景,这是图像,
https://pbdlbd.org/ipositive/wp-content/uploads/2015/02/one10.jpg
我想在每次鼠标移动时移动背景位置。这个图像有4个部分(每个部分的高度是523px),首先它将显示顶部部分,鼠标移动到它上面后,它将显示第二部分,在另一个鼠标移动时,它将显示第三部分,在第四部分之后,它将重复鼠标移动到它上面。鼠标从图像中移除后,将显示图像的默认顶部。
就像这样,
document.getElementById("#ipos .flex_cell").onmousemove = function() {
//Set background position 523px bottom on each mouse move
#ipos .flex_cell.style.background-position = center -523px (here i can't make it so that it changes to -1046px by code);
}这是网站,http://pbdlbd.org/ipositive/
提前谢谢你
https://stackoverflow.com/questions/47489062
复制相似问题