Results 1 to 2 of 2

Thread: Targeting Scrollable Content Script II

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

    Default Targeting Scrollable Content Script II

    Scrollable Content Script II

    http://www.dynamicdrive.com/dynamicindex11/scrollc2.htm

    I was wondering if it were possible to use a hide/show script that was targeted to the Scrollable content script II. I can't exactly explain it so here's an image:



    I need all the help I can get, guys. I've been brooding about this for weeks now and finally it's time to ask. Thanks
    Last edited by probably james; 08-07-2005 at 09:32 PM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    OK, in the script find the function called:

    getcontent_height()

    Replace these two lines:
    Code:
    if (iens6)
    contentheight=crossobj.offsetHeight
    with these:
    Code:
    if (iens6){
    contentheight=crossobj.offsetHeight
    temp=crossobj.innerHTML
    }
    Just above the function getcontent_height() insert this new function:
    Code:
    function switchConts(id){
    if (id=='content')
    crossobj.innerHTML=temp
    else
    crossobj.innerHTML=document.all? document.all[id].innerHTML : document.getElementById(id).innerHTML
    contentheight=crossobj.offsetHeight
    }
    Now you can make additional content divisions on the page. A good place to put them is at the end of the document, just above the </body> tag. They will look something like this:
    HTML Code:
    <div id="content2" style="display:none">
    Here is a bunch of additional content that will be displayed when you click on a link above the scroller.  You cannot see it now because its display is set to none.
    </div>
    Use as many as you need. Give them each a unique id and put whatever text and links inside them that you like. Be sure to keep the 'style="display:none"' attribute for each one. Now we are ready to go, here are two example links for switching the contents of the scroller:
    HTML Code:
    <a href="#" onclick="switchConts('content2');return false;">switch</a>&nbsp;
    <a href="#" onclick="switchConts('content');return false;">switch back</a>
    These can go above the scroller, like in your picture.
    - 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
  •