Mouse_on_title.js_ Typical special effects

Source: Internet
Author: User
Copy Code code as follows:

var pltspop=null;
var pltsoffsetx = 5; The distance between the left side of the mouse or the right side of the pop-up window; 3-12 fit
var pltsoffsety = 5; The distance of the pop-up window at the bottom of the mouse; 3-12 fit
var pltspopbg= "#FFffff"; Background color
var pltspopfg= "#880000"; Foreground color
var pltstitle= "";
document.write (' <div id=pltstiplayer style= "Display:none;position:absolute; z-index:10001" ></div> ");
function Pltsinits ()
{
Document.onmouseover = Plts;
Document.onmousemove = Movetomouseloc;
}
function Plts ()
{var o=event.srcelement;
if (o.alt!=null && o.alt!= "") {o.dypop=o.alt;o.alt= ""};
if (o.title!=null && o.title!= "") {o.dypop=o.title;o.title= ""};
Pltspop=o.dypop;
if (pltspop!=null&&pltspop!= "" &&typeof (pltspop)!= "undefined")
{
pltstiplayer.style.left=-20;
Pltstiplayer.style.display= ';
var msg=pltspop.replace (/\n/g, "<br>");
Msg=msg.replace (/\0x13/g, "<br>");
var re=/\{(. [ ^\{]*) \}/ig;
if (!re.test (MSG)) pltstitle= "";
else{
re=/\{(. [ ^\{]*) \} (. *)/ig;
Pltstitle=msg.replace (Re, "$") + "";
re=/\{(. [ ^\{]*) \}/ig;
Msg=msg.replace (Re, "");
Msg=msg.replace ("<br>", "");}
var attr= (document.location.toString (). toLowerCase (). IndexOf ("") >0? NoWrap ":" ");
var content =
' <table style= ' Filter:alpha (opacity=90) Shadow (color= #6f6f6f, direction=135); "Id=tooltiptalbe ><tr> &LT;TD width= "100%" ><table class=tdr cellspacing= "0" cellpadding= "0" border=0 style= "width:100%" > ' +
' <tr id=pltspoptop ><th height=25 valign=bottom class=tdr><p id=topleft align=left> ' +pltsTitle+ ' </p><p id=topright align=right style= "Display:none" > ' +pltstitle+ ' </th></tr> ' +
"<tr><td" +attr+ "CLASS=BG_TDR style=" PADDING-LEFT:14PX;PADDING-RIGHT:14PX;PADDING-TOP:6PX; padding-bottom:6px;line-height:135% "> ' +msg+ ' </td></tr>" +
"<tr Id=pltspopbot style=" Display:none "><th height=25 valign=bottom class=tdr><p id=botleft align=left > ' +pltstitle+ ' </p><p id=botright align=right style= ' display:none ' > ' +pltstitle+ ' </th></tr > ' +
' </table></td></tr></table> ';
Pltstiplayer.innerhtml=content;
Tooltiptalbe.style.width=math.min (pltstiplayer.clientwidth,document.body.clientwidth/2.2);
Movetomouseloc ();
return true;
}
Else
{
Pltstiplayer.innerhtml= ';
Pltstiplayer.style.display= ' None ';
return true;
}
}

function Movetomouseloc ()
{
if (pltstiplayer.innerhtml== ') return true;
var mousex=event.x;
var Mousey=event.y;
Window.status=event.y;
var popheight=pltstiplayer.clientheight;
var popwidth=pltstiplayer.clientwidth;
if (mousey+pltsoffsety+popheight>document.body.clientheight)
{
poptopadjust=-popheight-pltsoffsety*1.5;
Pltspoptop.style.display= "None";
Pltspopbot.style.display= "";
}
Else
{
poptopadjust=0;
Pltspoptop.style.display= "";
Pltspopbot.style.display= "None";
}
if (mousex+pltsoffsetx+popwidth>document.body.clientwidth)
{
popleftadjust=-popwidth-pltsoffsetx*2;
Topleft.style.display= "None";
Botleft.style.display= "None";
Topright.style.display= "";
Botright.style.display= "";
}
Else
{
popleftadjust=0;
Topleft.style.display= "";
Botleft.style.display= "";
Topright.style.display= "None";
Botright.style.display= "None";
}
Pltstiplayer.style.left=mousex+pltsoffsetx+document.body.scrollleft+popleftadjust;
Pltstiplayer.style.top=mousey+pltsoffsety+document.body.scrolltop+poptopadjust;
return true;
}
Pltsinits ();

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.