Neocities.org

BMH Online

bmh.neocities.org

485,141 views
254 followers
4,212 updates
0 tips
Does anyone know how we can load our 88x31 buttons in a random order? In particular, ones that are clickable... and assuming only a little coding experience!
1 like
freckleskies 2 years ago

you could keep a txt file with the names of all the buttons you have (or even with the whole "" strings to simplify the script down the line), read that file everytime the button page loads, split the strings into an array, shuffle it like you would any array and then append them one by one in the button container element

saint-images 2 years ago

I rooted around a bit trying to shuffle the existing elements on your buttons page, but it doesn't really work because of the arbitrary whitespace elements. Another solution would be to generate the buttons on the fly from the list of links/images with JS, but it's a bit more work. LMK if you would like me to do that for you ψ(._. )>

2 likes
1 like
bmh 2 years ago

@freckleskies brilliant, thank you! That's pretty much what I want; I'll have a play around with that ASAP.

1 like
bmh 2 years ago

@saint-images How did you know I was talking about MY buttons page?! *looks shifty* I quite like the space between the buttons! Hopefully I can keep it ;-)

1 like

Website Stats

Last updated 1 day ago
CreatedJun 16, 2020
Site Traffic Stats

Tags

webcam blog electronics computers photography