|
107 | 107 | .container1 .sub {
|
108 | 108 | font-variant-position: sub;
|
109 | 109 | }
|
| 110 | + .inactive .container1 * { |
| 111 | + font-variant-position: normal; |
| 112 | + } |
110 | 113 | </style>
|
111 | 114 | <style class="editable2">
|
112 | 115 | /* 'subs', 'sups; */
|
|
116 | 119 | .container2 .sub {
|
117 | 120 | font-feature-settings: 'subs' 1;
|
118 | 121 | }
|
| 122 | + .inactive .container2 * { |
| 123 | + font-feature-settings: 'sups' 0, 'subs' 0; |
| 124 | + } |
119 | 125 | </style>
|
120 | 126 | </head>
|
121 | 127 |
|
|
135 | 141 | .container1 .sub {
|
136 | 142 | font-variant-position: sub;
|
137 | 143 | }
|
| 144 | + .inactive .container1 * { |
| 145 | + font-variant-position: normal; |
| 146 | + } |
138 | 147 | </textarea>
|
139 | 148 | <textarea id="code1" class="playable-html1">
|
140 | 149 | <div class="container container1">
|
141 | 150 | <p>Ups<span class="super">1</span> and downs<span class="sub">2</span></p>
|
142 | 151 | </div>
|
143 | 152 | </textarea>
|
| 153 | +<input type="checkbox" name="demo1_control" id="demo1_control" value="on" checked /> <label for="demo1_control">Position active</label> |
144 | 154 | </div>
|
145 | 155 | <div class="demo2">
|
146 | 156 | <section class="section section2">
|
|
156 | 166 | .container2 .sub {
|
157 | 167 | font-feature-settings: 'subs';
|
158 | 168 | }
|
| 169 | + .inactive .container2 * { |
| 170 | + font-feature-settings: 'sups' 0, 'subs' 0; |
| 171 | + } |
159 | 172 | </textarea>
|
160 | 173 | <textarea id="code2" class="playable-html2">
|
161 | 174 | <div class="container container2">
|
162 | 175 | <p>Ups<span class="super">1</span> and downs<span class="sub">2</span></p>
|
163 | 176 | </div>
|
164 | 177 | </textarea>
|
| 178 | +<input type="checkbox" name="demo2_control" id="demo2_control" value="on" checked /> <label for="demo2_control">Position active</label> |
165 | 179 | </div>
|
166 | 180 | </div>
|
167 | 181 | <div class="playable-buttons">
|
|
183 | 197 | var cssCode1 = textareaCSS1.value;
|
184 | 198 | var htmlCode2 = textareaHTML2.value;
|
185 | 199 | var cssCode2 = textareaCSS2.value;
|
| 200 | + var demo1_active = document.getElementById('demo1_control'); |
| 201 | + var demo2_active = document.getElementById('demo2_control'); |
| 202 | + |
| 203 | + demo1_active.addEventListener('change', function () { |
| 204 | + if (this.checked) { |
| 205 | + this.parentNode.classList.remove('inactive'); |
| 206 | + } else { |
| 207 | + this.parentNode.classList.add('inactive'); |
| 208 | + } |
| 209 | + }); |
| 210 | + |
| 211 | + demo2_active.addEventListener('change', function () { |
| 212 | + if (this.checked) { |
| 213 | + this.parentNode.classList.remove('inactive'); |
| 214 | + } else { |
| 215 | + this.parentNode.classList.add('inactive'); |
| 216 | + } |
| 217 | + }); |
186 | 218 |
|
187 | 219 | function fillCode() {
|
188 | 220 | editable1.innerHTML = textareaCSS1.value;
|
|
196 | 228 | textareaCSS1.value = cssCode1;
|
197 | 229 | textareaHTML2.value = htmlCode2;
|
198 | 230 | textareaCSS2.value = cssCode2;
|
| 231 | + demo1_active.checked = true; |
| 232 | + demo1_active.parentNode.classList.remove('inactive'); |
| 233 | + demo2_active.checked = true; |
| 234 | + demo2_active.parentNode.classList.remove('inactive'); |
199 | 235 | fillCode();
|
200 | 236 | });
|
201 | 237 |
|
|
0 commit comments