2012-01-20 27 views
0

工具提示显示正常,但当我尝试将鼠标指向某个项目时,下拉框会自动关闭。这只发生在Internet Explorer上,在其他浏览器上它正常工作。为什么我不能在IE上选择使用JQuery vtip?但是,在Chrome浏览器上,Mozilla没有问题

HTML代码:

<table width="100%" cellpadding="0" cellspacing="2" border="0"> 
      <tr> 
       <td width="20%" class="fundoTituloForm">Entidade:</td> 
       <td width="80%" class="bordaFormResp"> 
       <select name="academia" id="academia" class="formulario vtip" title="Selecione a entidade que deseja"> 

JS代码:

this.vtip = function() {  
    this.xOffset = -10; // x distance from mouse 
    this.yOffset = 20; // y distance from mouse  

    $(".vtip").unbind().hover( 
     function(e) { 
      this.t = this.title; 
      this.title = ''; 
      this.top = (e.pageY + yOffset); this.left = (e.pageX + xOffset); 

      $('body').append('<p id="vtip"><img id="vtipArrow" />' + this.t + '</p>'); 

      $('p#vtip #vtipArrow').attr("src", '../../imagens/vtip_arrow.gif'); 
      $('p#vtip').css("top", this.top+"px").css("left", this.left+"px").fadeIn("fast"); 

     }, 
     function() { 
      this.title = this.t; 
      $("p#vtip").fadeOut("slow").remove(); 
     } 
    ) 
    .mousemove(
     function(e) { 
      this.top = (e.pageY + yOffset); 
      this.left = (e.pageX + xOffset); 

      $("p#vtip").css("top", this.top+"px").css("left", this.left+"px"); 
     } 
    );    

}; 

jQuery(document).ready(function($){vtip();}) 

您可以在真正的here检查不同的浏览器看到的。 有人可以帮助我吗?

回答

0

因为IE8不像Chrome,Firefox或IE9那样支持许多jQuery功能。您必须为IE8行为编写一个例外,以绕过您正在尝试执行的操作或通过IE8浏览器的备用选项来处理。

相关问题