Results 1 to 7 of 7

Thread: changeable iframe content help

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

    Question changeable iframe content help

    I like the script for this scrollable content iframe- http://www.dynamicdrive.com/dynamicindex11/scrollc2.htm I also have a script that I use on my website that is a 2 level combo box- http://javascriptkit.com/script/cut183.shtml how do I make it so that when I make a choice with the combbox then the content of the scrollable iframe changes to correspond?
    thanks

  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

    You should use this scrolling content script instead:

    http://www.dynamicdrive.com/dynamici...ramescroll.htm

    you can substitute those cool looking arrows for the up/down words if you like, so it will look exactly the same. Then in that script from JavascriptKit, replace this line:

    Code:
    location=temp.options[temp.selectedIndex].value
    with these lines:

    Code:
    if (document.getElementById)
    document.getElementById('datamain').src=temp.options[temp.selectedIndex].value
    else if (document.all)
    document.all('datamain').src=temp.options[temp.selectedIndex].value
    - John
    ________________________

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

  3. #3
    Join Date
    Apr 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks a lot i'm going to try that but I am not going to be puting an actual page in the frame just text.........can i just upload a .txt file and put the iframe code (that is required from the scipt) at the bottom of the text file?
    OR whatabout just keeping the javascriptkit script for changing conent and making the page into a split frame? would that work better & if so how might i implement that?
    (I really appreciate all of your help)
    Last edited by brent13a; 04-27-2005 at 06:46 PM.

  4. #4
    Join Date
    Apr 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by brent13a
    thanks a lot i'm going to try that but I am not going to be puting an actual page in the frame just text.........can i just upload a .txt file and put the iframe code (that is required from the scipt) at the bottom of the text file?
    OR whatabout just keeping the javascriptkit script for changing conent and making the page into a split frame? would that work better & if so how might i implement that?
    (I really appreciate all of your help)
    I think this script would work best <iframe name="cwindow" style="border:2px solid black" width=150 height=150 src="doc.htm"></iframe> http://www.dynamicdrive.com/dynamici...miniwindow.htm so can i adopt the dropdown boxes be adapted to this script?
    Last edited by brent13a; 04-27-2005 at 07:33 PM.

  5. #5
    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

    Yes, just add id="datamain" to the iframe tag.
    - John
    ________________________

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

  6. #6
    Join Date
    Apr 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    so the frame script would be:
    <iframe id=datamain name="cwindow" style="border:2px solid black" width=150 height=150 src="doc.htm"></iframe>
    and
    I would replace:
    location=temp.options[temp.selectedIndex].value (from: http://javascriptkit.com/script/cut183.shtml )
    with:
    if (document.getElementById)
    document.getElementById('datamain').src=temp.options[temp.selectedIndex].value
    else if (document.all)
    document.all('datamain').src=temp.options[temp.selectedIndex].value

    correct?

    what about thi statement from the iframe script page:
    -Notice the "name=cwindow" attribute inside the above code....you'll need this if you wish to create a link outside the mini window that loads the target url inside the mini-window. For example:
    <a href="minidoc.htm" target="cwindow">

  7. #7
    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

    Yes and, what about it? To elaborate, id="datamain" is more correct than id=datamain but either should work, that part about name="cwindow" is irrelevant to the JavascriptKit script but, will work as promised on the DD demo page for an ordinary link.
    - 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
  •