Results 1 to 4 of 4

Thread: Goto a location on the WebPage without scrolling

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Location
    India
    Posts
    11

    Goto a location on the WebPage without scrolling

    I have a hyperlink to UPDATE the contents of my Web page. Upon click of the UPDATE link, i'm submitting the page to do the db update at the server end.

    Everytime i click Update the webpage gets scrolled to the top. I need to hold the page exactly at the same point after the Update process.

    I understand that this is possible by using...
    <a href="#C4">Click here to Goto Para-4</a>
    <a name="C4"><h2>Para-4</h2></a>

    But this would require user intervention to goto that location in my page.

    But i want to make it all happen when i click on Update and submit the page.

    Is there a way, that after the page is being posted to directly goto a location in the page.

    Please let know !

  2. #2
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724
    Javascript
    Code:
    function moveToHash(hashName) {
        window.location.hash = hashName;
    }
    
    moveToHash("C4");

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Location
    India
    Posts
    11
    Thanks! axion_sa

    It worked !!!

  4. #4
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267
    that a cool bit of code
    Magiaus

    If I helped give me some points.

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