zoukankan      html  css  js  c++  java
  • 鼠标经过加载大图

    main.js

    ---------------------------------------------------------------------------------------
    function openScript(url, width, height){
     var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=no' );
    }
    //***********默认设置定义.*********************
    tPopWait=500;//停留毫秒后显示提示。
    tPopShow=5000;//显示毫秒后慢慢转为透明,即消失
    showPopStep=20;
    popOpacity=99;//颜色最深的时候0为透明

    //***************内部变量定义*****************
    sPop=null;
    curShow=null;
    tFadeOut=null;
    tFadeIn=null;
    tFadeWaiting=null;

    document.write("<style type='text/css'id='defaultPopStyle'>");
    document.write(".cPopText {  background-color: #ffffff; border: 1px #555555 solid; font-size: 12px; padding-right: 4px; padding-left: 4px; height: 20px; padding-top: 2px; padding-bottom: 2px; filter: Alpha(Opacity=0)}");

    document.write("</style>");
    document.write("<div id='ncpopLayer' style='position:absolute;z-index:1000;' class='cPopText'></div>");


    function showPopupText(){
    var o=event.srcElement;
     MouseX=event.x;
     MouseY=event.y;
     if(o.alt!=null && o.alt!=""){o.ncpop=o.alt;o.alt=""};
            if(o.title!=null && o.title!=""){o.ncpop=o.title;o.title=""};
     if(o.ncpop!=sPop) {
       sPop=o.ncpop;
       clearTimeout(curShow);
       clearTimeout(tFadeOut);
       clearTimeout(tFadeIn);
       clearTimeout(tFadeWaiting); 
       if(sPop==null || sPop=="") {
        ncpopLayer.innerHTML="";
        ncpopLayer.style.filter="Alpha()";
        ncpopLayer.filters.Alpha.opacity=0; 
        }
       else {
        if(o.dyclass!=null) popStyle=o.dyclass
         else popStyle="cPopText";
        curShow=setTimeout("showIt()",tPopWait);
       }
       
     }
    }

    function showIt(){
      ncpopLayer.className=popStyle;
      ncpopLayer.innerHTML=sPop;
      popWidth=ncpopLayer.clientWidth;
      popHeight=ncpopLayer.clientHeight;
      if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
       else popLeftAdjust=0;
      if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
       else popTopAdjust=0;
      ncpopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
      ncpopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
      ncpopLayer.style.filter="Alpha(Opacity=0)";
      fadeOut();
    }

    function fadeOut(){
     if(ncpopLayer.filters.Alpha.opacity<popOpacity) {
      ncpopLayer.filters.Alpha.opacity+=showPopStep;
      tFadeOut=setTimeout("fadeOut()",1);
      }
      else {
       ncpopLayer.filters.Alpha.opacity=popOpacity;
       tFadeWaiting=setTimeout("fadeIn()",tPopShow);
       }
    }

    function fadeIn(){
     if(ncpopLayer.filters.Alpha.opacity>0) {
      ncpopLayer.filters.Alpha.opacity-=1;
      tFadeIn=setTimeout("fadeIn()",1);
      }
    }
    document.onmouseover=showPopupText; 

    ------------------------------------------------------------------------------------

    productmain.asp

    加<SCRIPT language=JavaScript src="js/main.js"></SCRIPT>

    然后

    <img src="<%=rsArticle("DefaultPicUrl")%>" width="110" height="110" border="0" align='absmiddle' alt='点击查看大图:<br> <img src=<%=rsArticle("DefaultPicUrl")%> border=1>'>

  • 相关阅读:
    Eclipse打包Android项目时用到proguard.cfg后,出现的Warning:can't find referenced class问题的解决方案
    Android使用Fragment来实现TabHost的功能(解决切换Fragment状态不保存)以及各个Fragment之间的通信
    接口的作用
    Android中Service(服务)详解
    跟 Task 有关的 Intent对象中设置的Flag
    android onNewIntent
    [Android]如何导入已有的外部数据库
    android的文件操作
    MVC 数据验证
    Html辅助方法 之 Form表单标签
  • 原文地址:https://www.cnblogs.com/zerogo/p/2209400.html
Copyright © 2011-2022 走看看