September 25, 2022, 12:49:26 pm
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to Revolution X, where Coding meets Graphics.
 
  Home Help Search Arcade Affiliates Staff List Calendar Members Login Register  

Scroll Up In Topics

Pages: [1]   Go Down
  Print  
Author Topic: Scroll Up In Topics  (Read 500 times)
Vitality
Exclusive
Exclusive
Offline Offline

Gender: Male
Posts: 154



View Profile
Badges: (View All)
« on: November 27, 2008, 10:53:32 pm »

A simple script that will place a link next to your report to a moderator link, and when it is clicked, it will scroll to the top of the page. I found scrolling back up to read previous posts on certain pages to be a bit tedious, so I wrote this up really quickly.
Code:
<script>
/*Vitality of TCZ || smfsupport || Revolution X*/
if(location.href.match('topic,')){
$("a:contains('Report to moderator')").after(" <a href='javascript:window.scrollTo(0,0);'>Go Up</a>");
}
</script>
Enjoy!
« Last Edit: November 28, 2008, 10:02:43 pm by Vitality » Report Spam   Logged


CODE

Share on Facebook Share on Twitter

Agent Moose
Administrator
Adminitrator
Offline Offline

Gender: Male
Posts: 1,470



View Profile WWW
Badges: (View All)
« Reply #1 on: November 28, 2008, 09:39:19 am »

Nice code  Grin
You could make it shorter though Wink
Code:
<script>
/*Vitality of TCZ || smfsupport || Revolution X*/
if(location.href.match('topic,')){
$("a:contains('Report to moderator')").after(" <a href='javascript:window.scrollTo(0,0);'>Go Up</a>");
}
</script>
Report Spam   Logged


Vitality
Exclusive
Exclusive
Offline Offline

Gender: Male
Posts: 154



View Profile
Badges: (View All)
« Reply #2 on: November 28, 2008, 10:02:55 pm »

Thanks for that Moose!
Report Spam   Logged


CODE
Mojobojo82
MVP
MVP
Offline Offline

Gender: Male
Posts: 838


View Profile
Badges: (View All)
« Reply #3 on: June 22, 2009, 03:53:11 am »

Pretty cool code.

And lol @ Moose. I can't even see difference Tongue
Report Spam   Logged






Exilis
Optimistic & Creative
Global Moderator
Global Moderator
Offline Offline

Posts: 929


View Profile
Badges: (View All)
« Reply #4 on: June 22, 2009, 06:34:34 am »

Vitality edited his first post, the original script was longer.
Report Spam   Logged

Global Mod, (sort of) at your service.

http://twitter.com/timothyaveni

Mojobojo82
MVP
MVP
Offline Offline

Gender: Male
Posts: 838


View Profile
Badges: (View All)
« Reply #5 on: June 22, 2009, 06:44:21 am »

Ahh, Yes okay Tongue Sorry im very St00pid
Report Spam   Logged






Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy