这个jQuery工具提示行为我做错了什么?

(编辑)当前行为不是悬停时显示的工具提示。不是默认的html标题或jquery工具提示(/ edit) 我在网页上有一个日历。当一天有事件并将鼠标悬停在该事件上时,将显示html title属性,其中包含以逗号分隔的事件名称。当一天有20个事件时,这将开始变得难看,所以我想使用jQuery以不同的方式进行显示。这是我显示工具提示的代码(我遇到了使用$ for jQuery的问题,因为我不理解页面上其他jQuery脚本之间的冲突和输入全部似乎只是工作):
jQuery(function(){
        var tip = jQuery("#tip");

        //on hover of links with a class of "eventful"
        jQuery(".eventful a").hover(function(e){

            //pull the title attribute into variable "tip"
            tip.text(jQuery(this).attr("title"));

            //make the default title blank
            jQuery(this).attr("title", "");

            //place the new title with css
            tip.css("top",(e.pageY+5)+"px")
                .css("left",(e.pageX+5)+"px")
                .fadeIn("slow");

        }, function() {
                //on mouse out remove
                jQuery("#tip").fadeOut("fast");

                //replace the default title
                jQuery(this).attr("title", tip.html());
        });
    });
那不行,所以我不确定那里我做错了什么。但是在我显示工具提示后,我需要更改显示多个逗号分隔事件的方式,最好更改为无序列表。我在下面有这个片段,可能会也可能不会将这些项目分成一个数组,在每个逗号中断掉字符串: var titleArray = $(“。eventful”)。attr(“title”)。split(“,”); 如果确实有效,我不确定如何将其合并,并将其纳入ul。非常感谢您的帮助!     
已邀请:
tip div应该有
position:absolute
风格&它的z-index应该大于页面中的其他元素。添加
jQuery("#tip").css('z-index',somehighvalue)
    

要回复问题请先登录注册