欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Jquery中國(guó)地圖熱點(diǎn)效果-鼠標(biāo)經(jīng)過(guò)彈出提示層信息的簡(jiǎn)單實(shí)例

 更新時(shí)間:2014年02月12日 08:54:51   投稿:jingxian  
本篇文章主要是對(duì)Jquery中國(guó)地圖熱點(diǎn)效果-鼠標(biāo)經(jīng)過(guò)彈出提示層信息的簡(jiǎn)單實(shí)例進(jìn)行了介紹,需要的朋友可以過(guò)來(lái)參考下,希望對(duì)大家有所幫助

如下所示:

復(fù)制代碼 代碼如下:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>Jquery中國(guó)地圖熱點(diǎn)效果-鼠標(biāo)經(jīng)過(guò)彈出提示層信息的簡(jiǎn)單實(shí)例</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); // 注意函數(shù)名沒(méi)有引號(hào)和括弧
        });

        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="images/1544302yufceen0c3nbjzu.png" />
    </div>
</body>
</html>

相關(guān)文章

最新評(píng)論