简体   繁体   English

工具提示无法与我的CSS一起使用

[英]Tooltip not working with my css

Why doesn't my tooltip work with my css in here? 为什么我的工具提示在这里不能与CSS一起使用? http://jsfiddle.net/BG4Sn/ http://jsfiddle.net/BG4Sn/

Please see the jsfiddle, the problem is, that with my css included, the tooltip won't show up true box tooltip after mouse enter on links tooltip1 & tooltip2 & tooltip3 . 请查看jsfiddle,问题是,包括我的CSS在内,当鼠标在链接tooltip1tooltip2tooltip3上输入后,工具提示将不会显示真实的框工具提示。 When I remove the link to my css in the html head, it works true. 当我删除html头中指向CSS的链接时,它的工作原理是正确的。

function tool_tip() {
        //var tip = $('.tool_tip').closest('li').find('div').clone();
        $('.tool_tip').mouseenter(function () {
            var $this = $(this),
                $div = $this.closest('li').find('div');
            $(this).attr('title', '');
            $div.fadeTo(300, 0.9);
        }).mousemove(function (e) {

            $('.tooltip').css('bottom', e.pageY + -10);
            $('.tooltip').css('left', e.pageX + 10);

        }).mouseleave(function () {
            $('.tooltip').hide();
        })
    }
tool_tip();

The CSS being applied to .tooltip in your style_s.css is different from your JSFiddle. 在style_s.css中应用于.tooltip的CSS与JSFiddle不同。 Copy and paste this .tooltip style into style_s.css: 将此.tooltip样式复制并粘贴到style_s.css中:

.tooltip {
    background-color: #E5F4FE;
    display: none;
    padding: 5px 10px;
    background-color: #E5F4FE;
    border: #5A5959 1px solid;
    position: fixed;
    z-index: 9999;
    color: #0C0C0C;
    font-size: 0.688em;
}

Then linking to style_s.css will produce the same style. 然后链接到style_s.css将产生相同的样式。

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

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