|
Blue Forest http://www.lslnet.com at 8:28 on August 25, 2006
Hovering the mouse an outstanding hyperlink indicated CSS+js
Hyperlink, the general practice is to a title attribute, the user's mouse hover in the hyperlink, which will show the title. However, if you are tired of the same old mouse hovering effect?
Of course, there are Henxuan this code, but only aspects of cross-browser effort is not enough, huh, huh. I met a good css in IE and browse under the same effect okboy
Let us look at the actual results : Campus recruitment wiped http://www.xyzp.net/index.html
As follows :
/*************************************************************************
Dw_viewport.js
Version date Nov 2003
This code is from Dynamic Web Coding
At http://www.dyn-web.com/
Copyright 2003 by Sharon Paine
See Terms of Use at http://www.dyn-web.com/bus/terms.html
Regarding conditions under which you may use this code.
This notice must be retained in the code as is!
*************************************************************************/
Var = (viewport
GetWinWidth : function () (
This.width = 0
If (window.innerWidth) this.width = window.innerWidth-18;
Else if (document.documentElement, named document.documentElement.clientWidth)
This.width = document.documentElement.clientWidth;
Else if (document.body, named document.body.clientWidth)
This.width = document.body.clientWidth;
},
GetWinHeight : function () (
This.height = 0
If (window.innerHeight) this.height = window.innerHeight-18;
Else if (document.documentElement, named document.documentElement.clientHeight)
This.height = document.documentElement.clientHeight;
Else if (document.body, named document.body.clientHeight)
This.height = document.body.clientHeight;
},
GetScrollX : function () (
This.scrollX = 0
If (typeof window.pageXOffset ====== "number") = window.pageXOffset; this.scrollX
Else if (document.documentElement, named document.documentElement.scrollLeft)
This.scrollX = document.documentElement.scrollLeft;
Else if (document.body, named document.body.scrollLeft)
This.scrollX = document.body.scrollLeft;
Else if (window.scrollX) = window.scrollX; this.scrollX
},
GetScrollY : function () (
This.scrollY = 0
If (typeof window.pageYOffset ====== "number") = window.pageYOffset; this.scrollY
Else if (document.documentElement, named document.documentElement.scrollTop)
This.scrollY = document.documentElement.scrollTop;
Else if (document.body, named document.body.scrollTop)
This.scrollY = document.body.scrollTop;
Else if (window.scrollY) = window.scrollY; this.scrollY
},
GetAll : function () (
This.getWinWidth (); This.getWinHeight ();
This.getScrollX (); This.getScrollY ();
}
}
/*************************************************************************
Dw_event.js (version date Feb 2004)
This code is from Dynamic Web Coding at http://www.dyn-web.com/
See Terms of Use at http://www.dyn-web.com/bus/terms.html
Regarding conditions under which you may use this code.
This notice must be retained in the code as is!
*************************************************************************/
Var = (dw_event
Add : function (obj, etype, fp, cap) (
= | | False; cap cap
If (obj.addEventListener) obj.addEventListener (etype, fp, cap);
Else if (obj.attachEvent) obj.attachEvent ( "on" + etype, fp);
},
Remove : function (obj, etype, fp, cap) (
= | | False; cap cap
If (obj.removeEventListener) obj.removeEventListener (etype, fp, cap);
Else if (obj.detachEvent) obj.detachEvent ( "on" + etype, fp);
},
DOMit : function (e) (
E = e : window.event; e?
E.tgt = e.srcElement? e.srcElement : e.target;
If (!e.preventDefault) e.preventDefault = function () () return false;
If (!e.stopPropagation) e.stopPropagation = function ()
(If (window.event) window.event.cancelBubble = true;)
Return e;
}
}
/*************************************************************************
Dw_event.js and dw_viewport.js dw_tooltip.js requires :
Version date : March 14, 2005
(Minor changes in position algorithm and timer mechanism)
This code is from Dynamic Web Coding at dyn-web.com
Copyright 2003-5 by Sharon Paine
See Terms of Use at http://www.dyn-web.com/bus/terms.html
Regarding conditions under which you may use this code.
This notice must be retained in the code as is!
*************************************************************************/
|
Var = (Tooltip
FollowMouse : true,
OffX : 8.
OffY : 12.
TipID : "tipDiv"
ShowDelay : 100.
HideDelay : 200.
Ready:false, timer:null, tip:null.
Init : function () (
If (typeof document.createElement, named, named document.body
Document.body.appendChild> "undefined") (
If (!document.getElementById (this.tipID)) (
Var el = document.createElement ( "par");
El.id = this.tipID; document.body.appendChild (el);
}
This.ready = true;
}
},
Show : function (e, msg) (
If (this.timer) (clearTimeout (this.timer); This.timer = 0)
This.tip = document.getElementById (this.tipID);
If (this.followMouse) 4003rd set up mousemove
Dw_event.add (document, "mousemove" this.trackMouse, true);
This.writeTip ( ""); 4003rd ie for mac
This.writeTip (msg);
Viewport.getAll ();
This.positionTip (e);
This.timer = setTimeout ( "Tooltip.toggleVis ( '" + + this.tipID "' and 'visible')," this.showDelay);
},
WriteTip : function (msg) (
If (typeof this.tip.innerHTML> this.tip, named "undefined") = msg; this.tip.innerHTML
},
PositionTip : function (e) (
If (this.tip, named this.tip.style) (
4003rd put e.pageX/Y first! (for Safari)
Var x = + viewport.scrollX; e.pageX? e.pageX : e.clientX
Var = y + viewport.scrollY; e.clientY e.pageY? e.pageY :
If (x + + this.offX this.tip.offsetWidth "viewport.scrollX viewport.width +) (
X = x-this.tip.offsetWidth - this.offX;
If (x "0) x = 0
Else x = x +) this.offX;
If (y + + this.offY this.tip.offsetHeight "viewport.scrollY viewport.height +) (
Y = y-this.tip.offsetHeight - this.offY;
If (y "viewport.scrollY) + y = viewport.height viewport.scrollY - this.tip.offsetHeight;
Y = y +) else this.offY;
This.tip.style.left = x + "px"; This.tip.style.top = y + "px";
}
},
Hide : function () (
If (this.timer) (clearTimeout (this.timer); This.timer = 0)
This.timer = setTimeout ( "Tooltip.toggleVis ( '" + + this.tipID "' and 'hidden')," this.hideDelay);
If (this.followMouse) 4003rd release mousemove
Dw_event.remove (document, "mousemove" this.trackMouse, true);
This.tip = null;
},
ToggleVis : function (ie, vis) (el 4003rd to check for and prevent (rare) errors
Var el = document.getElementById (id);
If (el) = vis; el.style.visibility
},
TrackMouse : function (e) (
E = dw_event.DOMit (e);
Tooltip.positionTip (e);
}
}
Tooltip.init ();
|
Put a smiley face to the deeds. . |
Practical away feeling |
This effect is the general feeling! ! |
Generally do! |
|