简体   繁体   English

Javascript帮助禁用列链接和工具提示

[英]Javascript help disable column link and tooltip

How do I disable javascript click and tooltip. 如何禁用JavaScript单击和工具提示。

You can see the problem here http://www.vinderhimlen.dk/vind-rejse-deltag-i-konkurrencer-om-rejser 您可以在这里看到问题http://www.vinderhimlen.dk/vind-rejse-deltag-i-konkurrencer-om-rejser

The rating column should not show a tooltip or be a link. 评级列不应显示工具提示,也不应该是链接。

It is attached on my tabels row: 它附在我的表格行上:

<tr class="thumbnail-item" onclick="window.open('<%= vind.tracking %>')" onmouseout="this.style.background='white';" onmouseover="this.style.background='#99ff33';this.style.cursor='pointer'">

My tooltip script: 我的工具提示脚本:

  <script type="text/javascript">


  $(document).ready(function () {

 $('.thumbnail-item').mouseenter(function(e) {

  x = e.pageX;
  y = e.pageY;

  $(this).css('z-index','15')
  $(this).css('cursor', 'default')
  $(this).find(".tiptip").css({'top': y,'left': x,'display':'block'});


 }).mousemove(function(e) {

  x = e.pageX;
  y = e.pageY;

  $(this).find(".tiptip").css({'top': y,'left': x});

 }).mouseleave(function() {

  $(this).css('z-index','1')
  $(this).css('background', 'none')
  $(this).css('color', '#000000')
  $(this).find(".tiptip").animate({"opacity": "hide"},100);
 });

});
  </script>

Pretty easy actually. 其实很容易。 Why don't you just handle the onmouseover/out events in the <td></td> tags and leave it out on the rating column? 您为什么不只处理<td></td>标签中的onmouseover / out事件,而将其保留在“评级”列中?

TR background coloring can be achieved by attaching a pseudo-class to the tr tag or the .thumbnail-item class. 通过将伪类附加到tr标签或.thumbnail-item类,可以实现TR背景着色。

tr:hover 
{
    background-color: #99FF33;
}

you should disable the mouseover event to bubble up. 您应该禁用mouseover事件以使其冒泡。

I have run the following script using firebug to achieve the result. 我已经使用firebug运行以下脚本来实现结果。

$("#tabel1 tr td:nth-child(2):gt(0)")
.mouseover(
              function(event)
              {
                event.preventDefault();
                return false;
              });

edited __ As your mouse is over the tooltip, it is not working very good. 已编辑 __由于鼠标悬停在工具提示上,因此效果不佳。 move your cursor away from tooltip a little bit. 将光标从工具提示移开一点。

his is where you calculating the mouse points 他是您计算鼠标点的地方

x = e.pageX; 
y = e.pageY;

you sould do it like this 你可以这样做

x = e.pageX+3; 
y = e.pageY+3;

in both function of mousemove and mouseover 在mousemove和mouseover功能上

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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