Web page Special effects code, when the mouse click on the Web page connection, in the page pop-up personalized Tips small window. The effect is quite good oh!
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title> Hint Window,webjx.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.webjx.com\/upfiles\/20070815\/20070815174335_smb_btn_bg.gif\ '); line-height:20px; "Value=" confirms "onclick=" new Dialog (). Reset (), "/> <input id=" dialogcancel "type=" button "style=" width:62px;height:22px;border:0; Background:url (\ ' http:\/\/www.webjx.com\/upfiles\/20070815\/20070815174335_smb_btn_bg.gif\ '); line-height:20px; " Value= "cancels" onclick= "New dialog (). reset ();"/> ";
var sclose = ' <input type= ' image ' id= ' dialogboxclose ' onclick= ' New dialog (). reset (); "Src=" http:\/\/www.webjx.com\/ Upfiles\/20070815\/20070815174316_dialogclose0.gif "border=" 0 "width=" "height=" "onmouseover=" this.src=\ "http : \/\/www.webjx.com\/upfiles\/20070815\/20070815174325_dialogclosef.gif\ '; "onmouseout=" This.src=\ ' http:\/\/ Www.webjx.com\/upfiles\/20070815\/20070815174316_dialogclose0.gif\ '; "align=" Absmiddle "/>";
var sbody = ' \
<table id= "Dialogbodybox" border= "0" align= "center" cellpadding= "0" cellspacing= "0" >\
<TR height= "Ten" ><td colspan= "4" ></td></tr>\
<tr>\
<TD width= "Ten" ></td>\
<TD width= "align=" center "valign=" Absmiddle "></td>\
<TD id= "dialogmsg" style= "Font-size:12px;color: #000;" ></td>\
<TD width= "Ten" ></td>\
</tr>\
<TR height= "Ten" ><td colspan= "4" align= "Center" ></td></tr>\
<TR><TD id= "Dialogfunc" colspan= "4" align= "center" > ' + sfunc + ' </td></tr>\
<TR height= "Ten" ><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;d is Play:none;z-index:10; " >\
<tr height= "1" bgcolor= "#D6E3EB" ><td></td></tr>\
<tr height= "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; " > System Prompt Information </td>\
<TD id= "Dialogclose" width= "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 + ', to Olbar=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>
<BODY>
<a onclick= "setcopy (' http://www.wangyeba.com '); The new dialog (). Event (' has copied the Web site of the special Effects library to the system Clipboard, you can use (Ctrl + V or right mouse button) Paste function , recorded or sent to your friends through other software. ', ' void 0 ') "href=" javascript:; " >http://www.wangyeba.com Click Copy </A>
<script language=javascript type=text/javascript>new Dialog (). Init ();</script>
</BODY></HTML>