How would you do this ?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
gogelpot
Forum Newbie
Posts: 2
Joined: Mon Aug 17, 2009 1:16 am

How would you do this ?

Post by gogelpot »

Hi

I have a webpage with a ifram called "main". When I click a link on the webpage a page is loaded into the "main" ifram. This page called "search" is a page where the viewer will enter info needed for a search in a DB. The result is then displayed in a new iframe on the search page .

The problem is that the link that is clicked on to open the search page is down the bottom of the page and when clicked it opens the search page but the viewer cant see the changes exept if they scrole to the top of the webpage.

Is there a way to automatically scrole the webpage to the top after opening the search page.
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: How would you do this ?

Post by jackpf »

Code: Select all

window.scrollBy(0, 0);
should do it.
Post Reply