Reputation: 125
I have spent the last days looking for a simple javascript or jquery code for this. I want to incorporate a horizontal scrolling when navigation button is clicked ,The pages content should move left to right.
It would function very similar to the scrolling shown here:
http://codecanyon.net/item/fss-full-screen-sliding-website-plugin/full_screen_preview/159103
Upvotes: 0
Views: 92
Reputation: 1308
Try the scrollLeft and/or scrollTop methods:
https://developer.mozilla.org/en/DOM/element.scrollLeft
Use it in a nested container:
<div id="myDiv" style="width:100px;overflow:hidden">
<div>LONGTEXTLONGTEXTLONGTEXTLONGTEXTLONGTEXTLONGTEXTLONGTEXTLONGTEXT...</div>
</div>
<input type="button" onclick="document.getElementById('myDiv').scrollLeft += 10" value="Scroll!"/>
Upvotes: 1