DHTML打造PictureSpelling
添加时间: 2005-6-9 4:59:27 作者: 网络收集 阅读次数:73 来源: http://d9soft.com
firstChild.style.pixelLeft = - j * the_width;
firstChild.style.pixelTop = - i * the_height;
Pic_clip_all[i][j].flip_idx = 0;
if(flip.checked) {
var rnd = GetRndNum(0,7);
if(rnd<4) {
style.filter=Flip_list[rnd];
Pic_clip_all[i][j].flip_idx = rnd;
}
}
} else {
onmousedown = function(e){
if(e.target.parentNode.snap=='yes')return;
e.target.parentNode.style.zIndex = Zidx++;
Layer_cur = e.target.parentNode;
if(Layer_cur.snap=="yes") return;
pX=e.clientX-Layer_cur.offsetLeft;
pY=e.clientY-Layer_cur.offsetTop;
};
}
}
document.body.appendChild(Pic_clip_all[i][j]);
if(ns) {
with(Pic_clip_all[i][j].firstChild) {
src = Pic_list[Pic_cur].pic;
style.left = - j * the_width;
style.top = - i * the_height;
style.position = "relative";
}
}
}
}
document.getElementById("Board").innerHTML = "";
BuildTbl(document.getElementById("Board"));
return;
}
function BuildTbl(obj) {
var the_Tbl = document.createElement("table");
the_Tbl.id = "Spl_Board";
the_Tbl.border = 1;
the_Tbl.style.cssText = "padding:0px; border-collapse:collapse;background-color:#000000";
if(document.getElementById("zoom").checked) {
the_Tbl.style.width = Math.floor(Zwidth *(Zrate>1?1:Zrate));
the_Tbl.style.height = Math.floor(Zheight/(Zrate>1?Zrate:1));
} else {
the_Tbl.style.width = Pic_list[Pic_cur].width;
the_Tbl.style.height = Pic_list[Pic_cur].height;
}
for(var i=0; i<Clips; i++) {
var the_row = the_Tbl.insertRow(i);
for(var j=0; j<Clips; j++) {
var the_cell = the_row.insertCell(j);
the_cell.style.width = the_width;
the_cell.style.height = the_height;
the_cell.mark = "clip_" + i + "_" + j;
}
}
obj.appendChild(the_Tbl);
return;
}
function PicAdd(the_pic, pic_width, pic_height) {
the_pic = the_pic.replace(/\\/g,"/");
if(!ie) the_pic = "file:///" + the_pic;
Pic_list[n] = new PicItem(the_pic, pic_width, pic_height);
var the_Sel = document.getElementById("sel").lastChild;
the_Sel.options[the_Sel.options.length] = new Option(Pic_list[n].pic.replace(/^(.*)?\/([^\/]*)$/,"$2"));
the_Sel.selectedIndex = Pic_cur = n++;
PicChg();
}
function PicChg() {
var the_img = "<img ";
the_img += "src='"+Pic_list[Pic_cur].pic+"' ";
Zrate = (Pic_list[Pic_cur].width/Pic_list[Pic_cur].height) / (4/3);
if( Zrate > 1 ) {
the_img += "width='100%' ";
} else {
the_img += "height='100%' ";
}
the_img += "/>";
document.getElementById("show").innerHTML = the_img;
}
function PicSel(obj) {
var the_Sel = document.createElement("select");
the_Sel.id = "Pic_Sel";
for(var i=0; i<n; i++) {
the_Sel.options[i] = new Option(Pic_list[i].pic.replace(/^(.*)?\/([^\/]*)$/,"$2"));
}
the_Sel.onchange = new Function("Pic_cur=this.selectedIndex;PicChg()");
obj.appendChild(the_Sel);
return;
}
function ModeSel(obj) {
var the_Sel = document.createElement("select");
the_Sel.id = "Mode_Sel";
for(var i=3; i<=6; i++) {
the_Sel.options[i-3] = new Option(i + " * " +i);
}
the_Sel.onchange = new Function("Clips=this.selectedIndex+3");
obj.appendChild(the_Sel);
return;
}
function get_Pos(the_obj){
the_top = the_obj.offsetTop - document.body.scrollTop;
the_left = the_obj.offsetLeft - document.body.scrollLeft;
the_obj = the_obj.offsetParent;
while(the_obj){
the_top += the_obj.offsetTop;
the_left += the_obj.offsetLeft;
the_obj = the_obj.offsetParent;
DHTML打造PictureSpelling(2) 第 [1] [2] [3] [4] 下一页
上下文章:
上一篇文章: 事件触发列表与解说 下一篇文章: 鼠标实现图片的渐有渐无
相关文章:

