JavaScript mouse Move shows a simple example of a picture

Source: Internet
Author: User

  This article is mainly on the JS mouse mobile display pictures of a simple example of the introduction, the need for friends can come to the reference, I hope to help you.

First, JS code     code as follows://*********** default settings definition. *********************    tpopwait=50;//stay twait Hao second to display the prompts.    tpopshow=5000;//display tshow seconds after the close of the hint    showpopstep=20;   popopacity=99;    //*************** internal variable definition *****************    spop=null;   Curshow=null;   Tfadeout=null;   Tfadein=null;   Tfadewaiting=null;     document.write ("<mce:style type= ' text/css ' id= ' Defaultpopstyle ' ><!-- ");   document.write (". cpoptext {line-break:normal;word-break:break-all; Background-color: #FEFCF3; color: #000000; border:1px #E7B68C solid;padding-top:2px; padding-right:4px; padding-left:4px; padding-bottom:2px;font-size:12px;width:96px; Filter:alpha (opacity=0)} ");   document.write ( --></mce:style><style type= ' text/css ' id= ' defaultpopstyle ' mce_bogus= ' "1" > ");   document.write (". cpoptext {line-break:normal;word-break:break-all; Background-color: #FEFCF3; color: #000000; border:1px #E7B68C solid;padding-top:2px; padding-right:4px; padding-left:4px; padding-bottom:2px;font-size:12px;width:96px; Filter:alpha (opacity=0)} ");   document.write ("</style>");   document.write ("<div id= ' Dypoplayer ' style=" position:absolute;z-index:1000; "mce_style=" Position: absolute;z-index:1000; "class= ' Cpoptext ' ></div>");        function Showpopuptext () {  var o=event.srcelement;       mousex=event.x; & nbsp     MOUSEY=EVENT.Y;       if (o.alt!=null && o.alt!= "") {o.dypop=o.alt;o.alt= "};           if (o.title!=null && o.title!= "") {o.dypop=o.title;o.title= ""};       if (o.dypop!=spop) {              Spop=o.dypop     &NBS P         cleartimeout (curshow);               cleartimeout (tfadeout);              cleartimeout (Tfadein);               cleartimeout (tfadewaiting);                if (Spop==null | | spop== "") {          &NB Sp       dypoplayer.innerhtml= "";                   dypoplayer.style.filter= "Alpha ()";                   dypoplayer.filters.alpha.opacity=0;                    {              El SE {                  if (o.dyclass!=null) Popstyle=o.dyclass    &N Bsp                   Else popstyle= "Cpoptext";                   Curshow=settimeout ("Showit ()", tpopwait);              }       &NBSp }  }     function Showit () {          Dypoplayer.classname=popstyle   &NBSP ;       Dypoplayer.innerhtml=spop;           popwidth=dypoplayer.clientwidth;           popheight=dypoplayer.clientheight;           if (mousex+12+popwidth>document.body.clientwidth) popleftadjust=-popwidth-24               else popleftadjust=0;           if (mousey+12+popheight>document.body.clientheight) poptopadjust=-popheight-24 & nbsp             else poptopadjust=0;             Dypoplayer.style.left=mousex+12+document.body.scrollleft+popleftadjust;           Dypoplayer.style.top=mousey+12+document.body.scrolltop+poptopadjust;           dypoplayer.style.filter= "Alpha (opacity=0)";     &NBSP     fadeout ();  }     function fadeout () {      if (dypoplayer.filters.alpha.opacity<popopacity) {&nbs P         Dypoplayer.filters.alpha.opacity+=showpopstep;           Tfadeout=settimeout ("fadeout ()", 1);           {          else {            & nbsp dypoplayer.filters.alpha.opacity=popopacity;               Tfadewaiting=settimeout ("FadeIn ()", tpopshow);               { }     function fadeIn () {      Dypop layer.filters.alpha.opacity>0) {          dypoplayer.filters.alpha.opacity-=1           Tfadein=settimeout ("FadeIn ()", 1);          }  }   Document.onmouseover=showpopuptext;     II, HTML code contains JS code can, use the example  ; a href= ". /uploadfile/200911784060017.jpg "target=" _blank "title=" <img src=. /uploadfile/200911784060017.jpg  /> "> Big </a> <a href=". /uploadfile/200911784060018.jpg "target=" _blank "title=" <img src=. /uploadfile/200911784060018.jpg width=96 height=70/> "> Small </a>    

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.