On 8/2/06, Dean Champeau <[EMAIL PROTECTED]> wrote: > Hello. > > I have a series of buttons that I've styled with CCS using a:hover > and I'm having a problem... > > Most of the buttons are just ordinary "a href..." markup that links > to other HTML pages, but one of buttons needs to open a PDF file in a > separate window. I originally used... > > a href="blahblah" target="blank" > > for my markup, but there was an issue with IE opening the file in a > new window but then immediately minimizing the window, for whatever > reason. So I decided to use an "onclick" script to open the file > instead. Now IE opens the file in a new window correctly, but > my :hover styling doesn't work anymore for that particular button. > It's almost as if IE doesn't look for a style unless there's an > "href" attribute associated with the "a" element. > > Anybody have a clue what's going on? BTW, Safari on Mac applies > the :hover style as expected.
The answer doesn't lie with css but with the markup: use <a href="foo.pdf" onclick="window.open('foo.pdf',whatever);return false;"> This still works if the user doesn't have js, and the return false stops the activation of the html link if the javascript is successful. However, I wouldn't do either of these. The user has a choice of how to display pdf - acrobat reader plugin, acrobat reader as external app, or some other application (such as full acrobat), and should have their preference set. forcing a new window if they are using an external viewer just leaves them with a blank new window. -- Richard Grevers, New Plymouth, New Zealand Hat 1: Development Engineer, Webfarm Ltd. Hat 2: Dramatic Design www.dramatic.co.nz ______________________________________________________________________ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/