Fiido Firdauz Fiido Firdauz - 5 months ago 16x
Javascript Question

infinite looping using scroll overflow-x

Target to achieve

I manage to make a result using overflow-y infinite looping,

i'm trying to make something different

What i'm trying to do is when the user scrolling overflow-x and the width document will increase +++ .

But the result that i get right now is the height of document are increase.


$(window).scroll(function () {
if ($(window).scrollLeft() >= $(document).width() - $(window).width() - 10) {
setTimeout(function() {
var box = $("#scrollbox");
var aj = $(".set");
box.html(box.html() + aj.html());

}, 100);

Please help me.

Your help really appreciate

Here is the DEMO


You need to change your style to be like this:

  margin:0 80px;

    white-space: nowrap;
    text-overflow: ellipsis;

Demo :