Results 1 to 4 of 4

Thread: Column Browser JavaScript?

  1. #1
    Join Date
    Jun 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Column Browser JavaScript?

    Hello,
    Is there any column browser script I can use similiar to the one at http://www.apple.com/downloads/dashboard/
    Thanks,
    Harold

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,994
    Thanks
    43
    Thanked 3,198 Times in 3,160 Posts
    Blog Entries
    12

    Default

    First off, the example you give doesn't work too well in IE6. Secondly, why not just set up three iframes side by side by side on your page, each with a unique id. Then the content on the page loaded into each iframe can select that of the next using a very simple onclick event in an anchor tag, ex:

    Code:
    <a href="#" onclick="parent.getElementById('frameId').src='dumbcars.htm';return false">Dumb Cars (22)</a>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jun 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for your advice, I'll start working on that.
    How do I script it so that the image (or link color) also change when its clicked?
    Thanks-

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,994
    Thanks
    43
    Thanked 3,198 Times in 3,160 Posts
    Blog Entries
    12

    Default

    So, you want to duplicate what you saw on that page. Well, here is a thought:

    Code:
    <a href="#" onclick="this.className='clicked';ar1.src='whitearrow.gif';parent.document.getElementById('frameId').src='dumbcars.htm';return false">Dumb Cars (22) <img name="ar1" src="bluearrow.gif"></a>
    Then you could define a class in a style sheet with the color and background of your choosing:

    <style>
    .clicked {
    color:white;
    background:blue;
    }

    .oldClicked {
    color:black;
    background:gray;
    }
    </style>

    Then I suppose when you click on the next iframe's link you want the previous iframe's link to go to a grey background. This would require a script on the first iframe's page:

    <script>
    function greyOut(){
    var links=document.getElementsByTagName('a');
    for (var i =0; i<links.length ; i++){
    if (links[i].className=='clicked')
    links[i].className='oldClicked'
    break
    }
    }
    </script>

    Then in its body tag:

    <body onBlur="greyOut()">

    Just a general idea, may require some refinement.
    Last edited by jscheuer1; 06-07-2005 at 07:24 AM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •