Jquery problems in IE8

2019-07-21 11:57发布

问题:

Jquery runs fine in Safari and Firefox. In IE8 (using the Developer Tools), I get the error: "Could not get the position property. Invalid argument jquery-1.3.2.js, line 12 character 12949". Using debugging, the script highlights the characters {J[G]=K}.

I have no idea what this does, but it seems to cause the problem! The result is when a thumbnail image is clicked in one of my galleries, the image does not open in IE8. If anyone understands this or how to correct it, I'd be very grateful! See the problem in action (or not) on my website www.blueshiftgallery.com Many thanks!

回答1:

The problem appears to be with the Captify plugin. The same issue occurs on IE8 on the demo page - http://thirdroute.com/projects/captify/

Clicking the image does not work. However, clicking the caption text which appears when you hover does work.



回答2:

I was experiencing a similar problem, my code worked in all browsers except IE (the usual story).

I was getting the same error message when I was using jquery to pop-up a dialog box.

Eventually I figured out it was because I was using the pos parameter with values containing NaN rather than integers.

This was due to the fact I was using window.innerWidth when populating my pos array. The solution was to use $(window).width() instead.

Technically I don't think these are equivalent as one gets the inner width while the other gets the total width but for my purposes it was good enough.



回答3:

Here is why I had why I encountered this same problem.

var visitorPanelHeight = $('#VisitorPanel').css('height').replace(/px/i, '');

I was attempting to grab a height and strip off the 'px' from the value that was never set through .css. This returned 'auto'.

I hope this helps.



回答4:

for me it is solved this way and is working correctly in IE8 and IE7

just remove or comment out position property which shape the touching of the tip.

here is my Qtip constructor.

 <script type="text/javascript">
    $.fn.qtip.styles.mystyle = {

        background: '#A2D959',
        color: 'black',
        textAlign: 'right', direction: 'rtl',          
        name: 'dark' 
         , tip: 'topLeft' 
        // , position: { corner: { target: 'bottomRight', tooltip: 'topLeft'} }
    }

    $(document).ready(function () {
        $('#tt21,#tt22,#tt4,#ttMobile,#ImgEmail,.ttFaname').qtip({ style: { name: 'mystyle'} });
    });
</script>