?? showalbummodule.config
字號:
document.detachEvent("onmousemove", MzBehavior.Drag.mousemoveHandler);
if(me.options.onfinish) me.options.onfinish(me);
};
this.mousedownHandler=function(e)
{
if(System.disabledList[me.hashCode]) return;
e = window.event || e; var body=MzElement.body();
var x = (e.pageX || e.clientX) + body.scrollLeft;
var y = (e.pageY || e.clientY) + body.scrollTop;
var xy = MzElement.realOffset(obj);
MzBehavior.Drag.offsetX = x - xy.x;
MzBehavior.Drag.offsetY = y - xy.y;
layer.style.cursor = "move";
layer.style.left = xy.x +"px";
layer.style.top = xy.y +"px";
layer.style.width = obj.offsetWidth +"px";
layer.style.height = obj.offsetHeight +"px";
MzElement.show(layer);
MzBehavior.Drag.instance=me;
if(layer.setCapture) layer.setCapture(); else
if(window.captureEvents)window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
document.attachEvent("onmousemove", MzBehavior.Drag.mousemoveHandler);
document.attachEvent("onmouseup", me.mouseupHandler);
}
op.trigger.attachEvent("onmousedown", this.mousedownHandler);
}
MzBehavior.Drag.prototype.restore=function()
{
this.element.removeAttribute(this.attributeName);
this.element.detachEvent("onmousedown", this.mousedownHandler);
this.dispose();
};
MzBehavior.Drag.createLayer=function()
{
if(MzBehavior.dragLayer && MzBehavior.dragLayer.tagName) return;
var layer=document.createElement("DIV");
layer.id="MzBehaviorDragLayer";
with(layer.style)
{
zIndex = System.zIndexBase.dragLayer;
border = "none";
cursor = "move";
display = "none";
position = "absolute";
margin = padding = "0px";
width = height = "20px";
backgroundImage = "url("+ System.resourcePath +"/blank.gif)";
}
var str = new Array(); var border = "3px";
str.push("<table border='0' cellpadding='0' cellspacing='0' style='");
str.push("width:100%; height:100%; {0} repeat-x left bottom'><tr>");
str.push("<td style='{0} repeat-y left top; {1}'> </td>");
str.push("<td style='{0} repeat-x left top;'> </td>");
str.push("<td style='{0} repeat-y right top; {1}'> </td>");
str.push("</tr></table>"); str=str.join("");
layer.innerHTML = str.format("background:url("+ System.resourcePath
+"/dashed.gif)", "width:2px; font-size:1px;");
document.body.insertBefore(layer, document.body.firstChild);
layer = null;
MzBehavior.dragLayer=MzElement.check("MzBehaviorDragLayer");
};
MzBehavior.Drag.mousemoveHandler=function(e)
{
var SLT = MzElement.body();
var D=MzBehavior.Drag, layer=MzBehavior.dragLayer;
var BSL = SLT.scrollLeft, BST = SLT.scrollTop;
var BCW = SLT.clientWidth, BCH = SLT.clientHeight;
e = window.event || e;
var x = (e.pageX || e.clientX) + BSL;
var y = (e.pageY || e.clientY) + BST;
D.left= Math.min(x - D.offsetX, BSL+BCW-layer.offsetWidth);
D.top = Math.min(y - D.offsetY, BST+BCH-layer.offsetHeight);
D.left= Math.max(0+BSL, D.left);
D.top = Math.max(0+BST, D.top);
layer.style.top = D.top +"px";
layer.style.left = D.left+"px";
};
MzBehavior.Drag.mouseupHandler=function()
{
var layer = MzBehavior.dragLayer, e=MzBehavior.Drag.instance.element;
e.style.left = layer.style.left; e.style.top = layer.style.top;
if (layer.releaseCapture) layer.releaseCapture(); else
if(window.captureEvents) window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
MzElement.hide(layer);
};
//[static method]
MzBehavior.highlight=function(e, op){return new MzBehavior.Highlight(e, op);}
MzBehavior.emboss =function(e, op){return new MzBehavior.Emboss(e, op);}
MzBehavior.rotate =function(e, op){return new MzBehavior.Rotate(e, op);}
MzBehavior.marquee =function(e, op){return new MzBehavior.Marquee(e, op);}
MzBehavior.fixed =function(e, op){return new MzBehavior.Fixed(e, op);}
MzBehavior.drag =function(e, op){return new MzBehavior.Drag(e, op);}
MzBehavior.lockWindow=function(bool){return MzBehavior.LockWindow(bool);}
/*** MzEffect.js ***/
/*---------------------------------------------------------------------------*\
| Subject: Html Element effect base
| NameSpace: System.Web.Forms.MzEffect
| Author: meizz
| Created: 2006-07-07
| Version: 2007-04-13
\*---------------------------------------------------------------------------*/
/*/Interface
Required: initialize() render() finish() restore()
abort() end() cancel() dispose()
op.onbeforestart() op.onbeforeupdate() op.onafterupdate() op.onafterfinish()
/*/
//op{interval, duration, overlap, trend, continual}
function MzEffect()
{
System.call(this);this.readyState=1;
this.element=MzElement.check(arguments[0]);
if(!this.element) return; var t;
this.terminative=false; //true for terminate effect
var op=this.options=System.extend({
"interval": 10 //milliseconds
,"duration": 800 //milliseconds
,"overlap": false
,"continual": true
,"trend": "strengthen" //strengthen|weaken true|false
},
arguments[1]||{}
);
op["trend"]= ("boolean"==typeof(op["trend"]) && op["trend"]) ||
("string"==typeof(op["trend"])&&op["trend"].toLowerCase()=="strengthen");
//prevent repeated effect
if(!op.overlap){this.attribName="att_"+this._className.replace(/\W/g, "_");
if(t=this.element.getAttribute(this.attribName))if(t=Instance(t))t.cancel();
this.element.setAttribute(this.attribName, this.hashCode, 0);}
this.beginTime = new Date().getTime();
this.endTime = this.beginTime + op.duration;
if(this.initialize) this.initialize();
/*_onbeforestart*/ MzEffect.attachEvent(this, "_onbeforestart");
/*onbeforestart*/ MzEffect.attachEvent(this, "onbeforestart");
/*onbeforeupdate*/ MzEffect.attachEvent(this, "onbeforeupdate");
/*onafterupdate*/ MzEffect.attachEvent(this, "onafterupdate");
/*onafterfinish*/ MzEffect.attachEvent(this, "onafterfinish");
this.dispatchEvent(new System.Event("_onbeforestart"));
this.dispatchEvent(new System.Event("onbeforestart"));
this.readyState=2;if(op.continual) this._process();else
if(!this.restore){this.restore=function(){};this.dispose();}
};
t=MzEffect.Extends(System, "MzEffect");
t._process=function()
{
var now = new Date().getTime(), me = this, op=this.options;
if (now>=this.endTime)
{
if(this.render) this.render((op.trend==true ? 1 : 0));
if(this.finish) this.finish(); this.readyState=4;
this.dispatchEvent(new System.Event("onafterfinish"));
this.dispose(); return;
} if(op){
var schedule = Math.sqrt((now-this.beginTime)/op.duration);
if(op.trend!=true) schedule = Math.pow((this.endTime-now)/op.duration, 2);
this.schedule = schedule;
this.dispatchEvent(new System.Event("onbeforeupdate"));
if(this.render)this.render(schedule);
this.dispatchEvent(new System.Event("onafterupdate"));
if(!this.terminative)
this.timer=setTimeout(function(){me._process()},op.interval); else
try{this.element.removeAttribute(this.attribName);}catch(ex){}}
me.readyState=3;
};
t.abort=function(){if(this.timer)clearTimeout(this.timer);};
t.end=function()
{
if(this.readyState==4) return;
if(this.timer) clearTimeout(this.timer);
this.endTime = this.beginTime; this._process();
}
t.cancel=function()
{
this.endTime = this.beginTime;
if(this.timer) clearTimeout(this.timer);
if(this.restore) this.restore();
this.dispose();
};
t.dispose=function()
{
if(this.element)this.element.removeAttribute(this.attribName);
//System.prototype.dispose.call(this);
if(System.ie) CollectGarbage();
};
MzEffect.attachEvent=function(T, type)
{
//if(T.options&&typeof(T.options[type])=="function")
// T.addEventListener(type, function(e){T.options[type](e)});
};
MzEffect.formatColor=function(color)
{
if(/^\#[\da-z]{6}$/i.test(color)) return color;
else if(color.indexOf("rgb(")==0)
{
var cs=color.substring(4, color.length-1).split(",");
for(var i=0, color="#"; i<cs.length; i++)
{
var s = parseInt(cs[i]).toString(16);
color+= ("00"+ s).substr(s.length);
}
return color;
}
return "";
};
/*--====== core effect ======--*/
//op{interval, duration, trend}
MzEffect.Opacity=function(element, op)
{
op = System.extend({interval: 20}, op||{});
op.simple = (System.ie && MzBrowser.version<5.5)
|| (MzBrowser.opera && MzBrowser.version<8.5);
MzEffect.apply(this, [element, op]);
};
MzEffect.Opacity.Extends(MzEffect, "MzEffect.Opacity").initialize=function()
{
var op=this.options, obj=this.element, me=this;
this.render=function(schedule)
{
schedule = me.schedule || schedule;
if(op.simple){me.endTime-=op.duration; return;}
if(!System.ie)
{
obj.style.opacity = schedule;
obj.style.MozOpacity = schedule;
obj.style.KHTMLOpacity = schedule;
}
else obj.style.filter = "alpha(opacity:"+Math.round(schedule*100)+")";
};
if (System.ie)op.originalFilter = obj.style.filter; else
{
op.originalOpacity = obj.style.opacity;
op.originalMozOpacity = obj.style.MozOpacity;
op.originalKHTMLOpacity = obj.style.KHTMLOpacity;
}
this.restore=function()
{
if(System.ie) obj.style.filter = op.originalFilter; else
{
obj.style.opacity = op.originalOpacity;
obj.style.MozOpacity = op.originalMozOpacity;
obj.style.KHTMLOpacity = op.originalKHTMLOpacity;
}
};
};
//op{interval, duration, trend}
MzEffect.MoveBy=function(element, x, y, op)
{
if("undefined"==typeof x || "undefined"==typeof y) return;
this.offsetX=parseFloat(x);
this.offsetY=parseFloat(y);
op=System.extend({duration: 400}, op||{});
MzEffect.apply(this, [element, op]);
};
MzEffect.MoveBy.Extends(MzEffect, "MzEffect.MoveBy").initialize=function()
{
var me=this, obj=me.element, op=me.options;
op.originalTop = obj.style.top;
op.originalLeft = obj.style.left;
op.originalPosition = obj.style.position;
me.originalY = parseFloat(obj.style.top || '0');
me.originalX = parseFloat(obj.style.left || '0');
if(obj.style.position == "") obj.style.position = "relative";
this.render=function(schedule)
{
schedule = me.schedule || schedule;
obj.style.left = (me.offsetX * schedule + me.originalX) +"px";
obj.style.top = (me.offsetY * schedule + me.originalY) +"px";
};
this.setPosition=function(x, y)
{
obj.style.top = y +"px";
obj.style.left = x +"px";
};
this.restore=function()
{
obj.style.top = op.originalTop;
obj.style.left = op.originalLeft;
obj.style.position = op.originalPosition;
};
};
//op{interval, duration, trend}
MzEffect.MoveTo=function(element, op)
{
if(!op&&("undefined"==typeof op.x||"undefined"==typeof op.y)) return;
this.x=parseFloat(op.x);this.y=parseFloat(op.y);
op=System.extend({duration: 300}, op||{});
MzEffect.apply(this, [element, op]);
};
MzEffect.MoveTo.Extends(MzEffect, "MzEffect.MoveTo").initialize=function()
{
var me=this, obj=me.element, op=me.options;
op.originalTop = obj.style.top;
op.originalLeft = obj.style.left;
op.originalPosition = obj.style.position;
me.originalY = parseFloat(obj.style.top || '0');
me.originalX = parseFloat(obj.style.left || '0');
me.offsetX = me.x - me.originalX;
me.offsetY = me.y - me.originalY;
if((obj.currentStyle && obj.currentStyle.position== "static")
|| obj.style.position == "") obj.style.position = "relative";
this.render=function(schedule)
{
schedule = me.schedule || schedule;
obj.style.left = (me.offsetX * schedule + me.originalX) +"px";
obj.style.top = (me.offsetY * schedule + me.originalY) +"px";
};
this.setPosition=function(x, y)
{
obj.style.top = y +"px";
obj.style.left = x +"px";
};
this.restore=function()
{
obj.style.top = op.originalTop;
obj.style.left = op.originalLeft;
obj.style.position = op.originalPosition;
};
};
//op{interval, duration, trend, color, beginColor, endColor, finalColor}
MzEffect.Highlight=function(element, op){MzEffect.apply(this, arguments);};
MzEffect.Highlight.Extends(MzEffect, "MzEffect.Highlight").initialize=function()
{
var op=this.options, obj=this.element, endColor="#FFFFFF";
var backColor = (obj.currentStyle||obj.style).backgroundColor;
op.originalBgColor = obj.style.backgroundColor;
op.originalColor = obj.style.color;
if(backColor) endColor = MzEffect.formatColor(backColor);
op.beginColor = op.beginColor || "#FFFF00";
op.endColor = op.endColor || endColor;
op.finalColor = op.finalColor || obj.style.backgroundColor;
this.colors_base=[
parseInt(op.beginColor.substring(1,3),16),
parseInt(op.beginColor.substring(3,5),16),
parseInt(op.beginColor.substr(5),16)];
this.colors_var=[
parseInt(op.endColor.substring(1,3),16)-this.colors_base[0],
parseInt(op.endColor.substring(3,5),16)-this.colors_base[1],
parseInt(op.endColor.substr(5),16)-this.colors_base[2]];
this.finish=function()
{
if(op.color) obj.style.color = op.color;
obj.style.backgroundColor = op.final
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -