简体   繁体   English

更改工具提示位置/箭头

[英]Change tooltip position/arrow

I have a tooltop in my area map that I've done which I'm using http://qtip2.com/ 我在我的区域地图中有一个tooltop,我已经完成了我正在使用http://qtip2.com/

my code when I call the tooltip is the same one in this question Tooltip on map area tag 当我调用工具提示时,我的代码与地图区域标签上的此问题工具提示中的代码相同

jQuery(document).ready(function (e) {
jQuery('area').qtip({
    style: {
        classes: 'qtip-dark'
    },
    events: {
        show: function(event, api) {
            api.set({
                'content.text': api.elements.target.attr('title')
            });
        }
    }
});
});

But my tooltip is always on the bottom right corner of my area, is there any way I can let it on my top right corner instead? 但是我的工具提示始终位于我所在区域的右下角,有什么方法可以让它放在我的右上角吗?

Find the below answer it will helpful to you. 找到以下答案,它将对您有所帮助。

jQuery(document).ready(function (e) 
                    {
                        jQuery('area').qtip({
                            style: 
                            {
                                classes: 'qtip-default  qtip qtip-light qtip-rounded',
                                width: '250px',
                                height: '70px',
                                tip: true

                            },
                            position:
                            {
                                my : 'bottom left',
                                at: 'top right',
                                adjust: {
                                     method: 'none none', // Requires Viewport plugin
                                     resize: true
                                 },
                            },
                            events: 
                            {
                                show: function(event, api) 
                                {

                                api.set
                                ({
                                    'content.text': api.elements.target.attr('title')
                                });

                                }
                            }
                            });
                    });

Thanks to Chiral Patel's comment I've found a way, thank you! 感谢Chiral Patel的评论,我发现了一种方法,谢谢!

jQuery(document).ready(function (e) 
                    {
                        jQuery('area').qtip({
                            style: 
                            {
                                classes: 'qtip-default  qtip qtip-light qtip-rounded',
                                width: '250px',
                                height: '70px',

                            },
                            position:
                            {
                                my : 'bottom left',
                                at: 'top right',
                                method:'none'
                            },
                            events: 
                            {
                                show: function(event, api) 
                                {

                                api.set
                                ({
                                    'content.text': api.elements.target.attr('title')
                                });

                                }
                            }
                            });
                    });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM