Image is not clickable inside anchor only in IE7

后端 未结 12 1663
孤城傲影
孤城傲影 2021-02-04 05:16

Html Structure


      
   
   
    Some text 
<         


        
12条回答
  •  花落未央
    2021-02-04 06:21

    With jQuery, the following will force all links to work, and have the 'pointer' cursor:

    $(document).ready(function () {
    
        $('a')
            .click(function () {        
                window.location = $(this).attr('href');
            })
            .hover(function () {
                $(this).css('cursor', 'pointer');
            });
    
    });
    

    I've tested this simulating IE7 with IE8 in compatibility view mode, but can't guarantee it will for IE7 on its own.

    You may want to apply this more selectively -- I suspect that, as is, this might slow down older browser performance -- in which case apply a class (like ) to all links that are broken this way, and just change $('a') to $('.myClass')

提交回复
热议问题