国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 語言 > JavaScript > 正文

Jquery中國地圖熱點效果-鼠標經過彈出提示層信息的簡單實例

2024-05-06 16:00:45
字體:
來源:轉載
供稿:網友
本篇文章主要是對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><p>提示消息<span></span><span></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>
        <img usemap="#Map" src="images/1544302yufceen0c3nbjzu.png" />
        <map>
            <area href="forum.php?gid=1" coords="354,140,380,153" shape="rect">
            <area href="forum.php?gid=3" coords="434,246,462,259" shape="rect">
            <area href="forum.php?gid=2" coords="382,168,408,180" shape="rect">
            <area href="forum.php?gid=4" coords="294,264,320,276" shape="rect">
            <area href="forum.php?gid=5" coords="347,174,374,186" shape="rect">
            <area href="forum.php?gid=6" coords="322,186,348,198" shape="rect">
            <area href="forum.php?gid=7" coords="349,110,388,124" shape="rect">
            <area href="forum.php?gid=8" coords="406,128,432,140" shape="rect">
            <area href="forum.php?gid=9" coords="427,101,454,115" shape="rect">
            <area href="forum.php?gid=10" coords="424,58,464,73" shape="rect">
            <area href="forum.php?gid=11" coords="404,224,417,250" shape="rect">
            <area href="forum.php?gid=12" coords="413,265,427,291" shape="rect">
            <area href="forum.php?gid=13" coords="382,236,395,263" shape="rect">
            <area href="forum.php?gid=14" coords="399,300,413,327" shape="rect">
            <area href="forum.php?gid=15" coords="371,286,385,313" shape="rect">
            <area href="forum.php?gid=16" coords="373,196,399,208" shape="rect">
            <area href="forum.php?gid=17" coords="337,228,364,239" shape="rect">
            <area href="forum.php?gid=18" coords="329,258,356,271" shape="rect">
            <area href="forum.php?gid=19" coords="325,294,352,306" shape="rect">
            <area href="forum.php?gid=20" coords="356,343,382,355" shape="rect">
            <area href="forum.php?gid=21" coords="302,343,328,355" shape="rect">
            <area href="forum.php?gid=22" coords="313,398,340,411" shape="rect">
            <area href="forum.php?gid=23" coords="239,265,265,277" shape="rect">
            <area href="forum.php?gid=24" coords="283,311,308,324" shape="rect">
            <area href="forum.php?gid=25" coords="225,337,251,349" shape="rect">
            <area href="forum.php?gid=26" coords="303,224,316,251" shape="rect">
            <area href="forum.php?gid=27" coords="179,156,205,168" shape="rect">
            <area href="forum.php?gid=28" coords="174,206,200,218" shape="rect">
            <area href="forum.php?gid=29" coords="277,188,290,212" shape="rect">
            <area href="forum.php?gid=30" coords="85,140,111,152" shape="rect">
            <area href="forum.php?gid=31" coords="87,249,113,261" shape="rect">
            <area href="forum.php?gid=32" coords="379,358,406,370" shape="rect">
            <area href="forum.php?gid=33" coords="349,371,375,383" shape="rect">
            <area href="forum.php?gid=34" coords="434,322,448,348" shape="rect">
        </map>
    </div>
</body>
</html>

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 千阳县| 曲麻莱县| 鹿邑县| 定边县| 黄平县| 乾安县| 江永县| 双鸭山市| 信阳市| 炎陵县| 湟中县| 泸溪县| 凉山| 桓仁| 都安| 永昌县| 金沙县| 萨嘎县| 永靖县| 芦山县| 衢州市| 铅山县| 方山县| 忻城县| 卓尼县| 即墨市| 望谟县| 嘉兴市| 林周县| 扎囊县| 额尔古纳市| 通许县| 开江县| 灌云县| 永城市| 衡山县| 怀远县| 剑阁县| 临夏市| 淄博市| 广水市|