/* ========== 舌签构造函数 begin ========== */
function(a){if(document.getElementById){return eval('document.getElementById("'+a+'")')}else{return eval('document.all.'+a)}}
/* ========== 舌签构造函数 end ========== */
function(a){if(document.getElementById){return eval('document.getElementById("'+a+'")')}else{return eval('document.all.'+a)}}
/* ========== 舌签构造函数 end ========== */
解决方案 »
- 关于拖动层过程中,使用滚轮的问题
- |zyciis| 在Jquery中 我想要获取当前对像时用$(this)不行,这样会返回jquery,我用$(this)也不行,要怎么办啊,谢谢
- 求个简单的特效
- 求救:Please 给我一个解决方案
- 菜鸟问一个语法问题,好像是自定义对象
- 一个Frame的导航问题
- 用javascript如何向ACCESS批量插入照片(100分)
- 我想实现这样一个功能,当用户点击一个URL连接的时候,不弹出窗口,并且不刷新当前页面就可以提交到这个URL连接,谢谢.
- 字符串问题?
- implementation file
- 高手请进:js能不能生产图片 是图片 不是img标签
- 回答的出,说明你的JS水准已从中级过度到高级。100分送上。。。。。。
http://www.awflasher.com/jspacker/index.php
var isIE = navigator.appVersion.indexOf("MSIE") != -1 ? true : false;
function SubShowClass(h, j, k, l, m) {
this.version = "1.0";
this.author = "mengjia";
this.parentObj = SubShowClass.$(h);
if (this.parentObj == null) {
throw new Error("SubShowClass(ID)\u53c2\u6570\u9519\u8bef:ID \u5bf9\u50cf\u5b58\u5728!");
}
if (!SubShowClass.childs) {
SubShowClass.childs = new Array();
}
this.ID = SubShowClass.childs.length;
SubShowClass.childs.push(this);
this.lock = false;
this.label = [];
this.defaultID = k == null ? 0 : k;
this.selectedIndex = this.defaultID;
this.openClassName = l == null ? "selected" : l;
this.closeClassName = m == null ? "" : m;
this.mouseIn = false;
var n = Function("SubShowClass.childs[" + this.ID + "].mouseIn = true");
var o = Function("SubShowClass.childs[" + this.ID + "].mouseIn = false");
if (isIE) {
this.parentObj.attachEvent("onmouseover", n);
} else {
this.parentObj.addEventListener("mouseover", n, false);
}
if (isIE) {
this.parentObj.attachEvent("onmouseout", o);
} else {
this.parentObj.addEventListener("mouseout", o, false);
}
if (typeof (j) != "string") {
j = "onmousedown";
}
j = j.toLowerCase();
switch (j) {
case "onmouseover":
this.eventType = "mouseover";
break;
case "onmouseout":
this.eventType = "mouseout";
break;
case "onclick":
this.eventType = "click";
break;
case "onmouseup":
this.eventType = "mouseup";
break;
default:
this.eventType = "mousedown";
}
this.addLabel = function (a, b, c, d, e) {
if (SubShowClass.$(a) == null) {
throw new Error("addLabel(labelID)\u53c2\u6570\u9519\u8bef:labelID \u5bf9\u50cf\u5b58\u5728!");
}
var f = this.label.length;
if (c == "") {
c = null;
}
this.label.push([a, b, c, d, e]);
var g = Function("SubShowClass.childs[" + this.ID + "].select(" + f + ")");
if (isIE) {
SubShowClass.$(a).attachEvent("on" + this.eventType, g);
} else {
SubShowClass.$(a).addEventListener(this.eventType, g, false);
}
if (f == this.defaultID) {
SubShowClass.$(a).className = this.openClassName;
if (SubShowClass.$(b)) {
SubShowClass.$(b).style.display = "";
}
if (c != null) {
this.parentObj.style.background = c;
}
if (d != null) {
eval(d);
}
} else {
SubShowClass.$(a).className = this.closeClassName;
if (SubShowClass.$(b)) {
SubShowClass.$(b).style.display = "none";
}
}
if (SubShowClass.$(b)) {
if (isIE) {
SubShowClass.$(b).attachEvent("onmouseover", n);
} else {
SubShowClass.$(b).addEventListener("mouseover", n, false);
}
if (isIE) {
SubShowClass.$(b).attachEvent("onmouseout", o);
} else {
SubShowClass.$(b).addEventListener("mouseout", o, false);
}
}
};
this.select = function (a) {
if (typeof (a) != "number") {
throw new Error("select(num)\u53c2\u6570\u9519\u8bef:num \u4e0d\u662f number \u7c7b\u578b!");
}
var i;
for (i = 0; i < this.label.length; i++) {
if (i == a) {
SubShowClass.$(this.label[i][0]).className = this.openClassName;
if (SubShowClass.$(this.label[i][1])) {
SubShowClass.$(this.label[i][1]).style.display = "";
}
if (this.label[i][2] != null) {
this.parentObj.style.background = this.label[i][2];
}
if (this.label[i][3] != null) {
eval(this.label[i][3]);
}
} else {
if (this.selectedIndex == i) {
SubShowClass.$(this.label[i][0]).className = this.closeClassName;
if (SubShowClass.$(this.label[i][1])) {
SubShowClass.$(this.label[i][1]).style.display = "none";
}
if (this.label[i][4] != null) {
eval(this.label[i][4]);
}
}
}
}
this.selectedIndex = a;
};
this.random = function () {
if (arguments.length != this.label.length) {
throw new Error("random()\u53c2\u6570\u9519\u8bef:\u53c2\u6570\u6570\u91cf\u4e0e\u6807\u7b7e\u6570\u91cf\u4e0d\u7b26!");
}
var a = 0, i;
for (i = 0; i < arguments.length; i++) {
a += arguments[i];
}
var b = Math.random(), percent = 0;
for (i = 0; i < arguments.length; i++) {
percent += arguments[i] / a;
if (b < percent) {
this.select(i);
break;
}
}
};
this.autoPlay = false;
var p = null;
this.spaceTime = 5000;
this.play = function (a) {
if (typeof (a) == "number") {
this.spaceTime = a;
}
clearInterval(p);
p = setInterval("SubShowClass.childs[" + this.ID + "].nextLabel()", this.spaceTime);
this.autoPlay = true;
};
this.nextLabel = function () {
if (this.autoPlay == false || this.mouseIn == true) {
return;
}
var a = this.selectedIndex;
a++;
if (a >= this.label.length) {
a = 0;
}
this.select(a);
};
this.stop = function () {
clearInterval(p);
this.autoPlay = false;
};
}
SubShowClass.$ = function (a) {
if (document.getElementById) {
return eval("document.getElementById(\"" + a + "\")");
} else {
return eval("document.all." + a);
}
};
var isIE=navigator.appVersion.indexOf("MSIE")!=-1?true:false;function SubShowClass(h,j,k,l,m){this.version="1.0";this.author="mengjia";this.parentObj=SubShowClass.$(h);if(this.parentObj==null){throw new Error("SubShowClass(ID)参数错误:ID 对像存在!")};if(!SubShowClass.childs){SubShowClass.childs=new Array()};this.ID=SubShowClass.childs.length;SubShowClass.childs.push(this);this.lock=false;this.label=[];this.defaultID=k==null?0:k;this.selectedIndex=this.defaultID;this.openClassName=l==null?"selected":l;this.closeClassName=m==null?"":m;this.mouseIn=false;var n=Function("SubShowClass.childs["+this.ID+"].mouseIn = true");var o=Function("SubShowClass.childs["+this.ID+"].mouseIn = false");if(isIE){this.parentObj.attachEvent("onmouseover",n)}else{this.parentObj.addEventListener("mouseover",n,false)};if(isIE){this.parentObj.attachEvent("onmouseout",o)}else{this.parentObj.addEventListener("mouseout",o,false)};if(typeof(j)!="string"){j="onmousedown"};j=j.toLowerCase();switch(j){case"onmouseover":this.eventType="mouseover";break;case"onmouseout":this.eventType="mouseout";break;case"onclick":this.eventType="click";break;case"onmouseup":this.eventType="mouseup";break;default:this.eventType="mousedown"};this.addLabel=function(a,b,c,d,e){if(SubShowClass.$(a)==null){throw new Error("addLabel(labelID)参数错误:labelID 对像存在!")};var f=this.label.length;if(c==""){c=null};this.label.push([a,b,c,d,e]);var g=Function('SubShowClass.childs['+this.ID+'].select('+f+')');if(isIE){SubShowClass.$(a).attachEvent("on"+this.eventType,g)}else{SubShowClass.$(a).addEventListener(this.eventType,g,false)};if(f==this.defaultID){SubShowClass.$(a).className=this.openClassName;if(SubShowClass.$(b)){SubShowClass.$(b).style.display=""};if(c!=null){this.parentObj.style.background=c};if(d!=null){eval(d)}}else{SubShowClass.$(a).className=this.closeClassName;if(SubShowClass.$(b)){SubShowClass.$(b).style.display="none"}};if(SubShowClass.$(b)){if(isIE){SubShowClass.$(b).attachEvent("onmouseover",n)}else{SubShowClass.$(b).addEventListener("mouseover",n,false)};if(isIE){SubShowClass.$(b).attachEvent("onmouseout",o)}else{SubShowClass.$(b).addEventListener("mouseout",o,false)}}};this.select=function(a){if(typeof(a)!="number"){throw new Error("select(num)参数错误:num 不是 number 类型!")};var i;for(i=0;i=this.label.length){a=0};this.select(a)};this.stop=function(){clearInterval(p);this.autoPlay=false}};SubShowClass.$=function(a){if(document.getElementById){return eval('document.getElementById("'+a+'")')}else{return eval('document.all.'+a)}}
改为
if (this.autoPlay == false || this.mouseIn == true) {