views:

622

answers:

3

I'm working on a project at the moment where I've come up against a rather frustrating problem in Internet Explorer. I have a series of pop ups on a particular page that are opened with JavaScript when help links are clicked. The JavaScript for them is:

function openHelpPopUp(url) {
    newwindow=window.open(url,'name','width=620,height=440');
    if (window.focus) {newwindow.focus()}
    return false;
}

The HTML used is:

<a href="help.html" onclick="return openHelpPopUp('help.html')" title="More information" class="help-popup-link">Help</a>

Now, the pop up works perfectly in every browser except Internet Explorer. The main priority at the moment is making it work in IE7.

What happens is that, it pops up fine, but the text is not visible. If you click and drag the cursor over it and highlight it though, it becomes visible. Once you click away from the highlighted area to deselect it, it stays visible. Any area that wasn't highlighted stays invisible. When you refresh the pop up though, it sometimes becomes visible without any highlighting, it sometimes doesn't.

Also peculiar is that some text within an unordered list is visible, but when I use the same list encompass the rest of the text, it stays invisible bar the bit that was already visible.

Have you come across this or anything like it before? Have you got any tips or suggestions? I'm running out of things to try so any feedback or help on this is greatly appreciated!

A: 

Sounds like a browser bug.

What happens if you open the URL directly? Perhaps it's not popup related?

Rog
Opening it directly, results in the same problem in IE, it is invisible until it is highlighted. As far as I can tell there is nothing unusual happening with the CSS or HTML
Matt
Actually, opening it directly the text flashes up briefly and then disappears
Matt
+1  A: 

By adding a z-index of 100 to every P tag for IE, I seem to have gotten it visible now. Weird. I haven't used any z-index's elsewhere and the structure of the HTML should put the P's on the top anyway.

Matt
A: 

it pops up fine, but the text is not visible. If you click and drag the cursor over it and highlight it though, it becomes visible

Sounds like it might be an IE7 variant Peekaboo bug, an IE rendering problem which is nothing to do with being opened in a pop-up. You'd have to show us the page that's being popped up to be sure though.

Whilst we're here:

if (window.focus) {newwindow.focus()}

Probably should be ‘if (newwindow.focus)’ assuming the aim is to avoid focusing a blocked ‘window.open()=null’.

bobince