Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Script Workers] Button activated script

Is there any way to have a script worker activate on a button press?
1493435508
Diana P
Pro
Sheet Author
I use check boxes to activate them (just looking for the change).  You could use a check box and then style it to look more like a button maybe?
Diana P said: I use check boxes to activate them (just looking for the change).  You could use a check box and then style it to look more like a button maybe? I'm sorry, I'm really basic on manipulating html still, could you provide a simple example of a checkbox looking like a button?
1493442490
Diana P
Pro
Sheet Author
I'm not the best person to give an example like that since I only do fairly basic html/css as well.  here's one I use: sample html snippet: <input type="checkbox" class="sheet-diamond" title="someclick" name="attr_someclick" value="1" /><span style="text-align: left;">Something to click </span> css: /* -----------------------Skinned checkbox for ◆/◇ toggles----------------------- */ /* Hide actual checkbox */ input.sheet-diamond[type="checkbox"]{     opacity: 0;     width: 16px;     height: 16px;     position: relative;     top: 5px;     left: 6px;     margin: -10px;     cursor: pointer;     z-index: 1; } /* Fake checkbox */ input.sheet-diamond[type="checkbox"] + span::before{     margin-right: 4px;     line-height: 14px;     text-align: center;     display: inline-block;     vertical-align: middle;          content: "◇";     width: 14px;     height: 14px;     font-size: 12px; } input.sheet-diamond[type="checkbox"]:checked + span::before { content: "◆"; } I know they can get a lot fancier and/or more complex but you might have to poke around some of the other character sheet templates on github for good examples.
1493469310
chris b.
Pro
Sheet Author
API Scripter
Check out the "CSS Wizardry" thread for similar examples