Now using jquery to implement the sliding menu is a very simple thing, let's take a slide menu using jquery implementation code.
<title>here</title>
<script src= "Http://code.jquery.com/jquery-1.4.4.min.js" ></script>
<body style= "Text-align:center;" >
<div style= "width:540px; margin:0 auto; " >
<div id= "button1" class= "button" style= "Float:left;width:50px;margin:2px;background-color: #f00; Cursor:pointer; " >1</div>
<div id= "button2" class= "button" style= "Float:left;width:50px;margin:2px;background-color: #f00; Cursor:pointer; " >2</div>
<div id= "Button3" class= "button" style= "Float:left;width:50px;margin:2px;background-color: #f00; Cursor:pointer; " >3</div>
<div id= "Button4" class= "button" style= "Float:left;width:50px;margin:2px;background-color: #f00; Cursor:pointer; " >4</div>
<div id= "button5" class= "button" style= "Float:left;width:50px;margin:2px;background-color: #f00; Cursor:pointer; " >5</div>
<div id= "button6" class= "button" style= "Float:left;width:50px;margin:2px;background-color: #f00; Cursor:pointer; " >6</div>
<div id= "button7" class= "button" style= "Float:left;width:50px;margin:2px;background-color: #f00; Cursor:pointer; " >7</div>
<div id= "Button8" class= "button" style= "Float:left;width:50px;margin:2px;background-color: #f00; Cursor:pointer; " >8</div>
<div id= "Button9" class= "button" style= "Float:left;width:50px;margin:2px;background-color: #f00; Cursor:pointer; " >9</div>
<div id= "button10" class= "button" style= "Float:left;width:50px;margin:2px;background-color: #f00; Cursor:pointer; " >10</div>
</div>
<div style= "Clear:both" ></div>
<div style= "width:540px; margin:0 Auto; height:400px; position:relative; z-index:999; Overflow:hidden; " >
<div style= "position:relative;padding:0px;margin:0 auto;width:100px;" >
<div id= "list" style= "Width:1000px;height:400px;position:absolute; z-index:9;left:-220px; " >
<div style= "Width:96px;height:400px;background-color: #004; Margin:2px;float:left;color: #fff;" >1</div>
<div style= "Width:96px;height:400px;background-color: #008; Margin:2px;float:left;color: #fff;" >2</div>
<div style= "Width:96px;height:400px;background-color: #00f; Margin:2px;float:left;color: #fff;" >3</div>
<div style= "Width:96px;height:400px;background-color: #044; Margin:2px;float:left;color: #fff;" >4</div>
<div style= "Width:96px;height:400px;background-color: #048; Margin:2px;float:left;color: #fff;" >5</div>
<div style= "Width:96px;height:400px;background-color: #04f; Margin:2px;float:left;color: #fff;" >6</div>
<div style= "Width:96px;height:400px;background-color: #444; Margin:2px;float:left;color: #fff;" >7</div>
<div style= "Width:96px;height:400px;background-color: #448; Margin:2px;float:left;color: #fff;" >8</div>
<div style= "Width:96px;height:400px;background-color: #44f; Margin:2px;float:left;color: #fff;" >9</div>
<div style= "Width:96px;height:400px;background-color: #484; Margin:2px;float:left;color: #fff;" >10</div>
</div>
</div>
</div>
</body>
<script>
$ (document). Ready (function () {
var speed = 1000;
var div_width = $ ("#list > Div:first"). Width () + parseint ($ ("#list > Div:first"). CSS Tutorial ("Margin-left")) + parseint ($ ("#list > Div:first"). CSS ("Margin-right");
var offset = 220;
$ (". Button"). Click (function () {
ID = $ (this). attr ("id"). Replace ("button", "");
var _length =-(id-1) * DIV_WIDTH-OFFSET;
$ ("#list"). Animate ({left:_length + "px"},speed);
});
});
</script>