jquery实现登录后右下角弹窗提醒(附带简单样式)
页面代码如下:
- <!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>jQuery实现网页右下角悬浮层提示</title>
- <style type="text/css">
- *{margin:0;padding:0;list-style-type:none;}
- a,img{border:0;}
- body{font:12px/180% Arial, Helvetica, sans-serif, "新宋体";}
- /* pop */
- #pop{background:#fff;width:260px;border:1px solid #e0e0e0;font-size:12px;position:fixed;right:10px;bottom:10px;}
- #popHead{line-height:32px;background:#f6f0f3;border-bottom:1px solid #e0e0e0;position:relative;font-size:12px;padding:0 0 0 10px;}
- #popHead h2{font-size:14px;color:#666;line-height:32px;height:32px;}
- #popHead #popClose{position:absolute;right:10px;top:1px;}
- #popHead a#popClose:hover{color:#f00;cursor:pointer;}
- #popContent{padding:5px 10px;}
- #popTitle a{line-height:24px;font-size:14px;font-family:'微软雅黑';color:#333;font-weight:bold;text-decoration:none;}
- #popTitle a:hover{color:#f60;}
- #popIntro{text-indent:24px;line-height:160%;margin:5px 0;color:#666;}
- #popMore{text-align:right;border-top:1px dotted #ccc;line-height:24px;margin:8px 0 0 0;}
- #popMore a{color:#f60;}
- #popMore a:hover{color:#f00;}
- </style>
- </head>
- <body style="height:1200px;" onload="loadhtml();">
- <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.1.min.js"></script>
- <script type="text/javascript">
- (function($j){
- $j.positionFixed = function(el){
- $j(el).each(function(){
- new fixed(this)
- })
- return el;
- }
- $j.fn.positionFixed = function(){
- return $j.positionFixed(this)
- }
- var fixed = $j.positionFixed.impl = function(el){
- var o=this;
- o.sts={
- target : $j(el).css('position','fixed'),
- container : $j(window)
- }
- o.sts.currentCss = {
- top : o.sts.target.css('top'),
- right : o.sts.target.css('right'),
- bottom : o.sts.target.css('bottom'),
- left : o.sts.target.css('left')
- }
- if(!o.ie6)return;
- o.bindEvent();
- }
- $j.extend(fixed.prototype,{
- ie6 : $.browser.msie && $.browser.version < 7.0,
- bindEvent : function(){
- var o=this;
- o.sts.target.css('position','absolute')
- o.overRelative().initBasePos();
- o.sts.target.css(o.sts.basePos)
- o.sts.container.scroll(o.scrollEvent()).resize(o.resizeEvent());
- o.setPos();
- },
- overRelative : function(){
- var o=this;
- var relative = o.sts.target.parents().filter(function(){
- if($j(this).css('position')=='relative')return this;
- })
- if(relative.size()>0)relative.after(o.sts.target)
- return o;
- },
- initBasePos : function(){
- var o=this;
- o.sts.basePos = {
- top: o.sts.target.offset().top - (o.sts.currentCss.top=='auto'?o.sts.container.scrollTop():0),
- left: o.sts.target.offset().left - (o.sts.currentCss.left=='auto'?o.sts.container.scrollLeft():0)
- }
- return o;
- },
- setPos : function(){
- var o=this;
- o.sts.target.css({
- top: o.sts.container.scrollTop() + o.sts.basePos.top,
- left: o.sts.container.scrollLeft() + o.sts.basePos.left
- })
- },
- scrollEvent : function(){
- var o=this;
- return function(){
- o.setPos();
- }
- },
- resizeEvent : function(){
- var o=this;
- return function(){
- setTimeout(function(){
- o.sts.target.css(o.sts.currentCss)
- o.initBasePos();
- o.setPos()
- },1)
- }
- }
- })
- })(jQuery)
- function Pop(title,url,intro){
- this.title=title;
- this.url=url;
- this.intro=intro;
- this.apearTime=1000;
- this.hideTime=500;
- this.delay=10000;
- //添加信息
- this.addInfo();
- //显示
- this.showDiv();
- //关闭
- this.closeDiv();
- }
- Pop.prototype={
- addInfo:function(){
- $("#popTitle a").attr('href',this.url).html(this.title);
- $("#popIntro").html(this.intro);
- $("#popMore a").attr('href',this.url);
- },
- showDiv:function(time){
- if (!($.browser.msie && ($.browser.version == "6.0") && !$.support.style)) {
- $('#pop').slideDown(this.apearTime).delay(this.delay).fadeOut(400);;
- } else{//调用jquery.fixed.js,解决ie6不能用fixed
- $('#pop').show();
- jQuery(function($j){
- $j('#pop').positionFixed()
- })
- }
- },
- closeDiv:function(){
- $("#popClose").click(function(){
- $('#pop').hide();
- }
- );
- }
- }
- </script>
- <script type="text/javascript" >
- //页面加载调用
- window.onload=function(){
- //使用参数:1.标题,2.链接地址,3.内容简介
- new Pop("HELLO!",
- "https://blog.csdn.net/wqlinloveruby",
- "此处填写提示内容!");
- }
- </script>
- <div id="pop" style="display:none;">
- <div id="popHead"> <a id="popClose" title="关闭">关闭</a>
- <h2>温馨提示</h2>
- </div>
- <div id="popContent">
- <dl>
- <dt id="popTitle"></dt>
- <dd id="popIntro"></dd>
- </dl>
- <p id="popMore"><a href="https://blog.csdn.net/wqlinloveruby" target="_blank">查看 »</a></p>
- </div>
- </div>
- <div style="text-align:center;clear:both">
- <p>jquery 右下角弹窗提示</p>
- <p><a href="https://blog.csdn.net/wqlinloveruby" target="_blank">欢迎关注</a></p>
- </div>
- </body>
- </html>
jquery实现登录后右下角弹窗提醒(附带简单样式)的更多相关文章
- winform右下角弹窗
网页是否经常在电脑右下角弹窗显示消息?其实Winform也是可以实现的.下面介绍两种方法. 第一步:设计窗体 第二步:实现代码 第一种方法 引用user32 声明常量 窗体Load事件 窗体FormC ...
- Winform实现右下角弹窗_提示信息
网页是否经常在电脑右下角弹窗显示消息?其实Winform也是可以实现的.下面介绍两种方法. 第一步:设计窗体 第二步:实现代码 第一种方法 引用user32 声明常量 窗体Load事件 窗体FormC ...
- [C++] 自己主动关闭右下角弹窗
近期腾讯.迅雷等各种client,都越发喜欢在屏幕的右下角弹框了. 有骨气的人当然能够把这些软件卸载了事,可是这些client在某些情况下却又还是实用的.怎么办呢? 作为码农,自己实现一个自己主动关闭 ...
- 【Winform-右下角弹窗】实现右下角弹窗,提示信息
网页是否经常在电脑右下角弹窗显示消息?其实Winform也是可以实现的.下面介绍两种方法. 第一步:设计窗体 第二步:实现代码 第一种方法 引用user32 声明常量 窗体Load事件 窗体FormC ...
- [C++] 自动关闭右下角弹窗
最近腾讯.迅雷等各种客户端,都越发喜欢在屏幕的右下角弹框了. 有骨气的人当然可以把这些软件卸载了事,但是这些客户端在某些情况下却又还是有用的.怎么办呢? 作为码农,自己实现一个自动关闭右下角弹窗的程序 ...
- 去除phpcms会员登录后头部登陆条的会员名称的括号
phpcms会员登录后显示会员名称是带括号的,现在把他修改成不带括号. 找到函数库libs/functions/global.func.php,修改如下即可: function get_nicknam ...
- 修改phpcms会员登录后头部登陆条的会员名称不带括号
phpcms会员登录后显示会员名称是带括号的,现在把他修改成不带括号. 找到函数库libs/functions/global.func.php,修改如下即可: function get_nicknam ...
- win7登录后开机密码破解读取
在win7登录后,win7密码可以直接读取. https://github.com/gentilkiwi/mimikatz
- 超级管理员登录后如果连续XX分钟没有操作再次操作需要重新登录
首先在设置session页面时 session_start(); session("name",$adminname); //加入session时间 time() session( ...
随机推荐
- 解决jquery click事件执行两次
js 解决办法 event.preventDefault() :阻止默认行为,可以用 event.isDefaultPrevented() 来确定preventDefault是否被调用过了 event ...
- 温故知新的错题训练:Coin game
传送门:http://192.168.173.163/JudgeOnline/problem.php?cid=1244&pid=1 输赢规则:无法再放下硬币的人就输. 博弈论的基本假定:他俩都 ...
- php处理复选框
1.HTML <form action="getData.php" method="post" enctype="multipart/form- ...
- Mysql备份参数
--all-databases , -A 导出全部数据库. mysqldump -uroot -p --all-databases --all-tablespaces , -Y 导出全部表空间. my ...
- react 实现圆环进度条
import React, { useState, useEffect } from "react" import { css } from "emotion" ...
- ASP.NET MVC 用户权限-1
MVC框架的开发网站的利器,MVC框架也开始越来越流行了.对于.NET ,微软也发布了MVC框架,做网站通常要涉及到用户的权限管理,对于.NET MVC 框架的用户权限管理又应该怎样设置呢?下面通过示 ...
- 02 Django虚拟环境搭建
01 创建虚拟环境目录 该目录用于存放所有虚拟环境. cd / mkdir venv cd venv 02 创建当前项目的虚拟环境 virtualenv --python=/usr/bin/pytho ...
- 《深入理解Java虚拟机》读书笔记一
第二章 Java内存区域与内存溢出异常 1.运行时数据区域 程序计数器: 当前线程所执行的字节码的行号指示器,用于存放下一条需要运行的指令. 运行速度最快位于处理器内部. 线程私有. 虚拟机栈: 描述 ...
- 2019杭电多校 permutation2
Problem:http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1007&cid=852 #include<bits ...
- C++ windows线程操作(转)
参考 1._beginthreadex创建线程 DWORD m_dwMSGTID; // 线程ID HANDLE m_hMSG; // 线程句柄 m_hMSG = (HANDLE)_beginthre ...