News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

How to style Javascript buttons?

Started by Doctor Asp, November 16, 2021, 07:13:52 AM

Previous topic - Next topic

Doctor Asp

You cannot view this attachment.
I need to add class="MyButton" to the two unstyled buttons "Delete" and "Insert" in the screendump.
The buttons are created in Javascript and I can´t find a way to style them.
/Doctor Asp

Doctor Asp

Quote from: Doctor Asp on November 16, 2021, 07:13:52 AMYou cannot view this attachment.
I need to add class="MyButton" to the two unstyled buttons "Delete" and "Insert" in the screendump.
The buttons are created in Javascript and I can´t find a way to style them.

After some Sherlock Holmes investigation, I found a file named "smf_fileUpload.js" (It´s not easy to search for the word "button"...). In that file I found the two js functions that creates the buttons - with a parameter named addClass. After changing the classname to MyClass it worked! I even managed to change the order of the buttons. Mission accomplished. ;-)
You cannot view this attachment.
/Doctor Asp

Advertisement: