温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

真正的 用JS 做的 loading (转)

发布时间:2020-08-16 08:47:05 来源:ITPUB博客 阅读:172 作者:amyz 栏目:编程语言
真正的 用JS 做的 loading (转)[@more@]

这个loading 需要2个页面的的支持,还可以为一个站点的所有html设置这个loading程序
<!--=================================-->
<!-- index.htm--->
<!--=================================-->


您正在访问 .NET">http://m9m.nease.net 的网站......


 
 

<body><BR>您的浏览器不支持frames......<BR></body>

<!--=================================-->
<!-- loading.htm--->
<!--=================================-->







<!--=================================-->
<!-- to.js -->
<!--=================================-->
document.write('');

function WriteButton(fnFunctionName, ButtonValue, ButtonURL, wd)
{
  var strTmp = "",n = 0;
  if (fnFunctionName == "")
  strTmp = "self.location = '" + ButtonURL + "';";
 else
  strTmp = fnFunctionName + '();';
 for(var i = 0; i < ButtonValue.length; i++)
 {
  var c = ButtonValue.substr(i, 1);
  if( c > "z" || c < "A")
  n += 2;
  else
  n += 1;
 }
 if( wd == "") wd = (n * 8);

 document.write("

" + ButtonValue + "
");
}

function wtdiv()
{
  document.write("

");
}
wtdiv();

function openwin()
{
  if(self == window.parent.frames['t'] && top.parent.frm)
 top.parent.frm.rows = '*,0';
  else if(top.parent.frm) top.parent.frm.rows = '0,*';
}

var wt = 0, n = 0;
function countwt()
{
  if (wt)
  clearTimeout(wt);
  wtime.innerHTML = "" + n++ ;
  wt = setTimeout("countwt();", 1000);
}


function showdiv()
{
  openwin();
 document.getElementById("stdiv").style.visibility = "visible";
  countwt();
}
openwin();

<!--=================================-->
<!--  h.js -->
<!--=================================-->
if(self != window.parent.frames['t'] && window.parent.frames['t'])
  window.parent.frames['t'].showdiv();
else if(self == window.parent.frames['d'] && window.parent.frames['d'])
  window.parent.frames['d'].showdiv();

最后的说明
在您的i.htm,也就是您的真正的index.htm首页里加入如下代码就可以
后加

前加入

就可以了

不明白的可以访问我的网站 http://m9m.nease.net 或 来信和我交流
qq: 11602011


向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI