jQuery   发布时间:2022-04-19  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了jquery – $(this).qtip不是函数大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_@R_301_2480@_2@
我在我的页面中跟随代码,该代码在图像上应用了qtip.它通过ajax帖子显示每个图像的动态内容.但是在ThickBox / Jquery UI对话框关闭后它没有显示qtip并抛出错误:$(this).qtip不是函数

<script src="<%= Config.VirtualDir %>js/jquery.js?v=2" type="text/javascript"></script>
<script src="<%= Config.VirtualDir %>js/jquery.qtip-1.0.0-rc3.min.js?v=2" type="text/javascript"></script>

<script type="text/javascript" language="javascript">

$(document).ready(function() {
     BindQtip();
});
 function BindQtip()
 {
$('image').each(function(){
                        $(this).live('click',function() {
                            var $img = $(this);
                            if('<%= objAdminAuth.GetUserID() %>' == $img.attr('data-uid').split('|')[0])
                            {                                        
                                return false;
                            }
                           if ($img.data('qtip')) {return false;} 
                            $(this).qtip({
                                content: 'Loading...',style: {
                                    border: {
                                        width: 5,radius: 10
                                    },padding: 0,textAlign: 'center',tip: true,// Give it a speech bubble tip with automatic corner detection
                                    name: 'dark' // Style it according to the preset 'cream' style
                                },hide: 'unfocus',show: {
                                    when: 'click',// Don't specify a show event
                                    ready: true,// Show the tooltip when ready
                                    solo: true
                                },position: {
                                    corner: {
                                        tooltip: 'rightMiddle',// Use the corner...
                                        target: 'bottomLeft' // ...and opposite corner
                                    }
                                },api: {
                                    // Retrieve the content when tooltip is first rendered
                                    onRender: function() {

                                        var self = this;
                                        self.content = '';
                                        $.ajax({
                                            url: window.LOCATIOn.href,type: 'POST',data: 'call=ajax&uid=' + $img.attr('data-uid'),success: function(resp) {
                                                self.updateContent(resp);
                                            }
                                        });

                                    },onContentupdate: function() {
                                        var self = this;
                                    }
                                }
                            });
                        });
                        });
}
</script>

所有路径都是正确的,其他东西都很完美.我错过了什么吗?@H_801_10@

任何帮助,将不胜感激.@H_801_10@

解决方法

看起来您正在使用AJAX在当前文档中插入HTML,此HTML也由显示初始页面的脚本生成.这意味着< script>的可能性很高.诸如jQuery和qTip的@L_262_18@不仅包含在您的初始页面中,还包含在您的AJAX响应中.如果这是真的,这些“后来的”脚本将覆盖窗口内的东西.$结果与你描述的相同.

因此,检查您的AJAx是否包含脚本,如果包含脚本,请删除它们.一切都应该正常工作.@H_801_10@

@H_@R_301_2480@_2@

大佬总结

以上是大佬教程为你收集整理的jquery – $(this).qtip不是函数全部内容,希望文章能够帮你解决jquery – $(this).qtip不是函数所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。