Jquery地图热点效果-鼠标经过弹出提示信息
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Jquery地图热点效果-鼠标经过弹出提示信息</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<script src="JS/jquery-1.8.0.min.js" type="text/javascript"></script>
<style type="text/css">
.map img
{
width: 496px;
height: 415px;
}
.mapDiv
{
width: 140px;
height: 61px;
padding: 5px;
color: #369;
background: url('Images/dialge.gif') no-repeat;
position: absolute;
display: none;
word-break: break-all;
}
</style>
<script type="text/javascript">
$(document).ready(function () {
$("area").each(function () {
var $x = -55;
var $y = -80;
var name = $(this).attr("alt");
$(this).mouseover(function (e) {
var strall = [];
strall = $(this).attr("coords").split(",");
var x = parseInt(strall[0]);
var y = parseInt(strall[3]);
var index_num = $(this).index();
var dom = "<div class='mapDiv'><p>提示消息<span class='name'></span><span class='num'></span></p></div>";
$("body").append(dom);
$(".name").text(name);
$(".num").text(index_num)
$(".mapDiv").css({
left: (x + $x) + "px",
top: (y + $y) + "px" }).show();
}).mouseout(function () {
$(".mapDiv").remove();
}).mousemove(function (e) {
$(".mapDiv").css({
left: (x + $x) + "px",
top: (y + $y) + "px"
})
});
});
//first load
show();
//random
setInterval(show, 3000); // 注意函数名没有引号和括弧
}); function show() {
var area = $("area");
var random = getRandom(area.length);
$(area[random]).trigger("mouseover");
} function getRandom(n) { return Math.floor(Math.random() * n + 1) }
</script>
</head>
<body>
<div class="map">
<img border="0" usemap="#Map" src="data:images/1544302yufceen0c3nbjzu.png" />
<map name="Map" id="Map">
<area id="beijing" alt="北京" href="forum.php?gid=1" coords="354,140,380,153" shape="rect">
<area id="shanghai" alt="上海" href="forum.php?gid=3" coords="434,246,462,259" shape="rect">
<area id="tianjin" alt="天津" href="forum.php?gid=2" coords="382,168,408,180" shape="rect">
<area id="chongqing" alt="重庆" href="forum.php?gid=4" coords="294,264,320,276" shape="rect">
<area id="hebei" alt="河北" href="forum.php?gid=5" coords="347,174,374,186" shape="rect">
<area id="shanxi" alt="山西" href="forum.php?gid=6" coords="322,186,348,198" shape="rect">
<area id="neimenggu" alt="内蒙古" href="forum.php?gid=7" coords="349,110,388,124" shape="rect">
<area id="liaoning" alt="辽宁" href="forum.php?gid=8" coords="406,128,432,140" shape="rect">
<area id="jilin" alt="吉林" href="forum.php?gid=9" coords="427,101,454,115" shape="rect">
<area id="heilongjiang" alt="黑龙江" href="forum.php?gid=10" coords="424,58,464,73" shape="rect">
<area id="jiangsu" alt="江苏" href="forum.php?gid=11" coords="404,224,417,250" shape="rect">
<area id="zhejiang" alt="浙江" href="forum.php?gid=12" coords="413,265,427,291" shape="rect">
<area id="anhui" alt="安徽" href="forum.php?gid=13" coords="382,236,395,263" shape="rect">
<area id="fujian" alt="福建" href="forum.php?gid=14" coords="399,300,413,327" shape="rect">
<area id="jiangxi" alt="江西" href="forum.php?gid=15" coords="371,286,385,313" shape="rect">
<area id="shandong" alt="山东" href="forum.php?gid=16" coords="373,196,399,208" shape="rect">
<area id="henan" alt="河南" href="forum.php?gid=17" coords="337,228,364,239" shape="rect">
<area id="hubei" alt="湖北" href="forum.php?gid=18" coords="329,258,356,271" shape="rect">
<area id="hunan" alt="湖南" href="forum.php?gid=19" coords="325,294,352,306" shape="rect">
<area id="guangdong" alt="广东" href="forum.php?gid=20" coords="356,343,382,355" shape="rect">
<area id="guangxi" alt="广西" href="forum.php?gid=21" coords="302,343,328,355" shape="rect">
<area id="hainan" alt="海南" href="forum.php?gid=22" coords="313,398,340,411" shape="rect">
<area id="sichuan" alt="四川" href="forum.php?gid=23" coords="239,265,265,277" shape="rect">
<area id="guizhou" alt="贵州" href="forum.php?gid=24" coords="283,311,308,324" shape="rect">
<area id="yunnan" alt="云南" href="forum.php?gid=25" coords="225,337,251,349" shape="rect">
<area id="shaanxi" alt="陕西" href="forum.php?gid=26" coords="303,224,316,251" shape="rect">
<area id="gansu" alt="甘肃" href="forum.php?gid=27" coords="179,156,205,168" shape="rect">
<area id="qinghai" alt="青海" href="forum.php?gid=28" coords="174,206,200,218" shape="rect">
<area id="ningxia" alt="宁夏" href="forum.php?gid=29" coords="277,188,290,212" shape="rect">
<area id="xinjiang" alt="新疆" href="forum.php?gid=30" coords="85,140,111,152" shape="rect">
<area id="xizang" alt="西藏" href="forum.php?gid=31" coords="87,249,113,261" shape="rect">
<area id="xianggang" alt="香港" href="forum.php?gid=32" coords="379,358,406,370" shape="rect">
<area id="aomen" alt="澳门" href="forum.php?gid=33" coords="349,371,375,383" shape="rect">
<area id="taiwan" alt="台湾" href="forum.php?gid=34" coords="434,322,448,348" shape="rect">
</map>
</div>
</body>
</html>

Jquery地图热点效果-鼠标经过弹出提示信息的更多相关文章
- jQuery地图热点效应-后在弹出的提示鼠标层信息
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/ ...
- Jquery使用mouseenter和mouseleave实现鼠标经过弹出层且可以点击
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Jquery使用mousee ...
- 如何不使用js实现鼠标hover弹出菜单效果
最近看到很多同学在实现鼠标hover弹出菜单的效果时都是用的js代码去实现的,默认给弹出隐藏掉,通过js事件绑定动态的显/隐弹出菜单元素. <ul> <li>主页</li ...
- jquery鼠标经过弹出层写法
jquery鼠标经过弹出层写法<pre><div class="navitem"><a href="/index.php?c=news&am ...
- jQuery弹出提示信息简洁版(自动消失)
之前看了有一些现成的blockUI.Boxy.tipswindow等的jQuery弹出层插件,可是我的要求并不高,只需要在保存后弹出提示信息即可,至于复杂点的弹出层-可以编辑的,我是直接用bootst ...
- 纯css实现鼠标感应弹出二级菜单
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- SVN 安装后右键出现点击鼠标右键弹出错误提示:CrashHandler initialization error
SVN 安装后右键出现点击鼠标右键弹出错误提示:CrashHandler initialization error 原因是目标文件夹中缺少SendRpt.exe文件 解决方案:找svn是好的的同事将b ...
- jQuery弹出提示信息自动消失简洁版
// 在bootstrap中可以,可以使用如下方式实现弹出提示信息自动消失,如果没有使用bootstrap框架,可以自定义样式 //tip是提示信息,type:'success'是成功信息,'dang ...
- Bootstrap历练实例:弹出提示信息的样式按钮
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content=&q ...
随机推荐
- 第二次项目冲刺(Beta阶段)--第六天
一.站立式会议照片 二.项目燃尽图 三.项目进展 1.继续完成docx文件的读取,听取助教的意见采用原型法,先简单写了一个可运行的docx文件的读取类,还是无法实现docx的读取,异常,但是该导入的j ...
- 在配置github中遇到的一些问题
这次在配置github时,我出现了问题,就是在我装好Git以后,我打开Git Bash,输入了这句代码:$ ssh-keygen -t rsa -C "your_email@youremai ...
- Swing-setOpaque()用法-入门
先看API: public void setOpaque(boolean isOpaque) 如果为 true,则该组件绘制其边界内的所有像素.否则该组件可能不绘制部分或所有像素,从而允许其底层像素透 ...
- 201521123039 《java程序设计》第一周学习总结(新)
1.本章学习总结 -Java是面向对象的程序语言,它一切定义都是对象.我们所编写的Java程序经过编译后生成了.class的文件,再经过JVM对.class解释运行就可以得到Java程序,所以Java ...
- Maven第三篇【Maven术语、pom.xml介绍】
maven术语 在我们上一篇中已经知道了在Intellij idea下是如何使用Maven的了,创建出来的目录结构是这样子的: 上面的目录结构就是Maven所谓的"约定",我们使用 ...
- 常用Java API(转)
一. java.io.BufferedReader类(用于从文件中读入一段字符:所属套件:java.io) 1. 构造函数BufferedReader(java.io.FileReader FileR ...
- 接口测试入门(3)--使用httpClient进行登录用例操作/set-cookies验证/ List<NameValuePair>设置post参数/json解析
(最近学的都是很基础的接口测试,都是基于UI界面可见的接口,就是发请求,接收响应,分析返回的结果,校验,对共通模块进行封装,仅此而已,其实做自动化的思路基本都是如此,UI也是.) 现在开始用httpC ...
- 浅谈IT技术女转战微电商初体验
今天闲来无事,突然想翻看下之前写的技术博客,很是意外,居然那么多阅读量,于是想想做微商也有一段时间了,决定写写初入微商的初体验. 先自我介绍一下,本人是一名理工女,做IT行业的,这个行业也许有人了解, ...
- [python学习笔记] pyinstaller打包pyqt5程序无法运行
问题 pyinstaller打包的pyqt5程序在部分电脑上会失败.用户截图提示下边错误日志 无法定位程序输入点 ucrtbase.terminate 于动态链接库 api-ms-win-crt-ru ...
- RMQ问题第一弹
今天,我给大家分享一下我在学习 RMQ 问题过程中对该问题的理解. RMQ (Range Minimum/Maximum Query ):中文名为"区间最值查询".RMQ 问题指的 ...