SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict Garrett's Avatar
    Join Date
    Feb 2001
    Location
    England
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hello

    got this script that scrolls (well jumps actually) to the extreme right of a wide page as soon as the page loads

    so in my onload i have

    onload="javascript:start()"

    and the script called is the following

    function start()
    {
    parent.frames["left"].scroll(2992,0);
    }

    very simple, works fine in Explorer, but no go in netscape, i know the scroll works because i have buttons that scroll to certan parts of the page and they work fine, so cant figure it out whether its the onload or what?

    if anyone has any ideas please let me know

    Sincerely
    Garrett Lynch
    http://www.asquare.org/

  2. #2
    I believe you have my stapler. scrubz's Avatar
    Join Date
    Feb 2001
    Location
    Van down by the river
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Two suggestions (although untested):

    1) Use document.parent.frames instead of just parent.frames -
    Netscape can be picky about this.

    2) Instead of using an onLoad, call the script just before you close your </html> tag...

    <script language="JavaScript">
    <!--
    start();
    // -->
    </script>

    </html>

  3. #3
    SitePoint Addict Garrett's Avatar
    Join Date
    Feb 2001
    Location
    England
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    different positions

    no nether made any difference

    i tried the scroller again and discovered it is actually jumping to the position however in netscape the position is not at all the same one as in explorer

    for example in netscape
    parent.frames["left"].scroll(2620,0);
    works

    however in explorer
    parent.frames["left"].scroll(2992,0);
    is the same position

    makes no sense, dont want to have to script around each browser, cos i'm sure its going to be different again in nestscape 6 and i need to get it working in icab too.

    so if you have an idea whay its doing this let me know as i'm stuck

    later
    Garrett Lynch

  4. #4
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this could be just the way you typed it, and I doubt that it is causign this effect, but javascript needs to be all one word.

    You have:

    onload="java script:start()"

    and it should be:

    onload="javascript:start()"
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  5. #5
    SitePoint Addict Garrett's Avatar
    Join Date
    Feb 2001
    Location
    England
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    mmm yep thats very confusing you've typed exactly the same thing twice! but yes i know what you mean and that was just my typo at the start, no its not that cos as i said it works just the huge difference in the jump to point well read my last post because i said all there

    later
    Garrett Lynch

  6. #6
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ah...I just rememberd. Sitepoint breaks up the word javascript when it begins with an even handler to prevent hacking...

    so I could do this:

    javascript

    and it should not have a space. But when I do this:

    onload="javascript:SomeFunction();"

    it will put a space in the word javascript.

    Pretty clever SitePoint guys.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes


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
  •