- Timestamp:
- 2015-03-11T10:12:30+13:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/nz-flag-design/trunk/main-form/choose-canvas.html
r29740 r29773 32 32 <p>If you hover the mouse over a flag size, you will be able to see some countries that currently use that ratio!</p> 33 33 <div class="centredDiv"> 34 <div class="ratioDiv flagHover" id="ratio23" onclick="updateCanvasDimen tions(2, 3)" title="2:3"></div>35 <div class="ratioDiv" id="ratio12" onclick="updateCanvasDimentions(1, 2)" title="1:2"></div>36 <div class="ratioDiv" id="ratio35" onclick="updateCanvasDimen tions(3, 5)" title="3:5"></div>34 <div class="ratioDiv flagHover" id="ratio23" onclick="updateCanvasDimensions(2, 3)" title="2:3"></div> 35 <div class="ratioDiv" style="border-width:2px;" id="ratio12" onclick="updateCanvasDimensions(1, 2)" title="1:2"></div> 36 <div class="ratioDiv" id="ratio35" onclick="updateCanvasDimensions(3, 5)" title="3:5"></div> 37 37 <div style="clear: both"></div> 38 38 </div> … … 40 40 41 41 <div class="centredDiv"> 42 <div class="ratioDiv" id="ratio1019" onclick="updateCanvasDimen tions(10, 19)" title="10:19"></div>43 <div class="ratioDiv" id="ratio58" onclick="updateCanvasDimen tions(5, 8)" title="5:8"></div>44 <div class="ratioDiv" id="ratio811" onclick="updateCanvasDimen tions(8, 11)" title="8:11"></div>42 <div class="ratioDiv" id="ratio1019" onclick="updateCanvasDimensions(10, 19)" title="10:19"></div> 43 <div class="ratioDiv" id="ratio58" onclick="updateCanvasDimensions(5, 8)" title="5:8"></div> 44 <div class="ratioDiv" id="ratio811" onclick="updateCanvasDimensions(8, 11)" title="8:11"></div> 45 45 <div style="clear: both"></div> 46 46 </div> … … 52 52 var currentRatio = "ratio12"; 53 53 54 function updateCanvasDimen tions(height, width) {54 function updateCanvasDimensions(height, width) { 55 55 // Show feedback by highlighting the chosen square 56 56 document.getElementById(currentRatio).style.borderColor = 'black'; 57 document.getElementById(currentRatio).style.borderWidth = '1px'; 57 58 currentRatio = "ratio" + height + width; 58 59 document.getElementById(currentRatio).style.borderColor = 'white'; 60 document.getElementById(currentRatio).style.borderWidth = '2px'; 59 61 60 var design_frame = document.getElementById('design-2d-iframe');61 var svgCanvas = design_frame.contentWindow.svgCanvas;62 63 // Changing the value of sizeConstant will change the size of the svg canvas without affecting the width/height ratios 64 62 // Changing the value of sizeConstant will change the 63 // size of the svg canvas without affecting the 64 // width/height ratios 65 66 var sizeConstant = 400; 65 67 66 68 var h = sizeConstant; 67 69 var w = (sizeConstant / height) * width; 68 69 flagCanvasSettings.width = w; 70 flagCanvasSettings.height = h; 71 72 // Set the new canvas size 73 svgCanvas.setResolution(w, h); 70 71 if (typeof flagCanvasSettings !== 'undefined') { 72 flagCanvasSettings.width = w; 73 flagCanvasSettings.height = h; 74 } 74 75 } 75 76 </script>
Note:
See TracChangeset
for help on using the changeset viewer.