多语言展示
当前在线:842今日阅读:167今日分享:16

html+css3+jquery带图片的导航下拉特效

html+css3+jquery带图片的导航下拉特效
工具/原料

adobe dreamweaver

方法/步骤
1

准备好需要用到的图标。

2

新建html文档。

3

书写hmtl代码。

 
   
     
关于我们 行业考察 产品中心 技术服务 新闻中心 联系我们       
         
         
       
     
   
     

4

书写css代码。* { padding: 0; margin: 0; border: 0; outline: none; list-style-type: none; }em, i { font-style: normal; }a { color: #666; text-decoration: none; }a:hover { color: #066; }body { color: #666; font: 12px/22px 'Simsun', '宋体'; overflow-x: hidden; }.wrapper { width: 1920px; overflow: hidden; position: absolute; left: 50%; top: 0; margin: 0 0 0 -960px; height: 600px; }.topNav { width: 100%; height: 47px; background: url(../images/navbg.png); z-index: 1; }.topNavList { width: 1000px; height: 47px; margin: 0 auto; }.topNavSub { position: relative; }.topNav a { display: block; float: left; height: 47px; line-height: 47px; color: #066; font: 16px/47px 'Microsoft YaHei', 'Simsun', '宋体'; margin: 0 53px 0 13px; padding: 0 7px; }.activeTopNav { background: url(../images/navItemBg_13.png) 0 -1px; }.activeLeft { width: 8px; height: 51px; position: absolute; top: -1px; background: url(../images/navItemBg_12.png); display: none; }.activeRight { width: 10px; height: 51px; position: absolute; top: -1px; background: url(../images/navItemBg_14.png); display: none; }.subNavWrapper { width: 1000px; height: 300px; position: absolute; left: 50%; top: 44px; margin: 0 0 0 -495px; z-index: 1; display: none; }.subNavSet { width: 1000px; height: 300px; margin: 0 auto; position: relative; }.subNav { position: relative; display: none; }.subNav ul { width: 132px; height: 234px; position: absolute; left: 23px; top: 16px; color: #333; font: 14px/30px 'Simsun', '宋体'; }.subNav ul a { width: 130px; display: block; padding: 0 0 0 16px; float: left; color: #333; font: 14px/34px 'Microsoft YaHei', 'Simsun', '宋体'; background: url(../images/arrowSub.png) left center no-repeat; }.subNav ul a:hover { color: #066; text-decoration: underline; }.sub1 { left: 144px; }.sub2 { left: 168px; }.sub3 { left: 262px; }.sub4 { left: 157px; }.sub5 { left: 263px; }.sub0 .subBgTopLeft, .sub1 .subBgTopLeft { width: 706px; height: 7px; display: block; background: url(../images/subTop0.png); }.sub3 .subBgTopLeft { width: 706px; height: 7px; display: block; background: url(../images/subTop3.png); }.sub5 .subBgTopLeft { width: 706px; height: 7px; display: block; background: url(../images/subTop5.png); }.sub0 .subBgBotLeft, .sub1 .subBgBotLeft, .sub3 .subBgBotLeft, .sub5 .subBgBotLeft { width: 706px; height: 206px; display: block; background: url(../images/subBot0.png); }.sub2 .subBgTopLeft { width: 832px; height: 7px; display: block; background: url(../images/subTop2.png); }.sub4 .subBgTopLeft { width: 832px; height: 7px; display: block; background: url(../images/subTop4.png); }.sub2 .subBgBotLeft, .sub4 .subBgBotLeft { width: 832px; height: 206px; display: block; background: url(../images/subBot2.png); }.features { position: absolute; left: 195px; top: 19px; }.features i { width: 174px; display: block; float: left; margin: 0 40px; }.features a:hover img { border: 1px solid #448c8c; }.features i img { display: block; float: left; border: 1px solid #d7d8d8; margin-bottom: 12px; }.features i em { width: 174px; display: block; float: left; line-height: 20px; }

5

书写并添加js代码。 

6

代码整体结构。

7

查看效果。

注意事项

jquery-1.9.1.min.js是个js包,可以网上下载。

推荐信息