zoukankan      html  css  js  c++  java
  • 一道有意思的题目

    一个弹窗效果满足:
    1.初始化2s显示
    2.显示要10s,隐藏要10s
    3.显示的时候,点击关闭按钮,隐藏10s,然后在显示10s,如此循环。

    利用jq

    document.writeln("	<style>");
    document.writeln(".chat_bottom{227px;height:148px;background:url(/images/0_fs_bottom01.png) no-repeat;position:fixed;bottom:-10px;right:-10px;cursor:pointer;z-index:9999999999;display:none}");
    document.writeln(".chat_bottom a{display:block;227px;height:148px;}");
    document.writeln(".chat_bottom span{position:absolute;right:10px;top:10px;20px;height:25px;display:block;cursor:pointer;}");
    document.writeln("	</style>");
    document.writeln("<div class="chat_bottom" id="chat_bottom"><a href="/chat.php"></a><span onclick="hideLovexin113()"></span></div>");
    setTimeout("hide()",2000);
    function show(){
    	$("#chat_bottom").slideUp("slow");
    	s=setTimeout("hide()",10000);
    }
    function hide(){
    	$("#chat_bottom").slideDown("slow");
    	t=setTimeout("show()",10000);
    }
    function hideLovexin113(){
    	clearTimeout(t);
    	clearTimeout(s);
    	show();
    }	
    
  • 相关阅读:
    引用类型构造器
    正则指引量词
    Ajax的XMLHttpRequest对象
    正则指引字符组
    方法可变数量的参数
    不使用XMLHttpRequest实现异步加载:Iframe和script
    可选参数、命名参数
    常量和字段
    正则指引括号
    值类型实例构造器
  • 原文地址:https://www.cnblogs.com/damai/p/5134258.html
Copyright © 2011-2022 走看看