imitations records第一天

OPACITY,高亮
.header .register li:hover{ opacity: 1; }

.header .register li:hover{
	opacity: 1;
}

:这里不要有空格

.content_in .content_left {
	float: left;
	width: 800px;
	height: 100%;
	background: pink;
}

.之前需要有空格
css:no-repeat不需要平铺

find(expr|obj|ele)
概述
搜索所有与指定表达式匹配的元素。这个函数是找出正在处理的元素的后代元素的好方法。

所有搜索都依靠jQuery表达式来完成。这个表达式可以使用CSS1-3的选择器语法来写。

参数
exprStringV1.0
用于查找的表达式

jQuery object  objectV1.6
一个用于匹配元素的jQuery对象

elementDOMElementV1.6
一个DOM元素

查找资源

http://hemin.cn/jq/find.html

在这里插入图片描述

css

* {
	margin: 0;
	padding: 0;
}

.header {
	width: 100%;
	height: 45px;
	background-color: red;
}

.header .logo {
	float: left;
	margin-top: 5px;
	margin-left: 20px;
	opacity: 0.5;
}

.header .logo:hover {
	opacity: 1;

}

.header .logo a {
	display: inline-block;
	width: 78px;
	height: 21px;
	background: url(../img/images/player_logo.png) no-repeat 0 0;
}

.header .register {
	float: right;
	line-height: 45px;
}

.header .register li {
	list-style: none;
	float: left;
	margin-right: 20px;
	color: #fff;
	opacity: 0.5;
}

.header .register li:hover {
	opacity: 1;
}

.content {
	width: 100%;
	height: 460px;
	background: blue;
}

.content .content_in {
	width: 1200px;
	height: 100%;
	background: deeppink;
	margin: 0 auto;
}

.content_in .content_left {
	float: left;
	width: 800px;
	height: 100%;
	background: pink;
}

.content_left .content_toolbar {
	width: 100%;
	height: 40px;
	background: #000;
	/*color: wheat;也可以*/

}

.content_toolbar span {
	display: inline-block;
	width: 122px;
	height: 100%;
	line-height: 40px;
	text-align: center;
	border: 1px solid #FFFFFF;
	box-sizing: border-box;
	border-radius: 5px;
	color: white;
	opacity: 0.5;
}

.content_toolbar span:hover {
	opacity: 1;
}

.content_toolbar span i {
	display: inline-block;
	width: 18px;
	height: 18px;
	background: url(../img/images/icon_sprite.png) no-repeat 0 0;
	margin-right: 10px;
	vertical-align: -5px;

}

.content_toolbar span:nth-child(1) i {
	background-position: -60px -20px;
}

.content_toolbar span:nth-child(2) i {
	background-position: -20px -20px;
}

.content_toolbar span:nth-child(3) i {
	background-position: -40px -220px;
}

.content_toolbar span:nth-child(4) i {
	background-position: -100px -20px;
}

.content_toolbar span:nth-child(5) i {
	background-position: -40px -300px;
}

.content_in .content_right {
	float: right;
	width: 400px;
	height: 100%;
	background: #ccc;
}

.content_left .content_list {
	width: 100%;
	height: 420px;
	background: purple;
}

.content_list li{
	list-style: none;
	width: 100%;
	height: 50px;
	background: orangered;
	/*opacity: 0.5;这样也可以*/
	border-bottom: 1px solid rgba(255,255,255,0.5);
	box-sizing: border-box;
	user-select:none;
}
.content_list li div{
	float: left;
	color: #fff;
	line-height: 50px;
	opacity: 0.5;
}
.content_list .list_check{
	width: 50px;
	height: 100%;
	background: #000000;
	text-align: center;
}
.content_list .list_check i{
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 1px solid #fff;
}
.content_list .list_checked i{
	background: url(../img/images/icon_sprite.png) no-repeat -60px -80px;
}
.content_list .list_number{
	width: 20px;
	height: 100%;
	/*background: green;*/
}
.content_list .list_name{
	width: 50%;
	height: 100%;
	/*background: #CCCCCC;*/
}
.list_name .list_menu{
	margin-top: 5px;
	float: right;
	margin-right: 20px;
	display: none;
}
.list_menu a{
	display: inline-block;
	width: 36px;
	height: 36px;
	background: url(../img/images/icon_list_menu.png) no-repeat 0 0;
}
.list_menu a:nth-child(1){
	background-position: -120px 0;
}
.list_menu a:nth-child(2){
	background-position: -120px -80px;
}
.list_menu a:nth-child(3){
	background-position: -120px -120px;
}
.list_menu a:nth-child(4){
	background-position: -120px -40px;
}
.content_list .list_singer{
	width: 20%;
	height: 100%;
	background:pink;
}
.content_list .list_time a{
	display: inline-block;
	width: 36px;
	height: 36px;
	background: url(../img/images/icon_list_menu.png) no-repeat -120px -160px;
	float: left;
	margin-top: 5px;
	display: none;
}
.footer {
	width: 100%;
	height: 60px;
	background: green;
	position: absolute;
	left: 0;
	bottom: 0;
}

.footer .footer_in {
	width: 1200px;
	height: 100%;
	background: plum;
	margin: 0 auto;
}

html

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>QQ音乐播放器</title>
		<link rel="stylesheet" href="css/index.css" />
		<script src="js/jquery-3.4.1.min.js">

		</script>
		<script src="js/js/index.js">

		</script>
	</head>
	<body>
		<div class="header">
			<h1 class="logo"><a href="#"></a></h1>
			<ul class="register">
				<li>登录</li>
				<li>设置</li>
			</ul>
		</div>
		<div class="content">
			<div class="content_in">
				<div class="content_left">
					<div class="content_toolbar">
						<span><i></i>收藏</span>
						<span><i></i>添加到</span>
						<span><i></i>下载</span>
						<span><i></i>删除</span>
						<span><i></i>清空列表</span>
					</div>
					<div class="content_list">
						<ul>
							<li class="list_title">
								<div class="list_check">
									<i></i>
								</div>
								<div class="list_number">

								</div>
								<div class="list_name">
									歌曲
								</div>
								<div class="list_singer">
									歌手
								</div>
								<div class="list_time">
									时长
								</div>

							</li>
							<li class="list_music">
								<div class="list_check"><!--list_checked-->
									<i></i>
								</div>
								<div class="list_number">
									1
								</div>
								<div class="list_name">
									模仿名字
									<div class="list_menu">
										<a href="javascript:" title="播放"></a>
										<a href="javascript:" title="添加"></a>
										<a href="javascript:" title="下载"></a>
										<a href="javascript:" title="分享"></a>

									</div>
								</div>
								<div class="list_singer">
									歌手小崔
								</div>
								<div class="list_time">
									<span>66:66</span>
									<a href="javascript:" title="删除"></a>
								</div>

							</li>
							<li class="list_music">
								<div class="list_check">
									<i></i>
								</div>
								<div class="list_number">
									1
								</div>
								<div class="list_name">
									模仿名字
									<div class="list_menu">
										<a href="javascript:" title="播放"></a>
										<a href="javascript:" title="添加"></a>
										<a href="javascript:" title="下载"></a>
										<a href="javascript:" title="分享"></a>

									</div>
								</div>
								<div class="list_singer">
									歌手小崔
								</div>
								<div class="list_time">
									<span>66:66</span>
									<a href="javascript:" title="删除"></a>
								</div>

							</li>
							<li class="list_music">
								<div class="list_check">
									<i></i>
								</div>
								<div class="list_number">
									1
								</div>
								<div class="list_name">
									模仿名字
									<div class="list_menu">
										<a href="javascript:" title="播放"></a>
										<a href="javascript:" title="添加"></a>
										<a href="javascript:" title="下载"></a>
										<a href="javascript:" title="分享"></a>

									</div>
								</div>
								<div class="list_singer">
									歌手小崔
								</div>
								<div class="list_time">
									<span>66:66</span>
									<a href="javascript:" title="删除"></a>
								</div>

							</li>

						</ul>
					</div>
				</div>
				<div class="content_right">

				</div>
			</div>
			<div class="footer">
				<div class="footer_in">

				</div>
			</div>
		</div>
	</body>
</html>

js

$(function() {
	//1.监听歌曲的移入移出事件
	$(".list_music").hover(function() {
		//显示子菜单
		$(this).find(".list_menu").stop().fadeIn(100);
		$(this).find(".list_time a").stop().fadeIn(100);
		//隐藏时长
		$(this).find(".list_time span").stop().fadeOut(100);
	}, function() {
		//隐藏子菜单
		$(this).find(".list_menu").stop().fadeOut(100);
		$(this).find(".list_time a").stop().fadeOut(100);
		//显示时长
		$(this).find(".list_time span").stop().fadeIn(100);
	});
	//2监听复选框的点击事件
	$(".list_check").click(function(){
		$(this).toggleClass("list_checked");
	});
});

结束语

今天马上结束,这是今天敲的,话不多说,赶紧发表

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

是数学系的小孩儿

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值