Replace Heading in Table

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Larry R Harrison Jr

    Replace Heading in Table

    I have Javascript called in HTML which runs a slide show. One thing that the
    HTML does is it has a "heading" just over the picture that never changes.
    I'd like to be able to have this heading be replaced with some other value
    to match the slide.

    The slides are run with code like this; this is just part of it:

    <select name="slide" onChange="chang e();">
    <option value="photos\5 857250r10198.jp g" selected>Ukrani an students welcome
    us to TCI
    <option value="photos\5 857729-r104521.jpg" selected>Tucson team with
    translators, at KCC
    </select>


    The function that runs the slide is ap(this.value) and the value in "option
    value" is what appears in "this.value ."

    Notice the descriptions to the right of each picture? I'd like to have the
    heading be replaced with whatever that description is. Currently the
    DROP-DOWN BOX does, but I'd like the heading to also--to give the photo a
    large & obvious heading you can't miss.

    Tips?

    LRH


  • Thomas 'PointedEars' Lahn

    #2
    Re: Replace Heading in Table

    Larry R Harrison Jr wrote:
    [color=blue]
    > [...]
    > <select name="slide" onChange="chang e();">
    > <option value="photos\5 857250r10198.jp g" selected>Ukrani an students
    > welcome us to TCI
    > <option value="photos\5 857729-r104521.jpg" selected>Tucson team with
    > translators, at KCC
    > </select>
    >
    >
    > The function that runs the slide is ap(this.value) and the value in
    > "option value" is what appears in "this.value ."
    >
    > Notice the descriptions to the right of each picture? I'd like to have the
    > heading be replaced with whatever that description is. Currently the
    > DROP-DOWN BOX does, but I'd like the heading to also--to give the photo a
    > large & obvious heading you can't miss.[/color]

    Assuming that the image and heading is specified as

    <div id="descr" style="position :relative; left:0; top:0">&nbsp;</div>
    <img src="..." alt="..." ...>

    you could write

    if (document.getEl ementById)
    {
    this.getElemByI d = function getElemById(id)
    {
    return document.getEle mentById(id);
    }
    }
    else if (document.all)
    {
    this.getElemByI d = function getElemById(id)
    {
    return document.all(id );
    }
    }
    else if (document.layer s)
    {
    this.getElemByI d = function getElemById(id)
    {
    return document.layers[id];
    }
    }
    else
    {
    this.getElemByI d = function getElemById()
    {
    return null;
    }
    }

    function ap(v)
    {
    // ...
    var descr = getElemById("de scr");
    if (descr)
    {
    if (descr.firstChi ld) descr.firstChil d.nodeValue = v; // DOM 2+
    else if (descr.innerHTM L) descr.innerHTML = v; // DOM 0
    else if (descr.innerTex t) descr.innerText = v; // IE DOM
    else if (descr.document ) // NN4 DOM
    {
    descr = descr.document;
    descr.open();
    descr.write(v);
    descr.close();
    }
    }
    // ...
    }


    HTH

    PointedEars

    P.S.
    Does NetIdentity, 350 South Center Street, Ste. 500 Reno,
    NV 89501, know that you are abusing their domain?

    <http://www.interhack.n et/pubs/munging-harmful/>

    Comment

    Working...