I'm through the increase and decrease scrollLeft values to change the page relative to the location of the browser, so as to realize rolling,
Actual effect now found page scrolling a card a card, a little off the frame,
My idea is to make web page each time the mobile distance is a bit less
But scrollleft this value as if it was only an integer, so the minimum interval is 1 px, already not
Is there any way you can make web pages each time only mobile 0.2 px
Or is there any better way the implementation of the web page scrolling
& lt; The script type="text/javascript" & gt;
Var speed=70
Var I=demo. ScrollLeft
The function Marquee () {
The demo. ScrollLeft++
If (demo. ScrollLeft & gt; {
=5125)ClearInterval (MyMar)
Goto ();
}
}
The function goto () {
The function Marquee2 () {
The demo. ScrollLeft -- --
If (demo. ScrollLeft & lt;=0) {
ClearInterval (MyMar2)
MyMar=setInterval (Marquee, speed)
}
}
Var MyMar2=setInterval (Marquee2, speed)
}
Var MyMar=setInterval (Marquee, speed)
</script>
CodePudding user response:
Minimum is 1 pixel, speed point and have a lookCodePudding user response: