1 <!DOCTYPE HTML>2 <HTML>3 <HeadLang= "en">4 <MetaCharSet= "UTF-8">5 <title></title>6 <styletype= "Text/css">7 * {8 margin:0;9 padding:0;Ten } One ul{ A List-style:None; - } - the . Wrap{ - width:1010px; - margin:100px Auto 0; - } + . Wrap Li{ - width:200px; + Height:400px; A float: Left; at } - </style> - <Scriptsrc=".. /jquery-1.11.1.min.js "></Script> - <Script> - $ (document). Ready (function () { - $('. Wrap Li'). each (function(I,ele) { in $ (ele). CSS ("background","URL (images/"+(i+ 1) +". jpg)"); - }). MouseEnter (function(){ to $( This). Stop (). Animate ({width: -}, -). Siblings ('Li'). Stop (). Animate ({width: -}, -) + }). MouseLeave (function(){ - $('. Wrap Li'). Stop (). Animate ({width: $}, -); the * }) $ });Panax Notoginseng </Script> - </Head> the <Body> + <Divclass= "Wrap"> A <ul> the <Li></Li> + <Li></Li> - <Li></Li> $ <Li></Li> $ <Li></Li> - </ul> - </Div> the </Body> - </HTML>
The accordion effect that jquery implements