Fandom

Wikia Developers Wiki

BackToTopArrow

915pages on
this wiki
Add New Page
Talk1 Share

This is an tweaked version of the BackToTopButton. This version will take less space and will better fit lay-out sided.

Description

If it happens way too often to scroll back to the top of a long page after having reached the bottom of it, this script will save you the scrolling.

It adds an arrow to the right corner of the Oasis footer that takes you back to the top of the page when pressed.

Installation

To add it put this line in your global.js page, if you want it for personal use, or in MediaWiki:ImportJS, if you want it for site wide use.

dev:BackToTopArrow/code.js

Black Version

To use the alternative black arrow version. Use this code:

dev:BackToTopArrow/black.js

Customization

If you want to adjust the speed of the scroll up or the amount of scroll down you have to do for the button to appear and a bunch of other options, add the following lines before importing the script (for global.js) or to your community's Wikia.js page.

Scroll Speed

To adjust scroll speed add this:

window.BackToTopSpeed = number;

Where number is the speed, in milliseconds. Higher numbers result in slower scrolling and smaller numbers result in faster scrolling. Default value is 600.

Button Appearance

To adjust the "depth" you have to reach for the button to appear/disappear add this:

window.BackToTopStart = number;

Where number is distance down the page, in pixels, before the button appears. Higher numbers will make you scroll down further before the button appears. Default value is 800.

Disable Button's Fade In/Out Effect

To disable the fade effect add this:

window.BackToTopFade = 0;

To re-enable the effect simply remove this line from your JS page. The fade In/Out effect for the button is On by default.

Advance fix

If your text on your toolbar is another color than black or white. An arrow color fix can be made on request. Please contact Jens Ingels for more info.

Wiki coding alternative

You can create this effect similar by using sections links. For example, you could add an section tag above an infobox and add the section link add the bottom of your page. This script however appears on your footer making it possible to always click on it since the footer scroll with you.

Suggestions

  • The click area is currently an bit small. The image need to be an little bit bigger (transparent sided)
  • Hoverbackground when you rest with your mouse on it.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.