401 posts
  • Author had a Free File of the Month
  • Elite Author
  • Exclusive Author
  • Sold between 100 000 and 250 000 dollars
  • Has been a member for 3-4 years
  • Referred between 200 and 499 users
  • Bought between 100 and 499 items
+2 more
theAlThemist says

Hey guys,

I have a strange problem and need your help.

Could you tell me what is wrong here (actually it is not wrong because it works fine in every browser except IE – in IE7 not working at all and in IE8 only the mask is visible but not the overlay container)

<script type="text/javascript">
$("#add_to_cart[rel]").overlay({
    oneInstance: false,
    closeOnClick: false,
    mask:'#000',
    top: (window.innerHeight / 2) - 60,
    left: (window.innerWidth / 2) - 60,
    onLoad: function() {
        setTimeout('$("#add_to_cart[rel]").data("overlay").close();', 1000);
    },
});
</script>

Any help would be appreciated. Thanks in advance!

1040 posts
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
  • Has been a member for 4-5 years
  • Bought between 10 and 49 items
  • Exclusive Author
  • Microlancer Beta Tester
  • United States
fillerspace says
<script type="text/javascript">
$("#add_to_cart[rel]").overlay({
    oneInstance: false,
    closeOnClick: false,
    mask:'#000',
    top: (window.innerHeight / 2) - 60,
    left: (window.innerWidth / 2) - 60,
    onLoad: function() {
        setTimeout('$("#add_to_cart[rel]").data("overlay").close();', 1000);
    }
});
</script>

See what I changed? There was an extra comma at the end, after the onLoad function declaration. Most browsers ignore this, but it breaks IE

401 posts
  • Author had a Free File of the Month
  • Elite Author
  • Exclusive Author
  • Sold between 100 000 and 250 000 dollars
  • Has been a member for 3-4 years
  • Referred between 200 and 499 users
  • Bought between 100 and 499 items
+2 more
theAlThemist says

Thank you fillerspace.

Unfortunately the only difference is that now IE7 also load the mask but not the modal container. And it doesn’t close after 1000 ms.

Really don’t understand… works like a charm in FF, Chrome and Safari(Win7)...

1040 posts
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
  • Has been a member for 4-5 years
  • Bought between 10 and 49 items
  • Exclusive Author
  • Microlancer Beta Tester
  • United States
fillerspace says

Weird…maybe look at this demo and see why it works:

http://flowplayer.org/tools/demos/overlay/modal-dialog.htm

401 posts
  • Author had a Free File of the Month
  • Elite Author
  • Exclusive Author
  • Sold between 100 000 and 250 000 dollars
  • Has been a member for 3-4 years
  • Referred between 200 and 499 users
  • Bought between 100 and 499 items
+2 more
theAlThemist says

This demo is using only the default settings and I need more than one instance to be available and automatic self close function. May be this is the problem. I’ll try with another version of jQuery – may be this is the problem.

Anyway, thank you for your help.

401 posts
  • Author had a Free File of the Month
  • Elite Author
  • Exclusive Author
  • Sold between 100 000 and 250 000 dollars
  • Has been a member for 3-4 years
  • Referred between 200 and 499 users
  • Bought between 100 and 499 items
+2 more
theAlThemist says

Finally made it. And the lesson is – never put modal window in container with relative position. IE hates this (and I hate IE). :)

3365 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Community Moderator
  • Bought between 50 and 99 items
  • Referred more than 2000 users
  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+4 more
sevenspark Volunteer moderator says

Finally made it. And the lesson is – never put modal window in container with relative position. IE hates this (and I hate IE). :)

Ah, the joys of cross-browser compatibility testing… I shudder to think the number of development hours that have been wasted solving IE’s temperamental glitches :|

Thanks for posting back your solution – glad you got it resolved :)

1040 posts
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
  • Has been a member for 4-5 years
  • Bought between 10 and 49 items
  • Exclusive Author
  • Microlancer Beta Tester
  • United States
fillerspace says

Glad it worked out!

by
by
by
by
by
by