Support » Themes and Templates » Clickable header/not working in Firefox

  • Resolved davidt82

    (@davidt82)


    I have an image as a header, working as a clickable link back to the main page. In IE everything appears to work properly, but in Firefox and Safari, on mouseover the image shows a hand, but when clicked does nothing. The site is http://www.almostachef.com and I am using the following code in the header:

    <div id=”header” onclick=”location.href=’http://www.almostachef.com/;” style=”cursor: pointer;”>

    I realize this may have been touched upon in the forums before, but I am having issues with the search function.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • That is some massively bad code there.

    <a href="http://www.almostachef.com">
    <div id="header" onclick="location.href='http://www.almostachef.com/;" style="cursor: pointer;">
    <a name="top"></a><h1>
    </a>
    </h1>
    <div class="description"></div></div>

    I mean, ick. Get rid of the anchor that’s in the wrong place. Try something more like this:

    <div id="header" onclick="location.href='http://www.almostachef.com/;" style="cursor: pointer;">
    <a name="top"></a><h1>
    </h1>
    <div class="description"></div></div>

    That might work, even though it’s a darned odd way of doing things.

    If you are dining at Spago why not get a WP pro in to help out? And all that onClick malarkey is completely redundant. A link is a link.

    ok – I exchanged the code with the suggestion given and it’s still not working properly. I apologize for the apparently horrible coding you encountered. How about this, will someone please help me with code, or a LINK to make the header work properly in Safari/Firefox. I got that original bit from here on the forums, so I would appreciate any alternatives. THANKS.

    I think I have resolved this, I changed the fact that the header was a background image in the CSS and instead have just planted it as an img in the header file. I did a normal html link from the image and it seems to work properly in both browsers now. If anyone thinks this might be a bad idea, please let me know. thanks for your time

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Clickable header/not working in Firefox’ is closed to new replies.