Manolo
Manolo

Reputation: 26350

Automatically scroll to the right

I want to automatically scroll the page to the right. Is it possible with CSS, or I have to use Javascript - JQuery for that?

Then, I would hide the left of the page with:

overflow: hidden;

Upvotes: 1

Views: 251

Answers (2)

DaniP
DaniP

Reputation: 38252

You may need Jquery to acomplish that with a function like this:

$(document).ready(function(){
    var s =$('div').width();    
    $('body').scrollLeft(s).css('overflow','hidden')
})

Check this Fiddle http://jsfiddle.net/Bp4zF/

Upvotes: 1

Mike
Mike

Reputation: 884

Acheive with javascript.

window.scrollTo(x, y);

and

window.scrollBy(dx,dy) (ref)

Upvotes: 1

Related Questions