如下所示:
复制代码 代码如下:
<!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="/UploadFiles/2021-04-02/jquery-1.8.0.min.js"> <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="/UploadFiles/2021-04-02/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,弹出层
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
《魔兽世界》大逃杀!60人新游玩模式《强袭风暴》3月21日上线
暴雪近日发布了《魔兽世界》10.2.6 更新内容,新游玩模式《强袭风暴》即将于3月21 日在亚服上线,届时玩家将前往阿拉希高地展开一场 60 人大逃杀对战。
艾泽拉斯的冒险者已经征服了艾泽拉斯的大地及遥远的彼岸。他们在对抗世界上最致命的敌人时展现出过人的手腕,并且成功阻止终结宇宙等级的威胁。当他们在为即将于《魔兽世界》资料片《地心之战》中来袭的萨拉塔斯势力做战斗准备时,他们还需要在熟悉的阿拉希高地面对一个全新的敌人──那就是彼此。在《巨龙崛起》10.2.6 更新的《强袭风暴》中,玩家将会进入一个全新的海盗主题大逃杀式限时活动,其中包含极高的风险和史诗级的奖励。
《强袭风暴》不是普通的战场,作为一个独立于主游戏之外的活动,玩家可以用大逃杀的风格来体验《魔兽世界》,不分职业、不分装备(除了你在赛局中捡到的),光是技巧和战略的强弱之分就能决定出谁才是能坚持到最后的赢家。本次活动将会开放单人和双人模式,玩家在加入海盗主题的预赛大厅区域前,可以从强袭风暴角色画面新增好友。游玩游戏将可以累计名望轨迹,《巨龙崛起》和《魔兽世界:巫妖王之怒 经典版》的玩家都可以获得奖励。