HTML/Coding help - technophobes stay away.....

Discussion in 'Bulletin Board ARCHIVE' started by Dyson, Feb 20, 2009.

  1. Dys

    Dyson Well-Known Member

    Joined:
    Jul 13, 2005
    Messages:
    14,519
    Likes Received:
    4,832
    Trophy Points:
    113
    Location:
    Tarn centre
    Home Page:
    Style:
    Barnsley (full width)
    I'm ammending some very basic content at work & I'm looking to incorporate a few things which I'm finding it quite hard to find online.

    I'm wanting to have a 'show/hide' option where you select a 'link' on the page & it reveals some content below. Once you select the link again it disappears. How would I go about doing that?

    Also, when I hover over a certain word I'd like a 'top tip' or an explanation of that word to appear above it, when you move away I want it to disappear. Again, I can't find this online anywhere.

    If anyone could help that would be fantastic.
     
  2. kestyke

    kestyke Well-Known Member

    Joined:
    Jul 26, 2005
    Messages:
    3,448
    Likes Received:
    1,719
    Trophy Points:
    113
    Location:
    In the chestnut tree cafe, waiting
    Home Page:
    Style:
    Barnsley
  3. Dys

    Dyson Well-Known Member

    Joined:
    Jul 13, 2005
    Messages:
    14,519
    Likes Received:
    4,832
    Trophy Points:
    113
    Location:
    Tarn centre
    Home Page:
    Style:
    Barnsley (full width)
    Yes mate, can't seem to find the code I'm looking for.
     
  4. kestyke

    kestyke Well-Known Member

    Joined:
    Jul 26, 2005
    Messages:
    3,448
    Likes Received:
    1,719
    Trophy Points:
    113
    Location:
    In the chestnut tree cafe, waiting
    Home Page:
    Style:
    Barnsley
    The cheats way would be to find a site where you can see

    the effect you are looking for and then go.. view.. source in explorer or view page source in Firefox and steal the code.
     
  5. Gue

    Guest Guest

  6. FWF

    FWF New Member

    Joined:
    May 26, 2006
    Messages:
    844
    Likes Received:
    0
    Trophy Points:
    0
    Home Page:
    use javascript and hidden iframe

    I don't how savvy you are with regard to javascript and DHTML.</p>

    Anyway, if you've got a bit of text and a button/image/link that you click onto revealmore text below, you canoutput to the page a hidden iframecontaining the text you want to display but with the style of visibility:hidden and an iframe id. When you click on the button, inyour onclick method for the button you will get a reference to the iframe by using document.getElementById(&quot;yourid&quot;) and dynamically changing the style of the iframe from visibility &quot;hidden&quot; to visibility &quot;visible&quot; - in javascript something like document.getElementById(&quot;yourid&quot;).style.visibility=visible; </p>

    In the onclick method for the button you will need to check the current style, ie, if it is visible change it to hidden, and vice versa, so the button hides/displays the iframe accordingly.</p>

    if(document.getElementById(&quot;yourid&quot;).style = 'hidden') </p>

    document.getElementById(&quot;yourid&quot;).style.visibility=visible; // and the otherway around</p>

    Hope this helps</p>

    </p>
     
  7. NTU

    NTU Tyke Member

    Joined:
    Mar 23, 2006
    Messages:
    324
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Nottingham
    Home Page:
    Style:
    Barnsley (full width)
    You have PM nt
     

Share This Page