zoukankan
html css js c++ java
Jq公告渐隐弹出
animate弹出后,调用out函数消失。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>豪情</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <style> *{margin:0;padding:0;font-size:12px;} input{120px;height:30px;cursor:pointer;} #note{position:absolute;400px;padding:20px;background:#eee;border:1px solid #ccc;left:40%;z-index:9999;display:none;} </style> <script> $(function(){ $('input').click(function(){ if(!$('#note').is(':visible')){ $('#note').css({display:'block', top:'-100px'}).animate({top: '+100'}, 500, function(){ setTimeout(out, 3000); }); } }); }); function out(){ $('#note').animate({top:'0'}, 500, function(){ $(this).css({display:'none', top:'-100px'}); }); } </script> </head> <body> <div id="note"><a href="http://jikey.cnblogs.com" target="_blank">豪情</a></div> <input type="button" value="点我,30s后消失" /> </body> </html>
运行代码
查看全文
相关阅读:
linux脚本mysql服务与keepalived服务高可用脚本
linux脚本启动服务脚本
linux脚本数据库备份脚本
linux脚本清理日志文件脚本
最大数字
求阶乘
素数
水仙花数
js基础1
css常用属性2
原文地址:https://www.cnblogs.com/jikey/p/1745044.html
最新文章
剑指offer | 反转链表 | 13
剑指offer | 合并两个排序的链表 | 14
剑指offer | 复杂链表的复制 | 15
剑指offer | 两个链表的第一个公共节点 | 16
剑指offer | 圆圈中最后剩下的数字 | 17
JavaScript
并发编程
Excel工作表保护的密码破解与清除...假装自己破解密码系列?
修改github上的项目语言类型
MySQL的安装步骤
热门文章
关于CPython中set集合的无序研究
Python3使用过程中需要注意的点
网络编程-SOCKET开发
Python之面向对象
zabbix Trigger函数
zabbix自定义自动发现监控项配置
ZABBIX代理端自动安装脚本
Centos7.1系统安装
DELL730服务器做raid磁盘初始化
H3C服务器做raid磁盘初始化
Copyright © 2011-2022 走看看