/    Sign up×
Community /Pin to ProfileBookmark

Hi i have a page that is scrolling when you rollOver a layer. Works great! The page is also looping so when you come to the end of the page it returns to the beginning. This is what I made up to know: [URL=http://www.jeugdwerkrozenoord.nl/Testscript/]Link to website[/URL]. When you go over the green blocks the page wil scroll when you see a little cyan smallen the page till you only see green. Now the loop works as well.

The only problem I have is that the page starts in the bottom at the right and I want it to begin at the top at the left. What can I do about it. This is the script:

[code=php]
<script language=”JavaScript1.2″>
var currentposY=1
var currentposX=1
setInterval(“scrollwindow()”,1)

function scrollwindow(){
currentposY=document.body.scrollTop
currentposX=document.body.scrollLeft

if (currentposY > 1693){
currentposY = 1
window.scroll(currentposX,currentposY)
}

if (currentposY == 0){
currentposY = 1693
window.scroll(currentposX,currentposY)
}

if (currentposX > 3021){
currentposX = 1
window.scroll(currentposX,currentposY)
}

if (currentposX==0){
currentposX = 3021
window.scroll(currentposX,currentposY)
}
}
</script>

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@Mr_JNov 19.2004 — Comment out this line and give it a try

setInterval("scrollwindow()",1)
Copy linkTweet thisAlerts:
@zebdaagauthorNov 23.2004 — I need the setInterval to loop the page. The problem is that de page starts at x=0 and y =0 and in the javascript there stands that when the x and y are 0 go to x 3000 and y 2000 or something like that. I want my page to not start at x=0 and y =0 but at x=1 and y=1 this will do the trick but I don't know how i tried it this way:

document.body.scrollTop=1

document.body.scrollLeft=1

but this doesn't work..does someone have any idea??

Thanks..
×

Success!

Help @zebdaag 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.21,
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,
)...