如何在jQuery中更改悬停事件

我只在鼠标悬停时显示此数据。如何更改悬停以自动显示数据?当我使用show()时,代码不起作用。

(function(e) {
  var t = function(e,t) {
    this.elem = e;
    this.settings = t;
    this.megaMenuHtml1();
    this.menulist = this.elem.find(".leftmenulist li a");
    this.menuHelper(this.elem);
    this.addEvents()
  };

  t.prototype = {
    regex: {
      islabel: new RegExp("/search/label/","g"),issearch: new RegExp("[?&]q=",labelsearch: new RegExp("(//[^/]+)/search/label/([^/?&]+).*[?&]q=([^$&]+)(?:[^$]+)?",label: new RegExp("(//[^/]+)/search/label/([^/?&$]+)",search: new RegExp("(//[^/]+)/search/?[?&]q=(.*)","g")
    },addEvents: function() {
      var t = this;
      this.menulist.hover(function() {
        if (e(this).data("menuloaded") !== "true") {
          t.li = e(this);
          t.url = t.li.attr("href");
          t.container = t.li.closest("ul").siblings("ul");
          t.vkk1()
        }
      },function() {})
    },vkk1: function() {
      var t = this;
      this.getaJAXUrl();
      if (!this.ajaxUrl) return;
      this.ajaxcall = e.ajax({
        type: "GET",url: t.ajaxUrl,dataType: "jsonp",data: t.ajaxData,beforeSend: function() {
          t.showLoader()
        },success: function(e) {
          t.hideLoader();
          t.addArrow();
          t.showPosts(e)
        },})
    },getaJAXUrl: function() {
      if (this.url) {
        var e = this;
        this.ajaxData = {
          alt: "json","max-results": this.settings.postsnumber
        };

        this.url.search(this.regex.islabel) !== -1 && this.url.search(this.regex.issearch) !== -1 ? this.ajaxUrl = this.url.replace(this.regex.labelsearch,function(t,n,r,i) {
          e.ajaxData.q = i;
          return [n,"/feeds/posts/default/-/","/"].join("")
        }) : this.url.search(this.regex.islabel) !== -1 && this.url.search(this.regex.issearch) === -1 ? this.ajaxUrl = this.url.replace(this.regex.label,r) {
          delete e.ajaxData.q;
          return [n,"/"].join("")
        }) : this.url.search(this.regex.islabel) === -1 && this.url.search(this.regex.issearch) !== -1 ? this.ajaxUrl = this.url.replace(this.regex.search,r) {
          e.ajaxData.q = r;
          return [n,"/feeds/posts/default"].join("")
        }) : this.ajaxUrl = !1
      } else this.ajaxUrl = !1
    },showLoader: function() {},hideLoader: function() {},showPosts: function(t) {
      var n = this,r = [],i,s,o;

      t.feed.openSearch$totalResults.$t > 0 ? e.each(t.feed.entry,u) {
          i = u.title.$t;
          e.each(u.link,function(e,t) {
            t.rel === "alternate" ? s = t.href : s = "#"
          });
          o = u.media$thumbnail ? u.media$thumbnail.url.replace(/\/s72\-c\//,"/s200-c/") : n.settings.noThumbnail;
          r.push('<li><span class="thumb-container"><a title="','" href="','"><img alt="','" src="',o,'"/><br />',"</a></span></li>")
        }) : r.push("<h5>","No posts available.","</h5>");
      this.container.html(r.join(""));
      this.menulist.removeData("menuloaded");
      this.li.data("menuloaded","true")
    },addArrow: function() {},menuHelper: function(t) {},megaMenuHtml1: function() {
      this.elem.find("ul ul").remove();
      this.elem.addClass("megamenuid").find(">li").find("ul:first").addClass("leftmenulist").wrap(e("<div></div>",{
        "class": this.settings.divClass
      }));
      e("ul.leftmenulist").after(e("<ul></ul>",{
        "class": "rightmenulist"
      }))
    },};

  e.fn.megaBloggerMenu1 = function(n) {
    var r = {
        postsnumber: 4
      },i = e.extend({},n);
    return this.each(function() {
      var n = new t(e(this),i)
    })
  }
})(jQuery);

jQuery(document).ready(function($) {
  $('#megamenuid').megaBloggerMenu1({
    postsnumber: 4
  });
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<ul id='megamenuid'>
  <li><a href='#'>Fashion</a>
    <ul>
      <li id='111'><a href='//sora-cart-soratemplates.blogspot.in/search/label/mens'>MEN</a></li>
      <li><a href='//sora-cart-soratemplates.blogspot.in/search/label/women'>WOMEN</a></li>
      <li><a href='//sora-cart-soratemplates.blogspot.in/search/label/kids'>KIDS</a></li>
    </ul>
  </li>
</ul>

zxczhao2009 回答:如何在jQuery中更改悬停事件

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2890460.html

大家都在问