Horizontal anchor scrolling

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
Watch

NORRITT

New Member
Impact
0
Hello,

I want to let my website scroll horizontal, if someone clicks an anchor. But unfortunatly the "classic" anchor-scrolldown funktion does only work in the vertical way (like you can see on every wiki-page for example). But I could not find any way to let it scroll horizontal.

Do you have any ideas or solutions to do so?

thanks!
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
First you need to create a layout that stretches out horizontally. Just make sure you know where the elements are placed (exact coordinates), and then you can scroll anywhere with JavaScript.
 
0
Close
hi mch!
yes, my layout is css based and extends about 3000px horizontally.

can you tell me where such a javascript could be found? Unfortunatly I have no such skills right now.
 
0
Close
Code:
<a href="javascript:scroll(100,0)">Scroll right 100px</a>
The 100 is the horizontal offset. I don't know if it's always from the very left or from the current position. The 0 is the vertical point.
 
0
Close
"In JavaScript 1.2, scroll is no longer used and has been replaced by scrollTo."

You have two methods you can use:

window.scrollBy(horizontal, vertical)
Scrolls the viewing area of a window by the specified amount.

window.scrollTo(x-coordinate, y-coordinate)
Scrolls the viewing area of a window so that the specified point becomes the top-left corner.
 
0
Close
thank you for the replys! I will try that.

have a great day.
 
0
Close
Appraise.net

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back