<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Document</title>
<link rel="stylesheet" href="css/index.css" />
<script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var screenAmount = $(".container ul li").length / 5;//计算屏幕数量
$(".container ul li:lt(5)").clone().appendTo(".container ul");//复制前5个元素
var nowScreen = 0; //屏幕号
$(".rightBtn").click(function(){
if(nowScreen < screenAmount - 1){
nowScreen ++ ;//屏幕号加1
$(".container").animate({"left" : -775 * nowScreen} , 800);//定义动画
}else{
nowScreen = 0;
$(".container").animate({"left" : -775 * screenAmount} , 800 , function(){
$(this).css("left",0);//元素回到初始位置
});
}
$(".hd .right span").html(nowScreen + 1 + "/" + screenAmount);//显示屏幕号
});
$(".leftBtn").click(function(){
if(nowScreen > 0){
nowScreen -- ;//屏幕号减1
$(".container").animate({"left" : -775 * nowScreen} , 800);//定义动画
}else{
nowScreen = screenAmount - 1;
$(".container").css("left" , -775 * screenAmount).animate({"left" : -775 * (screenAmount - 1)},800);//移动到复制的5个元素并执行动画
}
$(".hd .right span").html(nowScreen + 1 + "/" + screenAmount);//显示屏幕号
});
//每隔5秒钟自动触发元素的click事件
var timer = setInterval(function(){$(".rightBtn").trigger("click")}, 5000);
//鼠标进入元素停止移动
$(".is-on").mouseenter(function() {
clearInterval(timer);
});
//鼠标离开元素恢复移动
$(".is-on").mouseleave(function() {
timer = setInterval(function(){$(".rightBtn").trigger("click")}, 5000);
});
});
$(document).ready(function() {
var len = $(".banner").find("a");//获取广告图片
var pos = 0;//定义变量值为0
setInterval(function(){
len.eq(pos).hide();//隐藏元素
pos++;//变量值加1
if(pos == len.length) pos=0;//变量值重新定义为0
len.eq(pos).show();//显示元素
},3000);//每隔3秒钟切换元素
});
$(document).ready(function() {
$(".hot-film-main div").hide(); //隐藏热门电影和最新电影
$(".hot-film ul li a:first").addClass("active"); //为第一个标签添加样式
$(".hot-film-list").show(); //显示热门电影
$(".hot-film ul li a").click(function() { //鼠标单击某标签
//为当前的标签添加样式并移除另一标签样式
$(this).addClass("active").parent().siblings().find("a").removeClass("active");
var index = $(this).parent().index();//获取当前标签索引
$(".hot-film-main div").eq(index).show().siblings().hide();//控制热门电影和最新电影的显示或隐藏
});
});
</script>
</head>
<body>
<div id="nav">
<div class="nav-logo"><a href="index.html">仿豆瓣电影</a></div>
<div class="nav-items">
<ul>
<li><a href="javascript:;">影讯 & 购票</a></li>
<li><a href="javascript:;">选电影</a></li>
<li><a href="javascript:;">电视剧</a></li>
<li><a href="javascript:;">排行榜</a></li>
<li><a href="javascript:;">分类</a></li>
<li><a href="javascript:;">影评</a></li>
<li><a href="javascript:;">2018年度榜单</a></li>
</ul>
</div>
</div>
<div id="main">
<div id="left">
<div class="is-on">
<div class="hd">
<h2>正在热映</h2>
<div class="right">
<span>1/3</span>
<a class="leftBtn" href="javascript:;"></a>
<a class="rightBtn" href="javascript:;"></a>
</div>
</div>
<div class="bd">
<div class="container">
<ul>
<li>
<a href="detail/mnyys.html"><img src="images/1.jpg" alt="" /></a>
<p><a href="detail/mnyys.html">美女与野兽</a></p>
<div class="rating">
<span class="starrating"><span class="star40"></span></span>
<span class="score">7.2</span>
</div>
<a href="javascript:;" class="goupiao">选座购票</a>
</li>
<li>
<a href="detail/thwj.html"><img src="images/2.jpg" alt="" /></a>
<p><a href="detail/thwj.html">头号玩家</a></p>
<div class="rating">
<span class="starrating"><span class="star45"></span></span>
<span class="score">8.7</span>
</div>
<a href="javascript:;" class="goupiao">选座购票</a>
</li>
<li>
<a href="detail/fwhyj.html"><img src="images/3.jpg" alt="" /></a>
<p><a href="detail/fwhyj.html">飞屋环游记</a></p>
<div class="rating">
<span class="starrating"><span class="star45"></span></span>
<span class="score">8.9</span>
</div>
<a href="javascript:;" class="goupiao">选座购票</a>
</li>
<li>
<a href="detail/mtyj.html"><img src="images/4.jpg" alt="" /></a>
<p><a href="detail/mtyj.html">摩天营救</a></p>
<div class="rating">
<span class="starrating"><span class="star35"></span></span>
<span class="score">6.4</span>
</div>
<a href="javascript:;" class="goupiao">选座购票</a>
</li>
<li>
<a href="detail/yhhwd.html"><img src="images/5.jpg" alt="" /></a>
<p><a href="detail/yhhwd.html">银河护卫队</a></p>
<div class="rating">
<span class="starrating"><span class="star40"></span></span>
<span class="score">8.0</span>
</div>
<a href="javascript:;" class="goupiao">选座购票</a>
</li>
<li>
<a href="detail/crzdy2.html"><img src="images/6.jpg" alt="" /></a>
<p><a href="detail/crzdy2.html">超人总动员2</a></p>
<div class="rating">
<span class="starrating"><span class="star40"></span></span>
<span class="score">8.1</span>
</div>
<a href="javascript:;" class="goupiao">选座购票</a>
</li>
<li>
<a href="detail/jqrzdy.html"><img src="images/7.jpg" alt="" /></a>
<p><a href="detail/jqrzdy.html">机器人总动员</a></p>
<div class="rating">
<span class="starrating"><span class="star45"></span></span>
<span class="score">9.3</span>
</div>
<a href="javascript:;" class="goupiao">选座购票</a>
</li>
<li>
<a href="detail/jtmdt.html"><img src="images/8.jpg" alt="" /></a>
<p><a href="detail/jtmdt.html">惊天魔盗团</a></p>
<div class="rating">
<span class="starrating"><span class="star40"></span></span>
<span class="score">7.5</span>
</div>
<a href="javascript:;" class="goupiao">选座购票</a>
</li>
<li>
<a href="detail/cmdsj.html"><img src="images/9.jpg" alt="" /></a>
<p><a href="detail/cmdsj.html">楚门的世界</a></p>
<div class="rating">
<span class="starrating"><span class="star45"></span></span>
<span class="score">9.2</span>
</div>
<a href="javascript:;" class="goupiao">选座购票</a>
</li>
<li>
<a href="detail/dmkj.html"><img src="images/10.jpg" alt="" /></a>
<p><a href="detail/dmkj.html">盗梦空间</a></p>
<div class="rating">
<span class="starrating"><span class="star45"></span></span>
<span class="score">9.3</span>
</div>
<a href="javascript:;" class="goupiao">选座购票</a>
</li>
<li>
<a href="detail/fkdwc.html"><img src="images/11.jpg" alt="" /></a>
<p><a href="detail/fkdwc.html">疯狂动物城</a></p>
<div class="rating">
<span class="starrating"><span class="star45"></span></span>
<span class="score">9.1</span>
</div>
<a href="javascript:;" class="goupiao">选座购票</a>
</li>
<li>
<a href="detail/fczlm.html"><img src="images/12.jpg" alt="" /></a>
温轻舟
- 粉丝: 2831
- 资源: 6
最新资源
- YOLO算法-禾本科杂草数据集-4760张图像带标签.zip
- YOLO算法-无人机俯视视角动物数据集-10140张图像带标签-斑马-骆驼-大象-牛-羊.zip
- YOLO算法-挖掘机与火焰数据集-8129张图像带标签-挖掘机.zip
- YOLO算法-塑料数据集-3029张图像带标签-塑料制品-白色塑料.zip
- PyKDL库源码,编译安装PyKDL库
- YOLO算法-红外探测数据集-10573张图像带标签-小型车-人-无人机.zip
- 基于 C++和TCP和WebSocket的即时通信系统设计与实现(源码+文档)
- 电商管理系统项目源代码全套技术资料.zip
- 全国2022年04月高等教育自学考试02326操作系统试题及答案
- YOLO算法-垃圾数据集-3818张图像带标签-可口可乐-百事可乐.zip
- YOLO算法-瓶纸盒合并数据集-1317张图像带标签-纸张-纸箱-瓶子.zip
- YOLO算法-杂草检测项目数据集-3970张图像带标签-杂草.zip
- YOLO算法-杂草检测项目数据集-3853张图像带标签-杂草.zip
- YOLO算法-挖掘机与火焰数据集-7735张图像带标签-挖掘机.zip
- 文旅项目源代码全套技术资料.zip
- YOLO算法-罐头和瓶子数据集-1531张图像带标签-鲜奶-瓶子.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈