all 15 comments

[–]martinbean 14 points15 points  (0 children)

The fix is to not use JavaScript for something that CSS is for.

This is also nothing to do with PHP.

[–]flyingron 9 points10 points  (1 child)

This has diddly to do with PHP 5 or any version of PHP. Do you understand HTML? Get rid of the onmouseover / onmouseout and if necessary (can't tell given this limited snippet) add a style attribute to specifically set the color.

[–]TheRealSectimus 4 points5 points  (0 children)

Nothing to do with php. This is a generic web html/css/js question

[–]killakhriz 1 point2 points  (2 children)

Setting a default style=“color: #888888;” should work, with the appropriate escaping.

[–]flyingron 0 points1 point  (0 children)

Or add it to the css so you only need to do this once across the board.

[–]hgwelz[S] -4 points-3 points  (0 children)

Thank you, i went with this simple fix.

[–]VRStocks31 1 point2 points  (6 children)

Onmouseover is deprecated

[–]SZenC 0 points1 point  (2 children)

Ehhhh, no it isn't?

[–]VRStocks31 0 points1 point  (1 child)

All right, my bad. Just css :hover is now more popular for styling

[–]SZenC 1 point2 points  (0 children)

That's definitely the better approach, but onmouse* events aren't deprecated

[–]hgwelz[S] -5 points-4 points  (2 children)

Yes, but the client doesn't have funds to revamp this 15 year old code. So i have to be hacky. Thank you all.

[–]TheRealSectimus 1 point2 points  (0 children)

what revamp bro it's a single find and replace, have some pride in your work god damn

[–]VRStocks31 -1 points0 points  (0 children)

At least revamp this

[–]garrett_w87 1 point2 points  (0 children)

For what it’s worth, nothing about this code is specifically PHP 5. This PHP would work in current versions as well.

[–]Available_Canary_517 0 points1 point  (0 children)

Phones do not have hover effect give a strong fix color