/    Sign up×
Community /Pin to ProfileBookmark

Help me remove ScrolltoTop on page refresh/load?

I am a javascript beginner, and I think I know what to look for when removing a ScrolltoTop function, but the search returns a large amount of instances within the script files, and I don’t even know where to begin. So could somebody please help tell me how I can disable the page from scrolling to the top on a page load? What I’m editing by the way is a mobile layout for my SMF forum, and here are the three javascript files within the theme:

[url]http://www.immatureandpopular.com/Themes/mobile/scripts/compiled.js[/url]
[url]http://www.immatureandpopular.com/Themes/mobile/scripts/jquery.js[/url]
[url]http://www.immatureandpopular.com/Themes/mobile/scripts/jquery.mobile.js[/url]

Any help is greatly appreciated. Thank you.

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@ZABISep 24.2012 — what is the problem you are actually facing ? and problem occurs on just mobile or desktop or both ?
Copy linkTweet thisAlerts:
@ocmdiaz714authorSep 24.2012 — what is the problem you are actually facing ? and problem occurs on just mobile or desktop or both ?[/QUOTE]

Well, the theme is for my SMF forum. The problem only occurs in the mobile theme as the scroll code is included in the theme's scripts. And what happens is that whenever I scroll to the bottom of the page before the site loads, I am automatically taken back to the top once the site finishes loading. And this can become quite annoying. For example, if I click on a link that would take me to the latest reply on a thread, I am taken there, but as soon as the page finishes loading I'm taken to the top.

Take a look for yourself, if you don't mind:

http://www.immatureandpopular.com/index.php?theme=7

Scroll to the bottom before the site finishes loading.
Copy linkTweet thisAlerts:
@ZABISep 25.2012 — HMmmmm, i had a quick look on your code, but did'nt find any statement causing the problem, try removing scripts one by one, maybe you find something
Copy linkTweet thisAlerts:
@ocmdiaz714authorSep 26.2012 — There is over 50 instances of the scrolltotop function in one of the scripts. I don't know what I'm doing and I do not want to break anything. If anybody is willing to fix it for me, I'll give you full FTP access, and I am willing to pay. Thank you.
×

Success!

Help @ocmdiaz714 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.18,
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,
)...