#Jump to top button assistance

27 messages · Page 1 of 1 (latest)

winged wagon
#

As the title states. I've figured out how to add a clickable button, how to actually make it jump to the top, and some basic styling for what I want the button to look like, but I looked at the JS aspect and immediately got stuck lol. I imagine I'd need to put the styling of the button and the button itself in a template? But I'm not sure how to make the JS detect only that button and not, like, every other button on my wiki. I'd like it to only show up on scroll, and I found a guide/template on how to implement that JS wise, but putting it all together is going over my head quite a bit.

Also, is there a way to globally add the button? I don't see how right now because that seems like an HTML thing, which as far as I'm aware, I can't do unless I use a template. I'd just like the button to be always there without needing to copy paste the button template on every page.

winged cradle
#

right in js I mean

#

wdym by globally tho?

#

in my case, being in Common.js means that it's visible on all pages of wiki when their length exceeds screen size

#

no matter which skin is used (although I allowed only Timeless and old Vector)

winged wagon
#

globally as in the button automatically appears on every page without having to put the template on every single page :P

winged cradle
#

then I guess my way will work for you

#

via Common.js

#

you can test it in personal js too

#

User:.../common.js

winged wagon
#

yeah lemme try that

#

it appears. to have done nothing? squint

#

button is not showing up

winged cradle
#

can you link?

winged wagon
winged cradle
#

user css/js needs to start w/ small letter

winged wagon
#

o

winged cradle
#

lower case I mean

winged wagon
#

whoops

winged cradle
#

not capital

#

try to move it

#

/common.js

winged wagon
#

oh there it is

#

oh i like how it pops up

#

this should work, thank you!