許愿墻中用到的函數(shù)
更新時間:2006年10月07日 00:00:00 作者:
復制代碼 代碼如下:
<script language="JavaScript1.2">
//-- 控制層刪除start of script -->
function ssdel(){
if (event)
{
lObj = event.srcElement ;
while (lObj && lObj.tagName != "DIV") lObj = lObj.parentElement ;
}
var id=lObj.id
document.getElementById(id).removeNode(true);
//document.getElementById(id).outerHTML="";//
}
//-- 控制層刪除End of script -->
</script>
<script>
//-- 控制層移動start of script -->
var Obj=''
var index=10000;//z-index;
document.onmouseup=MUp
document.onmousemove=MMove
function MDown(Object){
Obj=Object.id
document.all(Obj).setCapture()
pX=event.x-document.all(Obj).style.pixelLeft;
pY=event.y-document.all(Obj).style.pixelTop;
}
function MMove(){
if(Obj!=''){
document.all(Obj).style.left=event.x-pX;
document.all(Obj).style.top=event.y-pY;
}
}
function MUp(){
if(Obj!=''){
document.all(Obj).releaseCapture();
Obj='';
}
}
function setTagBPic(i) {
picurl = getBPic(i);
getObj('tagBPic').style.background = " transparent url(\"" + picurl + "\") no-repeat scroll bottom left";
cf.tagbgpic.value = i;
}
function setTagBColor(i) {
color = getBColor(i);
getObj('preview').style.background = '' + color;
cf.tagbgcolor.value = i;
}
function getBPic(i) {
i = (i<1 || i>8)?1:i;
return "images/pic" + parseInt(parseInt(i)+27) +".gif";
}
//-- 控制層移動end of script -->
//獲得焦點;
function getFocus(obj)
{
if(obj.style.zIndex!=index)
{
index = index + 2;
var idx = index;
obj.style.zIndex=idx;
//obj.nextSibling.style.zIndex=idx-1;
}
}
相關文章
Canvas實現(xiàn)二娃翠花回家之路小游戲demo解析
這篇文章主要為大家介紹了Canvas實現(xiàn)二娃翠花回家之路小游戲demo解析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2023-04-04JS實現(xiàn)查找數(shù)組中對象的屬性值是否存在示例
這篇文章主要介紹了JS實現(xiàn)查找數(shù)組中對象的屬性值是否存在,涉及javascript針對json數(shù)組的遍歷、查找相關操作技巧,需要的朋友可以參考下2019-05-05For循環(huán)中分號隔開的3部分的執(zhí)行順序探討
這篇文章主要探討了For循環(huán)中分號隔開的3部分的執(zhí)行順序,需要的朋友可以參考下2014-05-05谷歌瀏覽器 insertCell與appendChild的區(qū)別
table中增加單元格時 在谷歌瀏覽器中使用insertCell方法增加列時,顯示結果的先后順序與程序執(zhí)行的先后順序相反2009-02-02JS實現(xiàn)類似51job上的地區(qū)選擇效果示例
這篇文章主要介紹了JS實現(xiàn)類似51job上的地區(qū)選擇效果,結合完整實例形式分析了javascript基于鼠標事件響應實現(xiàn)頁面元素動態(tài)變換的相關操作技巧,需要的朋友可以參考下2016-11-11JS獲取今天是本月第幾周、本月共幾周、本月有多少天、是今年的第幾周、是今年的第幾天的示例代碼
這篇文章主要介紹了JS獲取今天是本月第幾周、本月共幾周、本月有多少天、是今年的第幾周、是今年的第幾天,本文通過實例代碼給大家介紹的非常詳細,具有一定的參考借鑒價值,需要的朋友可以參考下2018-12-12