Scroll div's content horizontally endlessly

236 Views Asked by At

I'm looking for a plugin that will take a div, and scroll it's content horizontally endlessly.

I've tried using that plugin: http://plugins.jquery.com/marquee/, but for some unknown reason, it just doesn't work on my webpage! I tried to recreate the problem on jsFiddle, but over there, it works PERFECTLY fine! I have NO clue why! I've even copied my whole code to jsFiddle inorder to see maybe something else on my page ruins it, but on jsFiddle, it works!

I've also inspected the web source and it seems like the Marquee is working, it is animating the main div, but for some reason, the divs which contains the content, aren't being shown and remains static. Here's an image that demonstrates what I mean: enter image description here

The js I'm using in order to make it work:

$('.marquee').marquee({
  //speed in milliseconds of the marquee  
  speed: 15000,
  //gap in pixels between the tickers  
  gap: 50,
  //gap in pixels between the tickers  
  delayBeforeStart: 0,
  //'left' or 'right'  
  direction: 'right'
});

As I've mentioned, it works perfectly fine on jsFiddle, doens't work on my website.

So after trying to solve this for the past 2 hours, I've given up. I'm curently looking for another plugin which can do the same thing.

2

There are 2 best solutions below

1
On

If it works on jsFiddle it would also work for your local files.

Where are differences between the jsFiddle demo and your local files? I would try to remove things locally step by step until you know what the problem causes.

0
On

If someone will EVER come across this question, the issue is that the script can't handle right to left, and my whole webpage was declared as dir="rtl" so I've forced the div to be dir="ltr" and it works now.

Hope it will help someone in the future!