Take a look at this link. There are 12 menu items, but only 4 are visible due to space constraint. The rest are hidden.
Update: Jsfiddle cleaned up and removed my fiddle. I have provided an alternative link above. There was a missing jQuery part in my question.
I have two buttons:
- Move Left by -1 (referred to as 'ML')
- Move Right by +1 (referred to as 'MR')
I am attempting to achieve the following:
- Clicking on
MR
will shift menus by+1
- Clicking on
ML
will shift menus by-1
HTML
<div id="outer">
<input type="button" value="move left by -1" class="left" />
<input type="button" value="Move Right by +1" class="left" />
<ul id="menulist">
<li>Menu 1</li>
<li>Menu 2</li>
<li>Menu 3</li>
<li>Menu 4</li>
<li>Menu 5</li>
<li>Menu 6</li>
<li>Menu 7</li>
<li>Menu 8</li>
<li>Menu 9</li>
<li>Menu 10</li>
<li>Menu 11</li>
<li>Menu 12</li>
</ul>
CSS
#outer {
width:448px;
overflow:hidden;
}
.left {
float:left;
}
ul, li {
list-style:none;
margin:0;
padding:0;
overflow:hidden;
}
ul {
font-size:0;
float:left;
width:1400px;
}
li {
display:inline-block;
padding:5px;
background:lightgrey;
border:darkgrey;
width:100px;
overflow:hidden;
text-align:center;
font-size:14px;
border:1px solid black;
}
Any assistance with this issue would be greatly appreciated.