/    Sign up×
Community /Pin to ProfileBookmark

On click go to top of the page; how?

Hi guys,

I have this code that needs to be modified.

[CODE]$display .= “<td><a href=”javascript:imgchange(‘$file_name’,'”.addslashes($caption).”‘,'”.addslashes($description).”‘)”> “;
$display .= “<img src=”$config[listings_view_images_path]/$thumb_file_name” height=”$displayheight” width=”$displaywidth” alt=”$caption” /></a>”;
$display .= “</td>”;[/CODE]

When one clicks this image there is another image on the page that changes; but I would like this click to also take the user to the top of the page, where the main image will be.

I have a big image here:

0000000000000000000000
0000000000000000000000
0000000000000000000000
0000000000000000000000
0000000000000000000000
00000000000000000000000

And then thumbnails here:

11111111111111111
22222222222222222
33333333333333333
44444444444444444
55555555555555555
66666666666666666
77777777777777777
88888888888888888
99999999999999999

By the time the user is down here, i want the click to take him up and also change the image. All i’m missing is the up part.

Thanks!

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceMay 06.2006 — window.scrollTo(0,0)
Copy linkTweet thisAlerts:
@metaxlogauthorMay 06.2006 — thanks! that works great. ?, I can even choose how far up to scrool and all.
Copy linkTweet thisAlerts:
@phpnoviceMay 06.2006 — You're welcome.

Cheers.
×

Success!

Help @metaxlog spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...