<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>使用ul,li模拟multiple select。实现拖拽多选,不按ctrl,单击选中</title>
<link rel="stylesheet" href="select.css">
</head>
<body>
<div class="title">原生select</div>
<select name="" class="ori_select" multiple="">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
</select>
<div class="title">模拟select</div>
<ul class="ul_select">
<li value="1">1</li>
<li value="2">2</li>
<li value="3">3</li>
<li value="4">4</li>
<li value="5">5</li>
<li value="6">6</li>
<li value="7">7</li>
<li value="8">8</li>
<li value="9">9</li>
<li value="10">10</li>
<li value="11">11</li>
<li value="12">12</li>
<li value="13">13</li>
<li value="14">14</li>
<li value="15">15</li>
</ul>
<script src="http://apps.bdimg.com/libs/jquery/1.8.1/jquery.min.js"></script>
<script src="select.js"></script>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?20cda26566e422d6af05b2aea0fb4c9c";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
</body>
</html>
网友评论