SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    sweden
    Posts
    646
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Where to put the code when using frames?

    I don't know anything at all about JavaScript, but found a code for scrolling a text inside a layer (using Dreamweaver by the way).

    I'm helping an old friend to make his personal web page and he wants a list that people should be able to scroll through by using two arrows on top of it.
    When the click on one of the text parts a new page will load.

    I was beginning to make the site with css without frames, but then I realized that if someone click on a link in the scroll layer, then I need to use frames instead, so that the scroll is staying where it was, while loading a new page in another frame.

    So, what I have now is a frameset page. Inside that I have a main area on the left, a scroll area on the right (with a layer part for the scroll). On top of that (in the same area) I have the arrows for the scroll.
    And in the bottom area I have a navigation.

    When I started with the code I found, it worked fine on a simple page, but when I now will usse the code in a framset, then it won't work.
    I guess I need to put the code in different areas to make it work.

    So, where should I put the JavaScript? In which head tag of my documents?
    Should it be in the same HEAD as the page where I have the scroll?
    Or should that be in the frameset pages HEAD part?

    The code I found started with
    Code:
    <body onLoad="InitialiseScrollableArea();">
    inside the div tag.
    Maybe that's why the code isn't working?

    Any ideas?

  2. #2
    SitePoint Wizard chris_fuel's Avatar
    Join Date
    May 2006
    Location
    Ventura, CA
    Posts
    2,750
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In a frame environment, javascript location shouldn't matter, because you have a bunch of dom related functionality to get child/parent/self frames to reference. The only thing you need to worry about is that the frames all exist in the same subdomain and domain. If not, programs will deny the dom manipulation access to prevent nasty javascript exploits.

  3. #3
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    sweden
    Posts
    646
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Don't know what it was, but I copied the working page all over again to the new frame... and it works. Something must have happened on the way.

    Thanx anyway.


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
  •