flymis/WebRoot/dojojs/src/lfx/shadow.js
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.lfx.shadow");
dojo.require("dojo.lang.common");
dojo.require("dojo.uri.Uri");
dojo.lfx.shadow = function(/* HTMLElement */node) {
// summary
// creates a shadow underneath node.
this.shadowPng = dojo.uri.dojoUri("src/html/images/shadow");
this.shadowThickness = 8;
this.shadowOffset = 15;
this.init(node);
}
dojo.extend(dojo.lfx.shadow, {
init: function(/* HTMLElement */node){
// summary
// Initializes the shadow.
this.node=node;
// make all the pieces of the shadow, and position/size them as much
// as possible (but a lot of the coordinates are set in sizeShadow
this.pieces={};
var x1 = -1 * this.shadowThickness;
var y0 = this.shadowOffset;
var y1 = this.shadowOffset + this.shadowThickness;
this._makePiece("tl", "top", y0, "left", x1);
this._makePiece("l", "top", y1, "left", x1, "scale");
this._makePiece("tr", "top", y0, "left", 0);
this._makePiece("r", "top", y1, "left", 0, "scale");
this._makePiece("bl", "top", 0, "left", x1);
this._makePiece("b", "top", 0, "left", 0, "crop");
this._makePiece("br", "top", 0, "left", 0);
},
_makePiece: function(name, vertAttach, vertCoord, horzAttach, horzCoord, sizing){
var img;
var url = this.shadowPng + name.toUpperCase() + ".png";
if(dojo.render.html.ie55 || dojo.render.html.ie60){
img=dojo.doc().createElement("div");
img.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+url+"'"+
(sizing?", sizingMethod='"+sizing+"'":"") + ")";
}else{
img=dojo.doc().createElement("img");
img.src=url;
}
img.style.position="absolute";
img.style[vertAttach]=vertCoord+"px";
img.style[horzAttach]=horzCoord+"px";
img.style.width=this.shadowThickness+"px";
后面还有 26 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。