Click to See Complete Forum and Search --> : capturing the page position while moving to the next page


Patail
01-16-2003, 12:30 AM
Hi,
I need one information. What i want to do is- when I scroll down a page to the bottom, i have got a thumbnail image which is a link. So when i click on the thumbnail image, a popup comes up with the enlarged image of the thumbnail image.

But now the problem is, when i click on the thumbnail image, the popup comes up but then immediately the page which has the thumbnail image scrolls to the top automatically and sits at the beginning of the page. Because of this, if i have to go to another thumbnail image besides the old one which i clicked now, again i need to scroll down to the bottom of the page. This is a tedious job.

I just want to know- how to avoid the trouble. Actually you can use the history object in the Javascript to go to the same position in the previous page but i am confused which object to call to get to the same position on the same page.

Anyone here to help me out.

Thanks

gil davis
01-16-2003, 05:27 AM
Originally posted by Patail
when i click on the thumbnail image, the popup comes up but then immediately the page which has the thumbnail image scrolls to the top automatically and sits at the beginning of the page.Add ";return false" to the "onclick" event:

< ... onclick="...;return false" ...>

Charles
01-16-2003, 05:36 AM
Originally posted by gil davis
Add ";return false" to the "onclick" event:

< ... onclick="...;return false" ...> That will solve your problem but leave you with another, simply corrected, problem. Use:

<a href="http://www.bettiepage.com/images/photos/whip/whip7.jpg" onclick="window.open(this.href,'','height=350,width=250'); return false"><img alt="[Bettie With a Whip]" src="http://www.bettiepage.com/images/photos/whip/whip7_a.jpg"></a>

Patail
01-16-2003, 05:27 PM
Thanks for your help Gil. It really worked. I appreciate your help in this.
Bye

Patail
01-16-2003, 05:30 PM
Thanks Dave and Clark for your help too. I have fixed the problem.
Bye