How can I fix image rollovers in Safari 3?

  • Thread starter Thread starter Monique
  • Start date Start date
  • Tags Tags
    Image
AI Thread Summary
Programming image rollovers for Safari 3 has presented challenges, as many developers report issues following the browser's update. The basic rollover code using onmouseover and onmouseout works in various browsers, including Safari 3 for Windows, but inconsistencies arise in Safari 3 for Mac. A user shared a working code snippet and discussed using PHP for dynamic image handling in navigation menus. They suggested that by integrating PHP, the need for JavaScript could be eliminated when the user is on the relevant page. The proposed solution involves conditionally rendering the image source based on the current script name, allowing for both active and rollover states without relying solely on JavaScript.
Monique
Staff Emeritus
Science Advisor
Gold Member
Messages
4,211
Reaction score
68
Does anyone have experience with programming image rollovers that work in Safari 3? I programmed a website a while ago and everything worked fine, until Safari got updated to version 3. It seems to be a common problem, many programmers complain of this bug, but I haven't come across a solution.

Any suggestions?
 
Technology news on Phys.org
The following code works fine in an HTML 4.01 page on IE7, Firefox 3, and Safari 3 for Windows:
Code:
<IMG src="myimage1.png" onmouseover="this.src='myimage2.png'" onmouseout="this.src='myimage1.png'">
The appropriate modifications allow it to work in XHTML as well. What is the code you're using?
 
Thank you, I test-cased it on the Safari 3 for Mac and it works like a charm!

The code I'm using is xhtml with css, java and php. *edit* Wouldn't it be easier to make the code in php?

Right now I have in my navigation page:
<img src="img/navigation_items/faq<? if($current_scriptname=="faq.php") echo "_act";?>.png">

The menu item button "faq" will be displayed as active when someone is on the "faq" page. So if I could put in a mouseover statement in there that also echos "_act", I would be done.
 
Last edited:
When the page is on the FAQ, you no longer need the javascript at all, so you could use something like this:
Code:
<img src="img/navigation_items/faq<?if($current_scriptname=="faq.php") {?>_act.png" <?} else {?>.png" onmouseover="this.src='img/navigation_items/faq_act.png'" onmouseout="this.src='img/navigation_items/faq.png'"<?}?> />
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top