jquery仿京东商品页面

京东页面大家都很熟悉,进入商品页面把鼠标放在图片上旁边会出现一个放大的效果,接下来就带大家看看怎么实现的!!!!
仿京东商品页面css的代码!!!
*{
margin: 0;
padding: 0;
}
.da{
width: 360px;
height: 418px;
float: left;
}
.shang{
width: 350px;
height: 350px;
border: 1px solid #ccc;
margin: 10px 0 10px 10px;
position: relative;
}
.yin{
width: 150px;
height: 150px;
border: 1px solid #ccc;
background: rgba(255,255,255,0.3);
position: absolute;
top:0;
left: 0;
cursor: pointer;
display: none;
}
.bao{
width: 362px;
height: 56px;
}
.tab{
width: 320px;
height: 56px;
margin-left: 10px;
overflow: hidden;
}
.Ul{
width: 9999px;
height: 56px;
}
.Ul li{
width: 52px;
height: 52px;
float: left;
border: 2px solid #ccc;
margin-left: 8px;
list-style: none;
position:relative;
text-align:center;
}
.li{
width: 52px;
height: 52px;
border: 2px solid #FF7403;
}
.li img{
display: block;
position: absolute;
top:50%;
left: 50%;
margin-top:-26px;
margin-left:-26px;
}
.zuo{
display: block;
width: 12px;
height: 56px;
background: url(../img/icon_clubs.gif) no-repeat;
background-size: 180px 608px;
background-position: -82px -462px;
float: left;
margin-left: 10px;
}
.you{
display: block;
width: 12px;
height: 56px;
background: url(../img/icon_clubs.gif) no-repeat;
background-size: 180px 608px;
background-position: -95px -462px;
float: right;
margin-top: -56px;
}
.xia{
width: 360px;
height: 418px;
border: 1px solid #ccc;
float: left;
margin: 10px 0 0px 20px;
overflow: hidden;
display: none;
}
.lie{
width: 1329px;
height: 30px;
margin-left: 10px;
margin-top: 20px;
border-bottom: 2px solid #BE0000;
}
.lie li{
float: left;
list-style: none;
width: 80px;
height: 28px;
background: #fff;
border-radius: 3px;
border: 0;
line-height: 30px;
text-align: center;
margin-right: 5px;
border:1px solid #BE0000;
color: #c30;
cursor: pointer;
font-weight: bold;
}
.lie>ul .ll{
width: 80px;
height: 30px;
background: #BE0000;
border-radius: 3px;
border: 0;
line-height: 30px;
text-align: center;
color: #fff;
cursor: pointer;
}
.nie{
width: 1329px;
height: 200px;
margin-left: 10px;
overflow: hidden;
}
.bao1{
width: 1329px;
height: 500px;
}
.up{
width: 1329px;
height: 200px;
}
.up span{
display: block;
padding:10px 0 0 10px;
margin-bottom: 70px;
}
.up p{
text-align: center;
margin-top: 5px;
}
.down{
width: 1329px;
height: 300px;
background: yellow;
}
仿京东商品页面html的代码!!!
<div>
<div class="da ">
<div class="shang">
<img src="img/b1.jpg" height="350" width="350" id="pian">
<div class="yin"></div>
</div>
<div class="bao">
<span class="zuo"></span>
<div class="tab">
<ul class="Ul">
<li>
<img src="img/b1.jpg" height="52" width="52" />
</li>
<li>
<img src="img/b2.jpg" height="52" width="52" />
</li>
<li>
<img src="img/b3.jpg" height="52" width="52" />
</li>
<li>
<img src="img/b1.jpg" height="52" width="52" />
</li>
<li>
<img src="img/b2.jpg" height="52" width="52" />
</li>
<li>
<img src="img/b3.jpg" height="52" width="52" />
</li>
<li>
<img src="img/b1.jpg" height="52" width="52" />
</li>
<li>
<img src="img/b2.jpg" height="52" width="52" />
</li>
</ul>
</div>
<span class="you"></span>
</div>
<div class="lie ">
<ul>
<li class="ll">图文介绍</li>
<li>评论(1)</li>
</ul>
</div>
<div class="nie">
<div class="bao1">
<div class="up">
<span>暂无好评!</span>
<p>适用浏览器:IE8、360、FireFox、Chrome、Safari、Opera、傲游、搜狗、世界之窗</p>
<p>来源:师徒课堂</p>
</div>
<div class="down">
<img src="img/11.png" height="300" width="1329" />
</div>
</div>
</div>
</div>
<div class="xia">
<img src="img/b1.jpg" height="600" width="600" id="zhao" />
</div>
</div>
仿京东商品页面jquery的代码!!!
$(function(){
var $yin = $(".yin");
$(".Ul li img").mouseover(function(){
$(this).parent().addClass("li").siblings().removeClass("li");
$("#pian").attr("src",$(this).attr("src"));
$("#zhao").attr("src",$(this).attr("src"));
}).mouseout(function(){
$(this).parent().removeClass("li");
});
var l = $(".shang").eq(0).offset().left;
var t = $(".shang").eq(0).offset().top;
var width1 = $(".yin").outerWidth()/2;
var height1 = $(".yin").outerHeight()/2;
var maxL = $(".shang").width() - $yin.outerWidth();
var maxT = $(".shang").height() - $yin.outerHeight();
var bili = $("#zhao").width()/$("#pian").width();
$(".shang").mousemove(function(e){
var maskL = e.clientX - l - width1,maskT = e.clientY - t - height1;
if (maskL < 0) { maskL = 0};
if (maskT < 0) { maskT = 0};
if (maskL > maxL) {maskL = maxL};
if (maskT > maxT) {maskT = maxT};
$yin.css({"left":maskL,"top":maskT});
$(".xia").show();
$(".yin").show();
$("#zhao").css({"margin-left":-maskL*bili,"margin-top":-maskT*bili});
});
$(".shang").mouseleave(function(){
$(".xia").hide();
$(".yin").hide();
});
var marginLeft = 0;
$(".you").click(function(){
marginLeft = marginLeft - 64;
if (marginLeft < -192) {marginLeft = -192};
$(".tab ul").stop().animate({"margin-left":marginLeft},"fast");
});
$(".zuo").click(function(){
marginLeft = marginLeft + 64;
if (marginLeft > 0) {marginLeft = 0};
$(".tab ul").stop().animate({"margin-left":marginLeft},"fast");
});
$(".lie li").click(function(){
var index=$(this).index();
$(this).addClass("ll").siblings().removeClass("ll");
$(".bao1>div").eq(index).show().siblings().hide();
});
});
仿京东商品页面的效果!!!
怎么样,当我做出来的时候感觉神清气爽!!!!!
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
# jquery京东商品浏览页面
# jquery商品放大浏览
# jquery商品放大
# jQuery模仿京东/天猫商品左侧分类导航菜单效果
# jquery 实现京东商城、凡客商城的图片放大效果
# jQuery实现等比例缩放大图片让大图片自适应页面布局
# 用JQuery模仿淘宝的图片放大镜显示效果
# 基于jquery实现一张图片点击鼠标放大再点缩小
# 基于Jquery插件开发之图片放大镜效果(仿淘宝)
# jQuery当鼠标悬停时放大图片的效果实例
# jquery图片放大镜功能的实例代码
# 关于Jqzoom的使用心得 jquery放大镜效果插件
# jquery实现图片放大点击切换
# 京东
# 放在
# 暂无
# 鼠标
# 大家都
# 当我
# 神清气爽
# 搜狗
# 很熟悉
# 大家多多
# 就带
# 傲游
# 世界之窗
# style
# text
# list
# align
# img
# block
# center
相关文章:
建站之星如何开启自定义404页面避免用户流失?
个人摄影网站制作流程,摄影爱好者都去什么网站?
制作网站怎么制作,*游戏网站怎么搭建?
如何破解联通资金短缺导致的基站建设难题?
车管所网站制作流程,交警当场开简易程序处罚决定书,在交警网站查询不到怎么办?
广州营销型建站服务商推荐:技术优势与SEO优化解析
建站之星备案是否影响网站上线时间?
如何在IIS7中新建站点?详细步骤解析
如何在Tomcat中配置并部署网站项目?
成都网站制作公司哪家好,四川省职工服务网是做什么用?
北京网站制作网页,网站升级改版需要多久?
武汉网站如何制作,黄黄高铁武穴北站途经哪些村庄?
css网站制作参考文献有哪些,易聊怎么注册?
网页设计与网站制作内容,怎样注册网站?
制作电商网页,电商供应链怎么做?
制作网站建设的公司有哪些,网站建设比较好的公司都有哪些?
广州建站公司哪家好?十大优质服务商推荐
专业商城网站制作公司有哪些,pi商城官网是哪个?
青岛网站设计制作公司,查询青岛招聘信息的网站有哪些?
如何在建站之星绑定自定义域名?
红河网站制作公司,红河事业单位身份证如何上传?
制作国外网站的软件,国外有哪些比较优质的网站推荐?
如何在Golang中使用encoding/gob序列化对象_存储和传输数据
广州美橙建站如何快速搭建多端合一网站?
招贴海报怎么做,什么是海报招贴?
如何在阿里云完成域名注册与建站?
手机网站制作平台,手机靓号代理商怎么制作属于自己的手机靓号网站?
建站主机与虚拟主机有何区别?如何选择最优方案?
宿州网站制作公司兴策,安徽省低保查询网站?
如何制作一个表白网站视频,关于勇敢表白的小标题?
如何选择美橙互联多站合一建站方案?
广州网站制作公司哪家好一点,广州欧莱雅百库网络科技有限公司官网?
c# 在高并发场景下,委托和接口调用的性能对比
php8.4新语法match怎么用_php8.4match表达式替代switch【方法】
广州网站制作的公司,现在专门做网站的公司有没有哪几家是比较好的,性价比高,模板也多的?
图片制作网站免费软件,有没有免费的网站或软件可以将图片批量转为A4大小的pdf?
正规网站制作公司有哪些,目前国内哪家网页网站制作设计公司比较专业靠谱?口碑好?
打鱼网站制作软件,波克捕鱼官方号怎么注册?
如何在沈阳梯子盘古建站优化SEO排名与功能模块?
如何在Golang中引入测试模块_Golang测试包导入与使用实践
如何快速生成ASP一键建站模板并优化安全性?
如何选择可靠的免备案建站服务器?
云南网站制作公司有哪些,云南最好的招聘网站是哪个?
香港服务器如何优化才能显著提升网站加载速度?
Thinkphp 中 distinct 的用法解析
上海网站制作开发公司,上海买房比较好的网站有哪些?
如何在腾讯云服务器快速搭建个人网站?
唐山网站制作公司有哪些,唐山找工作哪个网站最靠谱?
建站之星安装需要哪些步骤及注意事项?
C#怎么创建控制台应用 C# Console App项目创建方法
*请认真填写需求信息,我们会在24小时内与您取得联系。