How can I set left and right buttons on a DIV to scroll the content horizontally? I don’t need to display a scrollbar.
HMTL:
<div id="browser">
<a href="#" id="left-button"><img src="left-button.jpg" /></a>
<img src="thumb_1.jpg" />
<img src="thumb_2.jpg" />
<img src="thumb_3.jpg" />
<img src="thumb_4.jpg" />
<img src="thumb_5.jpg" />
<img src="thumb_6.jpg" />
<a href="#" id="right-button"><img src="right-button.jpg" /></a>
</div>
CSS:
#browser { float: left; width: 200px; overflow: hidden; white-space: nowrap; }
Do:
Then the same for the left button, except – marginLeft: +=”200px”.