小编Joa*_*aso的帖子

如何实现jquery live()而不是每个()

嗨我一直在努力让这个脚本http://jsbin.com/ipajo5/工作,但使用.live()而不是.each(),因为html表是即时填充的.

$(document).ready(function() {

  $('.bi').each(function () {
    // options
    var distance = 10;
    var time = 250;
    var hideDelay = 500;

    var hideDelayTimer = null;

    var beingShown = false;
    var shown = false;

    var trigger = $('.tt', this);
    var popup = $('.popup', this).css('opacity', 0);

    // set the mouseover and mouseout on both element
    $([trigger.get(0), popup.get(0)]).mouseover(function () {
      if (hideDelayTimer) clearTimeout(hideDelayTimer);

      if (beingShown || shown) {
        return;
      } else {
        beingShown = true;    
        popup.css({
          top: $(this).position().top-150,
          left: $(this).position().left-100,
          display: 'block' …
Run Code Online (Sandbox Code Playgroud)

javascript jquery popup tooltip

2
推荐指数
1
解决办法
611
查看次数

标签 统计

javascript ×1

jquery ×1

popup ×1

tooltip ×1