代码拉取完成,页面将自动刷新
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="referrer" content="no-referrer"/>
<title></title>
<link rel="stylesheet" type="text/css" href="css/tabdemo.css"/>
<script src="js/jquery-3.5.1.js" ></script>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>
<script src="js/bootstrap.js"></script>
</head>
<body>
<div class="tabox">
<div class="hd">
<ul>
<li class="on">最近热门电影</li>
<li class=" ">即将上映电影</li>
<li class=" ">电影详情</li>
<li class=" ">热评商品</li>
<li class=" ">新品上架</li>
</ul>
</div>
<div class="container" id="bd">
<ul class="lh row row-cols-3">
</ul>
<ul class="lh row row-cols-3" style="display: none;">
</ul>
<ul class="lh row row-cols-3" style="display: none;">
</ul>
<ul class="lh row row-cols-3" style="display: none;">
</ul>
<ul class="lh row row-cols-3" style="display: none;">
</ul>
</div>
</div>
<script type="text/javascript">
//179000522 廖孟豪
$(function() {
$("li").click(function(){
$(this).addClass("on").siblings().removeClass("on");
// $(".lh").eq($(this).index()).show().siblings().hide();
})
$.ajax({
method:"get",
url:"https://douban.uieee.com/v2/movie/in_theaters",
success:function(date) {
console.log(date);
console.log(date.subjects.length);
for(let i in date.subjects){
$("#bd ul").append(`<li><p style="height:20px;" align="center">电影名:${date.subjects[i].title}</p><br />
<img src='${date.subjects[i].images.large}' height="430px"/></li>`);
}
}
})
})
</script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。