Results 1 to 7 of 7

Thread: What is wrong with my code?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2005
    Posts
    131

    What is wrong with my code?

    I have no idea why this doesnt work. Can anyone help?
    VB Code:
    1. <html>
    2. <head>
    3. <script type="text/javascript">self.scrollbars.visible=true; self.scrollTo(0,1000);</script>
    4. </head>
    5. <body>
    6. <p>3443434 </p>
    7. <p>&nbsp;</p>
    8. <p>&nbsp;</p>
    9. <p>&nbsp;</p>
    10. <p>343434434334</p>
    11. <p>&nbsp;</p>
    12. <p>&nbsp;</p>
    13. <p>7667676</p>
    14. <p>&nbsp;</p>
    15. <p>&nbsp;</p>
    16. <p>&nbsp;</p>
    17. <p>98</p>
    18. <p>89989889</p>
    19. <p>898998</p>
    20. <p>2</p>
    21. <p>343435</p>
    22. <p>&nbsp;</p>
    23. <p>543546565</p>
    24. <p>&nbsp;</p>
    25. <p>&nbsp;</p>
    26. <p>&nbsp;</p>
    27. <p>765875787587875</p>
    28. <p>&nbsp;</p>
    29. <p>&nbsp;</p>
    30. <p>&nbsp;</p>
    31. <p>last</p>
    32. </body>
    33. </html>
    Things fall apart which the center cannot hold...

  2. #2
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    Re: What is wrong with my code?

    The problem seems to be this bit:

    Code:
    self.scrollbars.visible = true;
    I've never heared of the self.scrollbars.visible property, are you sure it is correct?

    If you try it without that it works fine

    Cheers,

    RyanJ
    My Blog.

    Ryan Jones.

  3. #3
    Addicted Member BIOSTALL's Avatar
    Join Date
    Apr 2005
    Location
    Northampton, UK
    Posts
    180

    Re: What is wrong with my code?

    Shouldn't it be 'document.scrollbars.visible'??

  4. #4
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    Re: What is wrong with my code?

    Quote Originally Posted by BIOSTALL
    Shouldn't it be 'document.scrollbars.visible'??

    I've never heared of that one either.


    See for yourself, type that in here: http://allfreesoftware.helphousehost..._Evaluator.php



    RyanJ
    My Blog.

    Ryan Jones.

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: What is wrong with my code?

    Might be something IE-proprietary.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  6. #6
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: What is wrong with my code?

    Assuming it would scroll there is nothing wrong with it... just that you run it before you have a page to scroll with....?

    You'd need to put it into the Body onLoad='....' bit to run it after the page has finished loading (including images - I think)

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  7. #7
    Fanatic Member
    Join Date
    Jan 2005
    Location
    In front of this pc.
    Posts
    580

    Re: What is wrong with my code?

    Ecniv is correct. You need to provide a function name and then call it either on load or at the end of the html. You can scroll a page but you're going to need to do a parent.scroll(startPoint,endPoint)

    edit-----

    I decided to test my theory on scrolling. Here's some html that will scroll, at least in FireFox.

    HTML Code:
    <html><head>
    <!-- Begin
    function scrollit() {
    for (I=1; I<=750; I++){
    parent.scroll(1,I)
       }
    }
    // End -->
    </SCRIPT>
    </head><BODY><CENTER><FORM><input type=button value="Scroll Page" onClick="scrollit()"></FORM></CENTER>
    <!-- Script Size:  0.83 KB  -->
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    <p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;<p>&nbsp;
    </html>
    Last edited by anotherVBnewbie; May 18th, 2005 at 07:07 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width