Coal Powered Puppet said:
Finderski said:
You might be able to cheat by using radio buttons instead...
I'm working at the moment, but will post an example when I can...
Tease...
Absolutely...it's what makes me so darn charming... ;)
HTML:
<div class='sheet-weaponskill'>
<label class="sheet-configlabels" data-i18n="skill">Skill</label>
<div class="sheet-container">
<div class="sheet-child">
<label class="sheet-ddmenu"><input type="radio" class="sheet-select-radio sheet-fighting" name="attr_weaponskill" title="@{repeating_weapons_$#_weaponskill}" value="fighting" checked="checked" /> <span name='attr_rfightingname'></span></label>
<label class="sheet-ddmenu"><input type="radio" class="sheet-select-radio sheet-athletics" name="attr_weaponskill" title="@{repeating_weapons_$#_weaponskill}" value="athletics" /> <span name='attr_rathleticsname'></span></label>
<label class="sheet-ddmenu"><input type="radio" class="sheet-select-radio sheet-shooting" name="attr_weaponskill" title="@{repeating_weapons_$#_weaponskill}" value="shooting" /> <span name='attr_rshootingname'></span></label>
<label class="sheet-ddmenu"><input type="radio" class="sheet-select-radio sheet-unskilled" name="attr_weaponskill" title="@{repeating_weapons_$#_weaponskill}" value="unskilled" /> <span data-i18n='unskilled'>Unskilled</span></label>
<label class="sheet-ddmenu"><input type="radio" class="sheet-select-radio sheet-weirdscience" name="attr_weaponskill" title="@{repeating_weapons_$#_weaponskill}" value="weirdscience" /> <span name='attr_rweirdsciencename'></span></label>
<input type="hidden" class="sheet-select-radio" name="attr_weaponskill" value="fighting" />
<div class="sheet-fighting"><span name='attr_rfightingname'></span></div>
<div class="sheet-athletics"><span name='attr_rathleticsname'></span></div>
<div class="sheet-shooting"><span name='attr_rshootingname'></span></div>
<div class="sheet-unskilled"><span data-i18n='unskilled'>Unskilled</span></div>
<div class="sheet-weirdscience"><span name='attr_rweirdsciencename'></span></div>
</div>
</div>
</div>
CSS:
.sheet-weaponskill {
display: none;
}
.sheet-weapondamage,
.sheet-weaponbutton[value="0"] + .sheet-weaponskill,
.sheet-weaponbutton[value="2"] + .sheet-weaponskill {
display: inline-block;
margin-left: 10px;
}
.sheet-container {
width: 100px;
border-bottom: 1px solid black;
}
.sheet-container,
.sheet-child {
display: inline-block;
}
.sheet-child {
vertical-align: middle;
width: 100px;
height: 28px;
}
.sheet-child label {
display: none;
z-index: 1;
}
.sheet-ddmenu {
font-weight: normal;
font-size: 1em;
width: 95%;
}
.sheet-child:hover {
border-radius: 10px;
background: silver;
position:absolute;
width: 100px;
margin-top: -14px;
height: auto;
z-index: 1;
padding: 5px;
}
.sheet-child:hover label {
display: inline-block;
margin-left: -5px;
}
div.sheet-fighting,
div.sheet-athletics,
div.sheet-shooting,
div.sheet-unskilled,
div.sheet-faith,
div.sheet-focus,
div.sheet-performance,
div.sheet-psionics,
div.sheet-ritual,
div.sheet-spellcasting,
div.sheet-weirdscience {
width: 100px;
height: 28px;
line-height:28px;
color: black;
border-bottom: 1px solid black;
text-align: center;
display: none;
}
.sheet-child:not(:hover) input.sheet-select-radio[value="fighting"] ~ div.sheet-fighting,
.sheet-child:not(:hover) input.sheet-select-radio[value="athletics"] ~ div.sheet-athletics,
.sheet-child:not(:hover) input.sheet-select-radio[value="shooting"] ~ div.sheet-shooting,
.sheet-child:not(:hover) input.sheet-select-radio[value="unskilled"] ~ div.sheet-unskilled,
.sheet-child:not(:hover) input.sheet-select-radio[value="weirdscience"] ~ div.sheet-weirdscience {
display: block;
}
label.sheet-ddmenu:hover {
background-color: orange;
}
.sheet-child:hover > label.sheet-ddmenu > .sheet-select-radio:checked + span {
font-weight: bold;
font-size: 1em;
}
This generates a drop down list of skills I want to display and have the dynamic name displayed in the span. There are a lot of trickier things you could do with this, for example, hide skills the player doesn't have. If you want to see some trickier stuff, look at the Spells/Powers section of the Savage Worlds Tabbed sheet.
The cool thing about this method is, you can also have the "drop down" be horizontal instead of just vertical.