jVectorMap标签不可见,为什么? [英] jVectorMap label is not visible, why?

查看:66
本文介绍了jVectorMap标签不可见,为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网页上创建了一个带触发器的滑块面板。
在这个面板上我放置了jVectorMap。
它运行正常(当我打开滑块面板时地图是可见的)只是国家标签不可见。
有谁知道为什么?

I created a slider panel with a trigger on a webpage. On this panel I placed the jVectorMap. It works fine (the map is visible when I open the slider panel) just the Country labels are not visible. Anybody knows why?

代码部分:

        $(".trigger").click(function(){
                $(".panel").toggle("fast");
                $(this).toggleClass("active");
                return false;
    });


        colors = {};
        colors['it'] = '#76ced9';
        $('#map').vectorMap({
            map: 'europe_en',
            //map: 'jquery-jvectormap-europe-en',
            onLabelShow: function(event, label, code){
                if (code == 'it') {
                    event.preventDefault();
                } else if (code == 'it') {
                    label.text('bla bla bal');
                }
            },              

            colors: colors,
            hoverOpacity: 0.7, // opacity for :hover
            hoverColor: false
        });

以下是面板的创建方式(我删除了一些部件以便您可以看到代码):

Here is how the panel is created(I removed some parts to so you can see the code):

<div class="panel" style="z-index:10;">
    <h3>Our Destinations</h3>
    <div id="map" style="width: 600px; height: 550px;"></div>    

<a class="trigger" href="#">Map</a>

我在想,可能因为面板超过html,标签可能不可见因为它落后但我无法弄清楚在哪里放z-index:10;
但问题可能是其他问题。
如果你有敏锐的眼睛和头脑,你可能会给我一个很好的建议。
Thanx,
K

I was thinking that maybe since the panel is over the html it is possible that the label is not visible because it is behind but I could not figure out where to put the z-index:10; But it is possible that the problem is something else. If you have a sharp eye and mind you might give me a great suggestion. Thanx, K

推荐答案

你有没有失去jquery.vector-map.css样式表在这个过程中?这会导致标签和缩放按钮消失。

Did you by any chance lose the jquery.vector-map.css stylesheet in the process? This would cause the labels and zoom buttons to disappear.

这篇关于jVectorMap标签不可见,为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆