分享
 
 
 

控制选择框选择的项目的脚本

王朝other·作者佚名  2008-05-31
窄屏简体版  字體: |||超大  

网页特效代码,当在网页中用鼠标单击连接时,在网页中弹出个性提示小窗口。效果相当不错哦!

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>提示窗口,knowsky.com</title>

<SCRIPT language=javascript type=text/javascript>

function setCopy(_sTxt){try{clipboardData.setData('Text',_sTxt)}catch(e){}}

function dialog(){

var titile = '';

var width = 300;

var height = 180;

var src = "";

var path = "";

var sFunc = '<input id="dialogOk" type="button" style="width:62px;height:22px;border:0;background:url(\'http:\/\/www.knowsky.com\/upfiles\/20070815\/20070815174335_smb_btn_bg.gif\');line-height:20px;" value="确认" onclick="new dialog().reset();" /> <input id="dialogCancel" type="button" style="width:62px;height:22px;border:0;background:url(\'http:\/\/www.knowsky.com\/upfiles\/20070815\/20070815174335_smb_btn_bg.gif\');line-height:20px;" value="取消" onclick="new dialog().reset();" />';

var sClose = '<input type="image" id="dialogBoxClose" onclick="new dialog().reset();" src="http:\/\/www.knowsky.com\/upfiles\/20070815\/20070815174316_dialogClose0.gif" border="0" width="17" height="17" onmouseover="this.src=\'http:\/\/www.knowsky.com\/upfiles\/20070815\/20070815174325_dialogCloseF.gif\';" onmouseout="this.src=\'http:\/\/www.knowsky.com\/upfiles\/20070815\/20070815174316_dialogClose0.gif\';" align="absmiddle" />';

var sBody = '<table id="dialogBodyBox" border="0" align="center" cellpadding="0" cellspacing="0"><tr height="10"><td colspan="4"></td></tr><tr><td width="10"></td><td width="80" align="center" valign="absmiddle"><img id="dialogBoxFace" src="http:\/\/www.knowsky.com\/upfiles\/20070815\/20070815174300_3.gif" /></td><td id="dialogMsg" style="font-size:12px;color:#000;"></td><td width="10"></td></tr><tr height="10"><td colspan="4" align="center"></td></tr><tr><td id="dialogFunc" colspan="4" align="center">' + sFunc + '</td></tr><tr height="10"><td colspan="4" align="center"></td></tr></table>';

var sBox = '<table id="dialogBox" width="' + width + '" border="0" cellpadding="0" cellspacing="0" style="border:1px solid #000;display:none;z-index:10;"><tr height="1" bgcolor="#D6E3EB"><td></td></tr><tr height="25" bgcolor="#6795B4"><td><table onselectstart="return false;" style="-moz-user-select:none;" width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td width="6"></td><td id="dialogBoxTitle" onmousedown="new dialog().moveStart(event, \'dialogBox\')" style="color:#fff;cursor:move;font-size:12px;font-weight:bold;">系统提示信息</td><td id="dialogClose" width="27" align="right" valign="middle">' + sClose + '</td><td width="6"></td></tr></table></td></tr><tr height="2" bgcolor="#EDEDED"><td></td></tr><tr id="dialogHeight" style="height:' + height + '"><td id="dialogBody" style="background:#fff;color:#000;">' + sBody + '</td></tr></table><div id="dialogBoxShadow" style="display:none;z-index:9;"></div>';

function $(_sId){return document.getElementById(_sId)}

this.show = function(){$('dialogBodyBox') ? function(){} : this.init();this.middle('dialogBox');this.shadow();}

this.reset = function(){this.hideModule('select', '');$('dialogBox').style.display='none';$('dialogBoxShadow').style.display = "none";$('dialogBody').innerHTML = sBody;}

this.html = function(_sHtml){$("dialogBody").innerHTML = _sHtml;this.show();}

this.init = function(){

$('dialogCase') ? $('dialogCase').parentNode.removeChild($('dialogCase')) : function(){};

var oDiv = document.createElement('span');

oDiv.id = "dialogCase";

oDiv.innerHTML = sBox;

document.body.appendChild(oDiv);

}

this.button = function(_sId, _sFuc){

if($(_sId)){

$(_sId).style.display = '';

if($(_sId).addEventListener){

if($(_sId).act){$(_sId).removeEventListener('click', function(){eval($(_sId).act)}, false);}

$(_sId).act = _sFuc;

$(_sId).addEventListener('click', function(){eval(_sFuc)}, false);

}else{

if($(_sId).act){$(_sId).detachEvent('onclick', function(){eval($(_sId).act)});}

$(_sId).act = _sFuc;

$(_sId).attachEvent('onclick', function(){eval(_sFuc)});

}

}

}

this.shadow = function(){

var oShadow = $('dialogBoxShadow');

var oDialog = $('dialogBox');

oShadow['style']['position'] = "absolute";

oShadow['style']['background']= "#000";

oShadow['style']['display']= "";

oShadow['style']['opacity']= "0.2";

oShadow['style']['filter'] = "alpha(opacity=20)";

oShadow['style']['top'] = oDialog.offsetTop + 6;

oShadow['style']['left'] = oDialog.offsetLeft + 6;

oShadow['style']['width'] = oDialog.offsetWidth;

oShadow['style']['height'] = oDialog.offsetHeight;

}

this.open = function(_sUrl, _sMode){

this.show();

if(!_sMode || _sMode == "no" || _sMode == "yes"){

$("dialogBody").innerHTML = "<iframe id='dialogFrame' width='100%' height='100%' frameborder='0' scrolling='" + _sMode + "'></iframe>";

$("dialogFrame").src = _sUrl;

}

}

this.showWindow = function(_sUrl, _iWidth, _iHeight, _sMode){

var oWindow;

var sLeft = (screen.width) ? (screen.width - _iWidth)/2 : 0;

var sTop = (screen.height) ? (screen.height - _iHeight)/2 : 0;

if(window.showModalDialog && _sMode == "m"){

oWindow = window.showModalDialog(_sUrl,"","dialogWidth:" + _iWidth + "px;dialogheight:" + _iHeight + "px");

} else {

oWindow = window.open(_sUrl, '', 'height=' + _iHeight + ', width=' + _iWidth + ', top=' + sTop + ', left=' + sLeft + ', toolbar=no, menubar=no, scrollbars=' + _sMode + ', resizable=no,location=no, status=no');

}

}

this.event = function(_sMsg, _sOk, _sCancel, _sClose){

$('dialogFunc').innerHTML = sFunc;

$('dialogClose').innerHTML = sClose;

$('dialogBodyBox') == null ? $('dialogBody').innerHTML = sBody : function(){};

$('dialogMsg') ? $('dialogMsg').innerHTML = _sMsg : function(){};

this.show();

_sOk ? this.button('dialogOk', _sOk) | $('dialogOk').focus() : $('dialogOk').style.display = 'none';

_sCancel ? this.button('dialogCancel', _sCancel) : $('dialogCancel').style.display = 'none';

_sClose ? this.button('dialogBoxClose', _sClose) : function(){};

//_sOk ? this.button('dialogOk', _sOk) : _sOk == "" ? function(){} : $('dialogOk').style.display = 'none';

//_sCancel ? this.button('dialogCancel', _sCancel) : _sCancel == "" ? function(){} : $('dialogCancel').style.display = 'none';

}

this.set = function(_oAttr, _sVal){

var oShadow = $('dialogBoxShadow');

var oDialog = $('dialogBox');

var oHeight = $('dialogHeight');

if(_sVal != ''){

switch(_oAttr){

case 'title':

$('dialogBoxTitle').innerHTML = _sVal;

title = _sVal;

break;

case 'width':

oDialog['style']['width'] = _sVal;

width = _sVal;

break;

case 'height':

oHeight['style']['height'] = _sVal;

height = _sVal;

break;

case 'src':

if(parseInt(_sVal) > 0){

$('dialogBoxFace') ? $('dialogBoxFace').src = path + _sVal + '.gif' : function(){};

}else{

$('dialogBoxFace') ? $('dialogBoxFace').src = _sVal : function(){};

}

src = _sVal;

break;

}

}

this.middle('dialogBox');

oShadow['style']['top'] = oDialog.offsetTop + 6;

oShadow['style']['left'] = oDialog.offsetLeft + 6;

oShadow['style']['width'] = oDialog.offsetWidth;

oShadow['style']['height'] = oDialog.offsetHeight;

}

this.moveStart = function (event, _sId){

var oObj = $(_sId);

oObj.onmousemove = mousemove;

oObj.onmouseup = mouseup;

oObj.setCapture ? oObj.setCapture() : function(){};

oEvent = window.event ? window.event : event;

var dragData = {x : oEvent.clientX, y : oEvent.clientY};

var backData = {x : parseInt(oObj.style.top), y : parseInt(oObj.style.left)};

function mousemove(){

var oEvent = window.event ? window.event : event;

var iLeft = oEvent.clientX - dragData["x"] + parseInt(oObj.style.left);

var iTop = oEvent.clientY - dragData["y"] + parseInt(oObj.style.top);

oObj.style.left = iLeft;

oObj.style.top = iTop;

$('dialogBoxShadow').style.left = iLeft + 6;

$('dialogBoxShadow').style.top = iTop + 6;

dragData = {x: oEvent.clientX, y: oEvent.clientY};

}

function mouseup(){

var oEvent = window.event ? window.event : event;

oObj.onmousemove = null;

oObj.onmouseup = null;

if(oEvent.clientX < 1 || oEvent.clientY < 1 || oEvent.clientX > document.body.clientWidth || oEvent.clientY > document.body.clientHeight){

oObj.style.left = backData.y;

oObj.style.top = backData.x;

$('dialogBoxShadow').style.left = backData.y + 6;

$('dialogBoxShadow').style.top = backData.x + 6;

}

oObj.releaseCapture ? oObj.releaseCapture() : function(){};

}

}

this.hideModule = function(_sType, _sDisplay){

var aIframe = parent.document.getElementsByTagName("iframe");aIframe=0;

var aType = document.getElementsByTagName(_sType);

var iChildObj, iChildLen;

for (var i = 0; i < aType.length; i++){

aType[i].style.display= _sDisplay;

}

for (var j = 0; j < aIframe.length; j++){

iChildObj = document.frames ? document.frames[j] : aIframe[j].contentWindow;

iChildLen = iChildObj.document.body.getElementsByTagName(_sType).length;

for (var k = 0; k < iChildLen; k++){

iChildObj.document.body.getElementsByTagName(_sType)[k].style.display = _sDisplay;

}

}

}

this.middle = function(_sId){

document.getElementById(_sId)['style']['display'] = '';

document.getElementById(_sId)['style']['position'] = "absolute";

document.getElementById(_sId)['style']['left'] = (document.body.clientWidth / 2) - (document.getElementById(_sId).offsetWidth / 2);

document.getElementById(_sId)['style']['top'] = (document.body.clientHeight / 2 + document.body.scrollTop) - (document.getElementById(_sId).offsetHeight / 2);

}

}

</script>

</head>

<BODY>

<A onclick="setCopy('http://www.knowsky.com');new dialog().event('已经把该网页特效库网址复制到系统剪贴板,您可以使用(Ctrl+V或鼠标右键)粘贴功能,通过其他软件记录或发送给您的朋友。','void 0')" href="javascript:;">http://www.knowsky.com 点击复制 </A>

<SCRIPT language=javascript type=text/javascript>new dialog().init();</SCRIPT>

</BODY></HTML>

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有