开发者社区> 问答> 正文

有关qtip刷新提示内容的问题?报错

@巴顿 你好,想跟你请教个问题:

我看您之前用过qtip,并实现了每次点击刷新提示内容的功能,想问下具体的实现方式。

以下是我的代码,想实现一个在表格行上添加批注的功能。

<script type="text/javascript">
  jQuery(document).ready(function() {   
      $('a').each(function()
      {
        $(this).qtip(
        {         
         id:'mytip',
          content: {
            url: '1.html',
            method:'post',
            title: {
              text: '编辑批注',
              button: '关闭'
            }
          },
          position: {
            corner: {
              target: 'bottomMiddle',
              tooltip: 'topMiddle'
            },
            adjust: {
              screen: true
            }
          },
          show: {
            when: 'click',
            solo: true
          },
          hide: false,         
          style: {
            tip: true,
            border: {
              width: 0,
              radius: 4
            },
            name: 'light',
            width: 570
          },
          api:{
           beforeHide:function(){
             alert ($("this").qtip("api"));
       } 
      }        
        })
      });   
  });
 </script>
 <body>
  <table>
   <tr>
     <td><a id="link1" />      <td>content</td>
   </tr>
   <tr>
     <td><a />      <td>content</td>
   </tr>
   <tr>
     <td><a />      <td>content</td>
   </tr>      
  </table>
 
 
 </body>

我看了您的解决方案,但我无论通过$("#link1").qtip("api")还是$("#mytip").qtip("api")都会报错。

我的jquery版本为1.3.2, qtip 1.0-rc3

我Js的水平还在入门级,望解惑,感谢!

 

展开
收起
爱吃鱼的程序员 2020-06-22 17:30:09 467 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    我也没调到这个方法

    $("#link1").qtip("api")还是$("#mytip").qtip("api")。

    你可以用destory方法,将所有的qTip删掉,然后重建,这样数据就是最新的了。

    2020-06-22 17:30:27
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载