Browse Source

attempt at zoom slider

Thomas Buck 4 years ago
parent
commit
c6903d63b4
1 changed files with 13 additions and 0 deletions
  1. 13
    0
      index.html

+ 13
- 0
index.html View File

@@ -150,6 +150,19 @@
150 150
                     div_wrapper2.setAttribute('style', 'overflow-x: auto; overflow-y: auto;');
151 151
                     div_wrapper2.appendChild(div_wrapper);
152 152
 
153
+
154
+                    size_slider = document.createElement('input');
155
+                    size_slider.setAttribute('type', 'range');
156
+                    size_slider.setAttribute('min', window.innerWidth);
157
+                    size_slider.setAttribute('max', Math.ceil(width_px));
158
+                    size_slider.setAttribute('value', Math.ceil(width_px));
159
+                    size_slider.oninput = function() {
160
+                        div_wrapper.setAttribute('style', 'width: ' + Math.ceil(width_px) + 'px;');
161
+                        div_wrapper.style.width = Math.ceil(width_px) + 'px';
162
+                        div_wrapper.width = Math.ceil(width_px);
163
+                    }
164
+                    div.appendChild(size_slider);
165
+
153 166
                     div.appendChild(div_wrapper2);
154 167
                     div.appendChild(document.createElement('hr'));
155 168
 

Loading…
Cancel
Save