I'm trying to make an affiliates scroll and using deprecated code isn't an option. So, how do you achieve smooth marquee in Javascript without jQuery?

  • What's an "affiliates scroll?" Nathan Duran about 9 years ago

1 answer

danwellman 5600
This was chosen as the best answer

Is there a reason why you specifically must not use jQuery?

jQuery is just a JavaScript library, it runs on JavaScript and can only do what JavaScript can do, it just makes things a lot easier and quicker.

Similarly, anything that is possible with jQuery is also possible with plain JavaScript.

Of course, animating a series of names into a scrolling 'marquee' is easily possible with just JavaScript as opposed to jQuery, however, you can expect a lot of IE-specific code blocks (and a lot of IE-related headaches) before it will work relaibaly cross-browser.

Animations in jQuery are smooth because everything about jQuery is highly optimised - the selector engine Sizzle is very fast, the code itself is very efficient and the animation queue is also efficient at repeatedly running the sequence of 'frames' that make up the animation.

You will need to replicate all of this yourself - selecting the elements to be animated and repeatedly acting on them to give the impression of animation...

Use the google hosted version of jQuery, which a lot of people will already have in their browser cache if you are worried about using a massive JS library just for a simple animation...

Answered about 9 years ago by danwellman
  • Thanks. I was worried about the massive JS library for a simple animation. I will look into the Google hosted version, which I have been considering. I've worked with jQuery before, and it's just too big for a little animation. Ste4lth about 9 years ago
  • I haven't found any truth to your claims of superlative efficiency in my travels. jQuery is every bit as bloated as its competitors, and every bit as endangered by the prospect of widespread CSS transitions support to boot. This just sounds like a paid advertisement. Nathan Duran about 9 years ago
  • I wouldn't consider this an advertisement since it directly answers the question. The occurrences of jQuery mentioned in the answer were directly related to the question and Google uses a CDN which makes using the hosted version more efficient, reducing load on the site of which uses the library's server. Ste4lth about 9 years ago