本demo的功能:点击页面按钮在其边缘出现提示信息,点击页面任何一处则消失。

如下图:

1.所需插件:

jquery插件;

layer插件;

2.html内容:

==注意==:

class="j-help-tips"这个class是核心,不可缺少。

data-tips属性是必须的。

data-tips属性中:type:"1"不用修改;

data-tips属性中:txt内容即是要提示的内容。

$(function(){

var tips = new helptips().init();

})

3.css内容:(非必要)

本demo的css非必须,不影响功能;

.edi-icon {

font-size: 18px;

font-style: normal;

-webkit-font-smoothing: antialiased;

-webkit-text-stroke-width: .2px;

-moz-osx-font-smoothing: grayscale;

*display: inline;

*zoom: 1;

cursor: pointer;

}

4.javascript内容:(核心)

//定义提示弹出框;

var helptipslayer;

//定义弹出框的默认设置;

function helptips(t) {

this.options = {},

this.options.elem = ".j-help-tips", //与页面class相对应;

this.options.type = 1,

this.options.color = "#8db3d7",

this.options.time = 0, //设置0是提示弹出框不会自动消失;可设置为其他数字,以毫秒为单位;

this.options.titleend = "录入提示",

this.options.width = "600px",

this.options.height = "",

this.options.imgwidth = "233",

this.options.imgheight = "375",

"undefined" != typeof t && (this.options = $.extend({}, this.options, t)),

this.elemobj = $(this.options.elem)

}

!

function() {

//点击页面任何一处可使提示弹出框消失;

$(document).on("click", function(event){

var e = event || window.event;

var target = e.target || e.srcelement;

var flag = $(target).hasclass("j-help-tips");

if(helptipslayer && !flag){

layer.close(helptipslayer);

}

})

}(), helptips.prototype = {

constructor : helptips,

init : function() {

this.bindevent()

},

bindevent : function() {

var t = this;

t.elemobj.on("click", function() {

layer.close(helptipslayer);//点击其他任意的提示框按钮,则关闭上一个提示框。

var i = $(this),

o = i.data("tips");

if ("undefined" != typeof o && "undefined" != typeof o.type && 1 == o.type) {

"undefined" != typeof o && "undefined" != typeof o.txt ? helptipslayer = layer.tips(o.txt, i, {

tips : [ t.options.type, t.options.color ],

time : t.options.time

}) : t.log()

} else {

if ("undefined" != typeof o.title && "undefined" != typeof o.txt && "undefined" != typeof o.img) {

var e = '

',

n = '

' + o.title + t.options.titleend + '

s = "

",

l = '

  • ',

p = o.txt.split("|"),

a = p.length;

a > 0 && $.each(p, function(t, i) {

l += '

' + (t + 1) + "" + i + ""

});

var r = /^[1-9][\d]{0,2}$/,

c = t.options.imgwidth,

d = t.options.imgheight;

"undefined" != typeof o.w && "undefined" != typeof o.h && r.test(o.w) && r.test(o.h) && (c = o.w, d = o.h), l += '

' + (a + 1) + "', l += "";

var h = e + n + l + s;

layer.open({

title : !1,

type : 1,

area : [ t.options.width, t.options.height ],

shadeclose : !0,

maxmin : !1,

move : !1,

scrollbar : !1,

content : h

})

} else {

t.log()

}

}

})

},

log : function() {

console.log("请给定提示标题|文字|图片---来自[script.js]函数[helptips]")

}

};

附上源码下载:

html5桌面打开网页是有问号,点击HTML页面问号出现提示框相关推荐

  1. C语言 在程序中打开网页,模拟鼠标点击、键盘输入

    C语言 在程序中打开网页,模拟鼠标点击.键盘输入 一.简述         记--使用C语言 打开指定网页,并模拟鼠标点击.键盘输入.实现半自动填写账号密码,并登录网站(当然现在的大部分网站都有验证码 ...

  2. python 批量打开网页并截图_Python自动截图html页面

    需求:实现自动截图html页面: 准备: 1.安装selenium 1)pip install selenium 2) 通过pycharm解释器图形化安装 File->settings-> ...

  3. 能在html中打开ppt吗,怎样在PPT中直接打开网页

    怎样在PPT中直接打开网页 2019-10-24 13:09 责任编辑:砕月 导读 / 当我们使用PowerPoint2007做幻灯片演示的时候,经常会碰到超级链接调用到网络信息.但是,只要一点击链接 ...

  4. bat创建桌面快捷方式,并用浏览器打开网页

    bat创建桌面快捷方式,并用浏览器打开网页 前言 1.创建一个.bat文件 2.输入以下代码 3.双击执行就能在桌面找到快捷方式了,如果遇到中文乱码问题图标什么的没显示 前言 bat创建桌面快捷方式, ...

  5. 如何隐藏计算机桌面窗口,电脑桌面窗口被隐藏,如何取消隐藏? 打开网页,各种软件,桌面下边的窗口都被隐藏了,很不方便。...

    电脑桌面窗口被隐藏,如何取消隐藏? 打开网页,各种软件,桌面下边的窗口都被隐藏了,很不方便.以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容,让我们赶 ...

  6. html打开桌面快捷方式,网页提示打开方式

    打开桌面网页快捷键每次都提示选择打开方式 我卸载了miniIE后发现点击原来收藏在桌面的网页快捷图标每次都提示要选打开记事本,复制桌面内容到记事本中: @ ECHO OFF @ ECHO. PAUSE ...

  7. html5: network error不能播放,如何解决WinXP系统下浏览器无法打开网页提示“network error”的问题...

    1xp系统笔记本正确安装无线网络的步 有些用户发现xp系统笔记本正确安装无线网络的问题,不知道是怎么回事,根据小编的了解还有很多的用户不知道xp系统笔记本正确安装无线网络的问题如何解决,那么今天我就给 ...

  8. HTML5桌面提醒的文章

    在很多社交网站如facebook, 人人网上,都会有一种消息提醒的功能.当你在浏览网页时有人给你发了消息,在你页面的右下角会出现一个小的提示框.这是一个很实用的小功能,但在目前来说,它有一个局限性:提 ...

  9. html5 桌面提醒参数,html5 桌面提醒:Notifycations应用介绍

    HTML5中的桌面提醒(web notifications)可以在当前页面窗口弹出一个消息框,这个消息框是跨 Tab 窗口的,这在用户打开多个 tab 浏览网页时,提醒比较方便,容易让用户看到.目前只 ...

  10. html5 桌面定时提醒,H5界面实现桌面推送通知

    8种机械键盘轴体对比 本人程序员,要买一个写代码的键盘,请问红轴和茶轴怎么选? 我们产品线的服务器告警模式是:"每十分钟执行一次脚本,脚本会使用zkclient获取当前服务器的CPU.内存. ...

最新文章

  1. Mysql binlog应用场景与原理深度剖析
  2. python机器学习入门(Day11:ANN)
  3. bzoj 5339 [TJOI2018]教科书般的亵渎 拉格朗日插值
  4. linux查看内存、cpu等硬件信息
  5. 伪元素的margin值挤压主体元素解决
  6. 【SSM】基于注解@Controller的控制器
  7. android 获取录音时长_录音转文字,支持安卓和IOS和PC
  8. 疫情防控背景下在线课程教学满意度影响因素分析与对策探讨-以电子商务及法律专业为例
  9. 计算机四级题库百度云资源,计算机四级题库
  10. CAD Voronoi图插件
  11. linux系统屏幕触摸校准
  12. STM32驱动模数转换芯片ADS1120(PT100铂电阻测温度)第2篇
  13. 疑为灵异现象不可思议的透明液晶揭秘
  14. 怎样在html中显示IP地址,如何通过ip查经纬度
  15. C语言/C++编程学习:C语言环境设置
  16. JS中怎样使用Date对象加减日期
  17. torch.nn.Linear详解
  18. 电信 NB-IoT无缝对接阿里云IoT 物联网平台
  19. 【C++ Primer Plus(6)】CH2 开始学习C++
  20. QT 5.3.2 + VC2012 中文乱码 完美解决方案

热门文章

  1. 10月24日,咱们自己的节日来了!
  2. 根据经纬度实现附近的人
  3. python四分位数_下四分位数和上四分位数分别是什么?能举个栗子吗?主要想了解python的quantile函数具体含义?...
  4. Oracle的四分位数函数
  5. html如何设置导航栏例子,CSS 导航栏
  6. C#顺时针逆时针旋转图片
  7. 中国城市交通管理体制改革初探
  8. Qt Cmake configuration has no path to a C++ compiler set, even though the toolkit has a v
  9. 计算机科学箴言集 -- 编程珠玑续
  10. Win11磁盘被写保护怎么解除?