Neocities.org

BMH Online

bmh.neocities.org

398,605 views
218 followers
3,885 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 1 year 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 1 year 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 1 year ago

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

1 like
bmh 1 year 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 6 days ago
CreatedJun 16, 2020
Site Traffic Stats

Tags

webcam blog electronics computers photography