<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src="js/jquery-3.2.1.js"></script>
<script type="text/javascript" src="js/script.js"></script>
<link rel="stylesheet" type="text/css" href="css/style.css" rel="external nofollow" >
</head>
<body>
<div id="container">
<ul>
<li>
<div class="lebal"><label></label></div>
<div class="file_name"><p>文件列表</p></div>
</li>
<li>
<div class="lebal"><label></label></div>
<div class="file_name"><p>文件列表</p></div>
</li>
<li>
<div class="lebal"><label></label></div>
<div class="file_name"><p>文件列表</p></div>
</li>
<li>
<div class="lebal"><label></label></div>
<div class="file_name"><p>文件列表</p></div>
</li>
<li>
<div class="lebal"><label></label></div>
<div class="file_name"><p>文件列表</p></div>
</li>
<li>
<div class="lebal"><label></label></div>
<div class="file_name"><p>文件列表</p></div>
</li>
<li>
<div class="lebal"><label></label></div>
<div class="file_name"><p>文件列表</p></div>
</li>
<li>
<div class="lebal"><label></label></div>
<div class="file_name"><p>文件列表</p></div>
</li>
<li>
<div class="lebal"><label></label></div>
<div class="file_name"><p>文件列表</p></div>
</li>
</ul>
</div>
</body>
</html>
* {margin: 0;padding: 0;}
body {height: 700px;border: 1px black solid;}
#selectBox {border: 1px solid #89d9ff;background-color: rgba(137, 217, 255, 0.5);position: absolute;display: block;}
#container {margin-top: 100px;margin-left: 200px;width: 1200px;height: 600px;border: 1px red solid;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;}
ul {margin: 20px;}
li {width: 100%;height: 40px;border-top: 1px #ddd solid;list-style: none;}
label {background: url('../images/lebal.png')no-repeat;background-position: 0 0;width: 15px;height: 15px;margin: 12.5px auto;display: block;}
.toggleLebalClass {background-position: 0 -52px;}
.toggleLiClass {background: #eeefff;}
.lebal {width: 40px;height: 40px;float: left;}
.file_name {width: 80%;height: 40px;float: left;}
p {line-height: 40px;}
"use strict";
var x, y;
$(function() {
// 点选
$("li").bind('click', function(event) {
$(this).children(".lebal").children().toggleClass("toggleLebalClass");
$(this).toggleClass("toggleLiClass");
});
// 复选
$(".lebal").bind('mousedown', function(event) {
event.stopPropagation();
})
// 拖选
$("#container").mousedown(function(event) {
x = event.pageX;
y = event.pageY;
$("#container").append("<div id='selectBox'></div>");
$("li").children(".lebal").children().removeClass("toggleLebalClass");
$("li").removeClass("toggleLiClass");
$("li").bind("mouseover", function() {
$(this).children(".lebal").children().addClass("toggleLebalClass");
$(this).addClass("toggleLiClass");
});
}).mousemove(function(event) {
$("#selectBox").css({
left: event.pageX > x ? x : event.pageX,
top: event.pageY > y ? y : event.pageY,
width: Math.abs(event.pageX - x),
height: Math.abs(event.pageY - y)
});
}).mouseup(function(event) {
$("#selectBox").remove();
$("li").unbind("mouseover");
})
$("#container").mouseleave(function() {
$("#selectBox").remove();
})
});
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有