Hi all, I have made simple slide that slides block from the left to the right. I used requestAnimationFrame for repated tasks. It works. But one problem is that when blocks are moving sometimes freeze and i saw that sliding is not smooth. Where i made mistake in my code? below is slider.
Slider
Any help greatly appreciated. Thanks in advance.
Azer_1
0
Newbie Poster
Recommended Answers
Jump to PostJust tried it and it seemed smooth to my. It's the office laptop with is the usual i7 16GB SSD thing.
Jump to PostThere are views about what correct code is. Is it OTB (one true brace) or other? The last time I looked there are 10 accepted (or more) code styles. There are also standards for variable naming and more. In this instance I did not review code as I can't guess …
Jump to PostI do see a slight hick-up in the animation too. It is slight, because there's nothing else that could influence the animation (like a design as a background).
Why not animating with CSS transform2D (transform: translateX()
) instead of theleft
property? CSS transforms use their own rendering layer and therefore …
All 9 Replies
rproffitt
2,565
"Nothing to see here."
Moderator
Azer_1
0
Newbie Poster
rproffitt
2,565
"Nothing to see here."
Moderator
Azer_1
0
Newbie Poster
gentlemedia
803
Master Poster
Azer_1
0
Newbie Poster
gentlemedia
803
Master Poster
Azer_1
0
Newbie Poster
gentlemedia
803
Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.