Home > front end >  Ask for help, jQuery scrollLeft return values can be converted to decimal
Ask for help, jQuery scrollLeft return values can be converted to decimal

Time:12-08

In order to achieve a web page automatic horizontal scroll
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 look

CodePudding user response:

reference 1st floor hookee response:
minimum is 1 pixel, speed point to see

Our company want to capture this page, rolling on the led screen, achieve the effect of rolling, not fast, and soon also has a point card
  • Related