Following a request to change the class of a text box in a post in the Pano2VR General forum I give this a bit of thought and spoke with Christoph Gnome.
This is a skin project so posted here in the Skins forum.
We have come up with this project that uses the Go To URL action with a JavaScrip call that finds the text box, then removes the current class and then replaces it with a different class from the CSS stylesheet.
As an example in the attached project, in the skin, there is a text box with the ID Title.
The button with the ID Button Zhi Mang Xing has an action to change the class in the text box which is:
The URL has the Javascript:
Code: Select all
javascript: skin.findElements('Title')[0].classList.remove('font1', 'font2', 'font3', 'font4', 'font5');
skin.findElements('Title')[0].classList.add('font1');
The next part of the JavaScript then finds the text box Title and adds the class 'font1'.
You will see in the buttons that change the class you need a call for each text box.
The good news is you can type out the JavaScript call for one text box then just copy and paste it changing the text box that needs the class to be changed.
For the Button, Button Zhi Mang Xing the URL is:
Note you only need the text javascript: at the start of the code.
This will then remove any classes from the text boxes with the ID's: Title, Description, Author, Date, Copyright, Source.
Then it will set the class font1 to all the text boxes.
Just to add a bit more wow to this I add two more actions to the buttons that change the class, on mouse enter and leave they change the class for themselves and also using a colour logic block to invert the colour of the buttons.
I hope this gives you a bit more inspiration.
Regards,
Hopki