-
js 模拟选择文件效果
代码来自网络
<html>
<head>
</head>
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
<style>![](https://www.cnblogs.com/Images/dot.gif)
body
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
}{
padding-top: 50px;
padding-left: 100px;
padding-right: 150px;
}
.fileDiv
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
}{
float: left;
width: 100px;
height: 100px;
text-align: center;
line-height: 100px;
font-size: 12px;
border: 1px solid #cccccc;
margin-right: 10px;
margin-bottom: 10px;
}
.seled
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
}{
border: 1px solid #ff0000;
background-color: #D6DFF7;
}
</style>
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
<script type="text/javascript">![](https://www.cnblogs.com/Images/dot.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
/**//*--------------------------------- 以下4个方法 摘自网络 ----------------------------------------*/
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
Array.prototype.remove = function(item)
{
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
for (var i = 0; i < this.length; i++)
{
if (item == this[i])
break;
}
if (i == this.length)
return;
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
for (var j = i; j < this.length - 1; j++)
{
this[j] = this[j + 1];
}
this.length--;
}
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
String.prototype.replaceAll = function(AFindText, ARepText)
{ raRegExp = new RegExp(AFindText, "g"); return this.replace(raRegExp, ARepText); }
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
function getAllChildren(e)
{
return e.all ? e.all : e.getElementsByTagName('*');
}
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
document.getElementsBySelector = function(selector)
{
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if (!document.getElementsByTagName)
{
return new Array();
}
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
var tokens = selector.split(' ');
var currentContext = new Array(document);
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
for (var i = 0; i < tokens.length; i++)
{
token = tokens[i].replace(/^\s+/, '').replace(/\s+$/, ''); ;
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if (token.indexOf('#') > -1)
{
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
var bits = token.split('#');
var tagName = bits[0];
var id = bits[1];
var element = document.getElementById(id);
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if (tagName && element.nodeName.toLowerCase() != tagName)
{
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
return new Array();
}
currentContext = new Array(element);
continue;
}
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if (token.indexOf('.') > -1)
{
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
var bits = token.split('.');
var tagName = bits[0];
var className = bits[1];
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if (!tagName)
{
tagName = '*';
}
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
var found = new Array;
var foundCount = 0;
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
for (var h = 0; h < currentContext.length; h++)
{
var elements;
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if (tagName == '*')
{
elements = getAllChildren(currentContext[h]);
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
} else
{
elements = currentContext[h].getElementsByTagName(tagName);
}
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
for (var j = 0; j < elements.length; j++)
{
found[foundCount++] = elements[j];
}
}
currentContext = new Array;
var currentContextIndex = 0;
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
for (var k = 0; k < found.length; k++)
{
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if (found[k].className && found[k].className.match(new RegExp('\\b' + className + '\\b')))
{
currentContext[currentContextIndex++] = found[k];
}
}
continue;
}
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if (token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/))
{
var tagName = RegExp.$1;
var attrName = RegExp.$2;
var attrOperator = RegExp.$3;
var attrValue = RegExp.$4;
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if (!tagName)
{
tagName = '*';
}
var found = new Array;
var foundCount = 0;
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
for (var h = 0; h < currentContext.length; h++)
{
var elements;
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if (tagName == '*')
{
elements = getAllChildren(currentContext[h]);
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
} else
{
elements = currentContext[h].getElementsByTagName(tagName);
}
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
for (var j = 0; j < elements.length; j++)
{
found[foundCount++] = elements[j];
}
}
currentContext = new Array;
var currentContextIndex = 0;
var checkFunction;
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
switch (attrOperator)
{
case '=':
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
checkFunction = function(e)
{ return (e.getAttribute(attrName) == attrValue); };
break;
case '~':
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
checkFunction = function(e)
{ return (e.getAttribute(attrName).match(new RegExp('\\b' + attrValue + '\\b'))); };
break;
case '|':
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
checkFunction = function(e)
{ return (e.getAttribute(attrName).match(new RegExp('^' + attrValue + '-?'))); };
break;
case '^':
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
checkFunction = function(e)
{ return (e.getAttribute(attrName).indexOf(attrValue) == 0); };
break;
case '$':
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
checkFunction = function(e)
{ return (e.getAttribute(attrName).lastIndexOf(attrValue) == e.getAttribute(attrName).length - attrValue.length); };
break;
case '*':
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
checkFunction = function(e)
{ return (e.getAttribute(attrName).indexOf(attrValue) > -1); };
break;
default:
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
checkFunction = function(e)
{ return e.getAttribute(attrName); };
}
currentContext = new Array;
var currentContextIndex = 0;
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
for (var k = 0; k < found.length; k++)
{
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if (checkFunction(found[k]))
{
currentContext[currentContextIndex++] = found[k];
}
}
continue;
}
tagName = token;
var found = new Array;
var foundCount = 0;
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
for (var h = 0; h < currentContext.length; h++)
{
var elements = currentContext[h].getElementsByTagName(tagName);
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
for (var j = 0; j < elements.length; j++)
{
found[foundCount++] = elements[j];
}
}
currentContext = found;
}
return currentContext;
}
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
/**//*--------------------------------------------------------------------------------------------------------*/
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
/**//**
* author: 王永山
* version: 1.1 beta
* date: 2008-09-09
* email: [email]wangys0927@163.com[/email]
*
* update:
* 1. 针对前2个beta版,该版本修复了前两个版本出现的 bug ,
* 2. 进行了代码的简单封装(由于本人初学js,对js掌握的很浅,因此面向对象的理解很差,封装的不好);
* 3. 增加了对 Ctrl 和 Shift 键的支持(目前shift键的功能和ctrl键的功能一样,还不能达到仿windows的选区Shift键的功能)。
* 4. 增加了获取“被选区选中元素”的方法,可以点击按钮“getRegions”看效果。
*/
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
function addEvent(eventType, eventFunc, eventObj)
{
eventObj = eventObj || document;
if (window.attachEvent) eventObj.attachEvent("on" + eventType, eventFunc);
if (window.addEventListener) eventObj.addEventListener(eventType, eventFunc, false);
}
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
function clearEventBubble(evt)
{
evt = evt || window.event;
if (evt.stopPropagation) evt.stopPropagation(); else evt.cancelBubble = true;
if (evt.preventDefault) evt.preventDefault(); else evt.returnValue = false;
}
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
function posXY(event)
{
event = event || window.event;
var posX = event.pageX || (event.clientX +
(document.documentElement.scrollLeft || document.body.scrollLeft));
var posY = event.pageY || (event.clientY +
(document.documentElement.scrollTop || document.body.scrollTop));
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
return
{ x: posX, y: posY };
}
//----------- 区域选择关键方法 -----------------------
var _selectedRegions = [];
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
function RegionSelect(selRegionProp)
{
this.regions = [];
var _regions = document.getElementsBySelector(selRegionProp["region"]);
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if (_regions && _regions.length > 0)
{
var _self = this;
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
for (var i = 0; i < _regions.length; i++)
{
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
_regions[i].onmousedown = function()
{
var evt = window.event || arguments[0];
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if (!evt.shiftKey && !evt.ctrlKey)
{
// 清空所有select样式
_self.clearSelections(_regions);
this.className += " " + _self.selectedClass;
// 清空selected数组,并加入当前select中的元素
_selectedRegions = [];
_selectedRegions.push(this);
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
} else
{
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if (this.className.indexOf(_self.selectedClass) == -1)
{
this.className += " " + _self.selectedClass;
_selectedRegions.push(this);
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
} else
{
this.className = this.className.replaceAll(_self.selectedClass, "");
_selectedRegions.remove(this);
}
}
clearEventBubble(evt);
}
this.regions.push(_regions[i]);
}
}
this.selectedClass = selRegionProp["selectedClass"];
this.selectedRegion = [];
this.selectDiv = null;
this.startX = null;
this.startY = null;
}
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
RegionSelect.prototype.select = function()
{
var _self = this;
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
addEvent("mousedown", function()
{
var evt = window.event || arguments[0];
_self.onBeforeSelect(evt);
clearEventBubble(evt);
}, document);
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
addEvent("mousemove", function()
{
var evt = window.event || arguments[0];
_self.onSelect(evt);
clearEventBubble(evt);
}, document);
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
addEvent("mouseup", function()
{
_self.onEnd();
}, document);
}
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
RegionSelect.prototype.onBeforeSelect = function(evt)
{
// 创建模拟 选择框
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if (!document.getElementById("selContainer"))
{
this.selectDiv = document.createElement("div");
this.selectDiv.style.cssText = "position:absolute;0px;height:0px;font-size:0px;margin:0px;padding:0px;border:1px dashed #0099FF;background-color:#C3D5ED;z-index:1000;filter:alpha(opacity:60);opacity:0.6;display:none;";
this.selectDiv.id = "selContainer";
document.body.appendChild(this.selectDiv);
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
} else
{
this.selectDiv = document.getElementById("selContainer");
}
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
this.startX = posXY(evt).x;
this.startY = posXY(evt).y;
this.isSelect = true;
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
}
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
RegionSelect.prototype.onSelect = function(evt)
{
var _self = this;
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if (_self.isSelect)
{
if (_self.selectDiv.style.display == "none") _self.selectDiv.style.display = "";
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
var posX = posXY(evt).x;
var poxY = posXY(evt).y;
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
_self.selectDiv.style.left = Math.min(posX, this.startX);
_self.selectDiv.style.top = Math.min(poxY, this.startY);
_self.selectDiv.style.width = Math.abs(posX - this.startX);
_self.selectDiv.style.height = Math.abs(poxY - this.startY);
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
var regionList = _self.regions;
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
for (var i = 0; i < regionList.length; i++)
{
var r = regionList[i], sr = _self.innerRegion(_self.selectDiv, r);
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if (sr && r.className.indexOf(_self.selectedClass) == -1)
{
r.className = r.className + " " + _self.selectedClass;
_selectedRegions.push(r);
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
} else if (!sr && r.className.indexOf(_self.selectedClass) != -1)
{
r.className = r.className.replaceAll(_self.selectedClass, "");
_selectedRegions.remove(r);
}
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
}
}
}
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
RegionSelect.prototype.onEnd = function()
{
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if (this.selectDiv)
{
this.selectDiv.style.display = "none";
}
this.isSelect = false;
//_selectedRegions = this.selectedRegion;
}
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
// 判断一个区域是否在选择区内
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
RegionSelect.prototype.innerRegion = function(selDiv, region)
{
var s_top = parseInt(selDiv.style.top);
var s_left = parseInt(selDiv.style.left);
var s_right = s_left + parseInt(selDiv.offsetWidth);
var s_bottom = s_top + parseInt(selDiv.offsetHeight);
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
var r_top = parseInt(region.offsetTop);
var r_left = parseInt(region.offsetLeft);
var r_right = r_left + parseInt(region.offsetWidth);
var r_bottom = r_top + parseInt(region.offsetHeight);
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
var t = Math.max(s_top, r_top);
var r = Math.min(s_right, r_right);
var b = Math.min(s_bottom, r_bottom);
var l = Math.max(s_left, r_left);
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
if (b > t + 5 && r > l + 5)
{
return region;
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
} else
{
return null;
}
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
}
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
RegionSelect.prototype.clearSelections = function(regions)
{
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
for (var i = 0; i < regions.length; i++)
{
regions[i].className = regions[i].className.replaceAll(this.selectedClass, "");
}
}
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
function getSelectedRegions()
{
return _selectedRegions;
}
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
/**//*-------------------------------------- 区域选择方法结束 --------------------------------------------*/
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
function showSelDiv()
{
var selInfo = "";
var arr = getSelectedRegions();
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
for (var i = 0; i < arr.length; i++)
{
selInfo += arr[i].innerHTML + "\n";
}
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
alert("共选择 " + arr.length + " 个文件,分别是:\n" + selInfo);
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
}
</script>
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
<body>
<button onclick="showSelDiv();">
getRegions</button>
<div class="fileDiv">
file1</div>
<div class="fileDiv">
file2</div>
<div class="fileDiv">
file3</div>
<div class="fileDiv">
file4</div>
<div class="fileDiv">
file5</div>
<div class="fileDiv">
file6</div>
<div class="fileDiv">
file7</div>
<div class="fileDiv">
file8</div>
<div class="fileDiv">
file9</div>
<div class="fileDiv">
file10</div>
<div class="fileDiv">
file11</div>
<div class="fileDiv">
file12</div>
<div class="fileDiv">
file13</div>
<div class="fileDiv">
file14</div>
<div class="fileDiv">
file15</div>
<div class="fileDiv">
file16</div>
<div class="fileDiv">
file17</div>
<div class="fileDiv">
file18</div>
<div class="fileDiv">
file19</div>
<div class="fileDiv">
file20</div>
<div class="fileDiv">
file21</div>
<div class="fileDiv">
file22</div>
<div class="fileDiv">
file23</div>
<div class="fileDiv">
file24</div>
<div class="fileDiv">
file25</div>
<div class="fileDiv">
file26</div>
<div class="fileDiv">
file27</div>
<div class="fileDiv">
file28</div>
<div class="fileDiv">
file29</div>
<div class="fileDiv">
file30</div>
<div class="fileDiv">
file31</div>
<div class="fileDiv">
file32</div>
<div class="fileDiv">
file33</div>
<div class="fileDiv">
file34</div>
<div class="fileDiv">
file35</div>
<div class="fileDiv">
file36</div>
<div class="fileDiv">
file37</div>
<div class="fileDiv">
file38</div>
<div class="fileDiv">
file39</div>
<div class="fileDiv">
file40</div>
<div class="fileDiv">
file41</div>
<div class="fileDiv">
file42</div>
<div class="fileDiv">
file43</div>
<div class="fileDiv">
file44</div>
<div class="fileDiv">
file45</div>
<div class="fileDiv">
file46</div>
<div class="fileDiv">
file47</div>
<div class="fileDiv">
file48</div>
<div class="fileDiv">
file49</div>
<div class="fileDiv">
file50</div>
<div class="fileDiv">
file51</div>
<div class="fileDiv">
file52</div>
<div class="fileDiv">
file53</div>
<div class="fileDiv">
file54</div>
<div class="fileDiv">
file55</div>
<div class="fileDiv">
file56</div>
<div class="fileDiv">
file57</div>
<div class="fileDiv">
file58</div>
<div class="fileDiv">
file59</div>
<div class="fileDiv">
file60</div>
<div style="float: left; 100%;">
<button onclick="showSelDiv();">
getRegions</button></div>
</body>
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
<script>![](https://www.cnblogs.com/Images/dot.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
new RegionSelect(
{
region: 'div.fileDiv',
selectedClass: 'seled'
}).select();
</script>
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
</html>
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
-
相关阅读:
自定义类型中结构体、枚举等,结构体内存对齐相关要点总结
可变参数模拟printf()函数实现一个my_print()函数以及调用可变参数需注意的陷阱
一些关于memcpy memmove函数的区别,和模拟实现
浅谈 数组指针 指针数组 函数指针 函数指针数组... 以及它们之间区别。
C语 三子棋小游戏
5位运动员参加了10米台跳水比赛,有人让他们预测比赛结果
stm32移植ds18b20时出现的问题
自己实现strcmp
C语言新手写扫雷攻略3
C语言新手写扫雷攻略2
-
原文地址:https://www.cnblogs.com/yiki/p/1585911.html
Copyright © 2020-2023
润新知