T
T
Timur Kalimullin2016-02-29 20:22:52
JavaScript
Timur Kalimullin, 2016-02-29 20:22:52

Why is javascipt scrolling heavy on cpu?

Good afternoon, I ran into a problem on some projects that use automatic scrolling using javascript for animation or interface.
The way it will be a simple js code or the smoothdivscroll plugin, when you visit a page with content scrolling, the cooler starts to work actively.
Let's take an example of animation of the movement of the background with clouds:

$('.clouds').animate({ 'backgroundPosition': '100000px' }, 4000000, 'linear');

or smoothdivscroll plugin
$('.scroll').smoothDivScroll(
{
hotSpotScrolling : false,
manualContinuousScrolling : true,
touchScrolling : true,
autoScrollingMode : 'onStart',
autoScrollingDirection : 'endlessLoopRight'
});

All methods heavily load the processor.
How can this be avoided? what can be optimized?
c2cfe13b530840429482f7d3d0445fd1.png
Thank you.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
AngReload, 2016-02-29
@AngReload

There is css animation for this. Well, or a more banal transition, it’s not clear what exactly is being animated for you.

D
Denis Ineshin, 2016-02-29
@IonDen

Let's do it together! C!S!S! C!S!S! C!S!S!
Hey! Who shouted jQuery?! Get him out of the room!

A
Alexander Wolf, 2016-02-29
@mannaro

Make a GIF animation instead of this obscurantism

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question