zoukankan      html  css  js  c++  java
  • javascript 进度条

    <html>
    <head>
    <title>链接Loading效果...-www.51windows.Net</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head>
    <body>

    <div id=waiting style="position:absolute;z-index:1;display:none;border: 2 outset #F2F2F2">
    <table border="0" cellpadding="0" cellspacing="0" width="360" style="background-color: #D6D3CE; font-size: 12px;">
        <tr>
          <td width="358" style="background-color: #000080; color: #FFFFFF; padding: 2">请稍候...</td>
        </tr>
        <tr>
          <td width="358" align="center"><img src="http://www.danasoft.com/sig/haiwa.jpg"></td>
        </tr>
        <tr>
          <td width="358" height="20" style="padding: 2;word-break:break-all;" id="linktext"></td>
        </tr>
        <tr>
          <td width="358" height="10" style="padding: 0;border: 1 inset #F2F2F2"><img src="" width=1 height=10 name=sbar style=background-color:#000080></td>
        </tr>
    </table>
    </div>

    <SCRIPT LANGUAGE="JavaScript">
    document.all.waiting.style.pixelTop = (document.body.offsetHeight - 120) / 2 + document.body.scrollTop;
    document.all.waiting.style.pixelLeft = (document.body.offsetWidth - 360) / 2 + document.body.scrollLeft;
    function link()
    {
    o=event.srcElement
    while(o.tagName != "A")
    {
       if(!o.parentElement) return
       o=o.parentElement
    }
    event.returnValue = false
    document.all.linktext.innerHTML = "正在打开:<u>"+o.href+"</u>"
    document.all.waiting.style.display="";
    times = setInterval('showloading();',100);
    }
    document.onmousedown=link;
    function showloading()
    {
    if (document.sbar.width>356)
    {
       document.sbar.width=1
       //clearInterval(times)
    }
    else
    {
       document.sbar.width += 2;
    }
    }
    </script>
    点一下链接;会出来了个进度条,只是一个例子,不会进入链接,因为在链接上加了onclick="return false"<br>
    <A HREF="http://www.51windows.Net" onclick="return false">http://www.51windows.Net</A>
    </body>
    </html>

    <div style="position: absolute; top: 10; right: 10; 148; height: 18;cursor:hand">
    <input type="button" name="Button" value="查看源代码" onClick= 'window.location = "view-source:" + window.location.href'></div>

  • 相关阅读:
    【C#/WPF】限制GridSplitter分隔栏的滑动范围
    【C#】访问泛型中的List列表数据
    【C#学习笔记】反射的简单用法
    【C#】获取泛型<T>的真实类型
    【Unity】关于发射子弹、导弹追踪的逻辑
    【转】【Unity】四元数(Quaternion)和旋转
    【Unity】UGUI的Text各种小问题
    【火狐FireFox】同步失败后,书签被覆盖,如何恢复书签
    【转】【Unity】实现全局管理类的几种方式
    【Unity】动态调用其他脚本的函数
  • 原文地址:https://www.cnblogs.com/kevinge/p/1442686.html
Copyright © 2011-2022 走看看