栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > Web开发 > JavaScript

jquery仿京东侧边栏导航效果

JavaScript 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

jquery仿京东侧边栏导航效果

本文实例为大家分享了jquery仿京东侧边栏导航的具体代码,供大家参考,具体内容如下

样式代码


  *{
   padding: 0;
   margin: 0;
   border: 0;
  }
 body{

  height: 2000px;

 }
 .right_ng{
  width: 40px;
  height: 100%;
  position: absolute;
  position: fixed;
  right: 0px;
  background: #666666;


 }
 .sign{
  width: 40px;
  height: 40px; 
  margin-top:280%;
 }
 .sign_top{
  margin-top: 10px;
 }
 .sign_add_height{
  height: 140px;
  background: #888888;
  color: #ffffff;
  font-size: 13px;
  list-style: none;
  font-weight: bold;
 }
 .sign_add_height ul{
  margin-top: 6px;
  cursor: pointer;
 }
 .sign_add_height ul li{
  list-style-type: none;
  width: 20px;
  height: 20px;
  margin-top: 5px;
 }
 .buy{
  width: 20px;
  height: 20px;
  border-radius: 10px 10px;
  background:#666;
 }
 .sign_QR{
  margin-top: 200%;
  position: absolute;
  bottom: 50px;
  position: fixed;
  background: #666666;
 }
 .sign_end{
 position: absolute;
 bottom: 0px;
 position: fixed;
 background: #666666;
 }
 .sign img{
  width: 22px;
  height: 22px;
  margin-top: 10px;
  cursor: pointer;
 }
 .run_sign{
  width: 100px;
  height: 40px;
  margin-left: -100px;
  margin-top: -35px;
  background: #666666;
  color: #1afa29;
  font-size: 13px;
  line-height: 40px;
   cursor: pointer;
 }
 .run_QR{
  height: 250px;
  width: 200px;
  margin-left: -200px;
  margin-top: -245px;
 }
 .sign_float{
  position: fixed;
 }

 

jQuery代码

这里把图片的名称换成数字的,每一个图标都有两个图片, 一个白色和一个绿色的,当鼠标移动到其中一个图标处时,改变其图片使其变色,因为一共有八个图标,所以总共有16张图片。因此图片名改变为当前图片名称数字+8。

这里用的动态是slideDown与slideUp。需要注意的是要设置索引来寻找但前对象的位置(因为是在for循环里有了索引才能找到当前对象的图片的数字名称)。



布局代码


 
  
   
我的订单
我的收藏
我的优惠券
我的足迹
我的JImu
  • 0

微信扫码享优惠
加关注

效果图:

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持考高分网。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/89552.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号