SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot Matt_M's Avatar
    Join Date
    Sep 2004
    Location
    Oregon
    Posts
    112
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Only show image if Javascript is enabled?

    Hi,

    I have this code in my page that shows a tooltip when the image is rolled over, but since the tooltip won't show up if Javascript is disabled, I don't want the questionmark3.gif image to show up either. Any idea how to do this?

    Thanks, Matt

    Code:
    <span onmouseover="showmenu('question1')" onmouseout="hidemenu('question1')">
    <img src="images/questionmark3.gif" width="12" height="14"><span style="width:200px; text-align:left" class="question" id="question1">tooltip here</span>
    </span>

  2. #2
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    could use document.write() which won't work if javascript is not enabled.

    Code:
    <span onmouseover="showmenu('question1')" onmouseout="hidemenu('question1')">
    <script type="text/javascript">document.write('<img src="images/questionmark3.gif" width="12" height="14">');</script><span style="width:200px; text-align:left" class="question" id="question1">tooltip here</span>
    </span>


  3. #3
    SitePoint Zealot Matt_M's Avatar
    Join Date
    Sep 2004
    Location
    Oregon
    Posts
    112
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Perfect! Thanks!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •