jquery
  • jquery-ui
  • internet-explorer-8
  • 2012-02-18 77 views 0 likes 
    0

    仅在IE8中看到jQuery UI按钮集的问题。在IE 8下,按钮集不会始终触发更改事件。jQuery 1.7.1 IE8中的ButtonSet不一致地触发更改事件

    <!DOCTYPE html> 
    <html> 
    <head> 
    
    <link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.16/themes/south-street/jquery-ui.css" rel='stylesheet' type='text/css'> 
    
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.js"></script> 
    <script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.11/jquery-ui.js"></script> 
    
    <script language="javascript"> 
    
        $(document).ready(function() { 
         $("#toolGroup").buttonset(); 
         $("#toolGroup").change(
         function() { 
          alert("hi"); 
         } 
         ); 
        }); 
    
    </script> 
    </head> 
    <body> 
    
        <div id="toolGroup"> 
         <input name="marker" type="radio" id="check1" value="point" checked /><label for="check1"><img src="/images/point.png" width="40" /></label> 
         <input name="marker" type="radio" id="check2" value="line" /><label for="check2"><img src="/images/line.png" width="40" /></label> 
         <input name="marker" type="radio" id="check3" value="polygon" /><label for="check3"><img src="/images/polygon.png" width="40" /></label> 
        </div> 
    
    </body> 
    </html> 
    

    当它出现时,外观大多好。每个人都是一致的。按钮的角落不是圆形的。当我点击按钮时,他们会压抑。

    但是,我可以多次来回点击并且改变事件似乎随机发生。这完全不一致。

    在Chrome中,它每次都会触发。

    任何想法?

    This is a related question on SO.它说支持点击事件。我会在提交后尝试,但这不是我想要的助记符。我要变化”。

    +0

    我注意到,只要你不点击破损的图像在ie ... – Johan 2012-02-18 23:05:49

    回答

    1

    只有当控件失去焦点时,Internet Explorer才会触发“更改”事件。因此,它基本上是破碎的,并且无用于许多目的。使用“点击”确实是最好的选择。

    +0

    什么是P.O.S. IE是。谢谢。 – 010110110101 2012-02-19 03:44:31

    相关问题