Kane250 Posted June 26, 2008 Share Posted June 26, 2008 I have a rollover image being used as a submit button that also opens a popup window. It works fine in Safari and Opera but not in Firefox. In firefox it just shows up as a big square...any idea why this would be happening? <html> <!-- function wopen(url, name, w, h) { // Fudge factors for window decoration space. // In my tests these work well on all platforms & browsers. w += 20; h += -20; var win = window.open(url, name, 'width=' + w + ', height=' + h + ', ' + 'location=no, menubar=no, ' + 'status=no, toolbar=no, scrollbars=no, resizable=no'); win.resizeTo(w, h); win.focus(); } // --> <div id="emailcheck"> <input type="submit" value="" class="button" onclick="wopen('mainsub.php', 'popup', 400, 375); return true;" onmouseover="this.className='button-over';" onmouseout="this.className='button';" /> </div> </html> Quote Link to comment Share on other sites More sharing options...
TheFilmGod Posted June 26, 2008 Share Posted June 26, 2008 Why use javascript to change the submit button, if you can do the same thing in CSS? I know :hover isn't supported on all browsers, like IE6, but about 70% of them do support it. Quote Link to comment Share on other sites More sharing options...
Kane250 Posted June 30, 2008 Author Share Posted June 30, 2008 Why use javascript to change the submit button, if you can do the same thing in CSS? I know :hover isn't supported on all browsers, like IE6, but about 70% of them do support it. Because the submit triggers a javascript popup. So I couldn't see a way to code a standard rollover that also connected with a popup window.. Quote Link to comment Share on other sites More sharing options...
haku Posted June 30, 2008 Share Posted June 30, 2008 Use CSS to do the hover, use javascript to do the popup. Quote Link to comment Share on other sites More sharing options...
Kane250 Posted June 30, 2008 Author Share Posted June 30, 2008 Use CSS to do the hover, use javascript to do the popup. I am. This is my CSS: .button { border:0px; outline:0px; background:url('images/emailcheck.png'); width: 41px; height: 33px; } .button-over { border:0px; outline:0px; background:url('images/emailcheckro.png'); width: 41px; height: 33px; } Quote Link to comment Share on other sites More sharing options...
haku Posted June 30, 2008 Share Posted June 30, 2008 change .button-over to .button:hover Quote Link to comment Share on other sites More sharing options...
Kane250 Posted June 30, 2008 Author Share Posted June 30, 2008 change .button-over to .button:hover Not quite sure what that does but it made my rollover toggle between the normal image, the rollover image, and a white square. It was very glitchy... Quote Link to comment Share on other sites More sharing options...
haku Posted July 1, 2008 Share Posted July 1, 2008 Then you are doing it wrong. Lets see your code. edit: and preferably a link. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.