简体   繁体   中英

how to add/modify jQuery tooltip plugin for ajax - how to add live function?

I use this plugin for jQuery: http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/

I would like add or modify this for add function live(), because now doesn't working with use Ajax.

all code: http://pastebin.com/up6KYKCN

start in 47 line:

$.fn.extend({
        tooltip: function(settings) {
                settings = $.extend({}, $.tooltip.defaults, settings);
                createHelper(settings);
                return this.each(function() {
                                $.data(this, "tooltip", settings);
                                this.tOpacity = helper.parent.css("opacity");
                                // copy tooltip into its own expando and remove the title
                                this.tooltipText = this.title;
                                $(this).removeAttr("title");
                                // also remove alt attribute to prevent default tooltip in IE
                                this.alt = "";
                        })
                        .mouseover(save)
                        .mouseout(hide)
                        .click(hide);
        },

probably here must change mouseover(save) and add live(), but how?

I assume you mean it doesn't work with the ASP.NET Ajax Toolkit?

If so I used Sys.Application.add_load() to attach my tooltips instead of jQuery $(document).ready().

The difference between the two is add_load is also called for partial postbacks (eg UpdatePanels) so your tooltips are reattached correctly.

See Dave Ward: $(document).ready() and pageLoad() are not the same!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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