| 塗り 塗りのレッスンに戻る <script language="JavaScript1.2"> <!-- /* * Other parts required but not shown here: * In the HTML file, each of the form tags contain one of the following * attributes: * * onsubmit="set_stroke_opacity(); return false;" * onsubmit="set_fill_opacity(); return false;" * onsubmit="set_opacity(); return false;" * * And the input type=button tag in the forms each contain one of the following * attributes: * * onclick="set_stroke_opacity()" * onclick="set_fill_opacity()" * onclick="set_opacity()" */ /* * This function sets the fill-opacity property of the * "gradient_star" SVG element according to the value entered in the * form. */ function set_fill_opacity () { var svgobj; var svgstyle; var svgdoc = document.opacity.getSVGDocument(); svgobj = svgdoc.getElementById('gradient_star'); svgstyle = svgobj.getStyle(); svgstyle.setProperty ("fill-opacity", document.fill_opacity.val.value); } /* * This function sets the stroke-opacity property of the * "gradient_star" SVG element according to the value entered in the * form. */ function set_stroke_opacity () { var svgobj; var svgstyle; var svgdoc = document.opacity.getSVGDocument(); svgobj = svgdoc.getElementById('gradient_star'); svgstyle = svgobj.getStyle(); svgstyle.setProperty ("stroke-opacity", document.stroke_opacity.val.value); } /* * This function sets the opacity property of the * "gradient_star" SVG element according to the value entered in the * form. */ function set_opacity () { var svgobj; var svgstyle; var svgdoc = document.opacity.getSVGDocument(); svgobj = svgdoc.getElementById('gradient_star'); svgstyle = svgobj.getStyle(); svgstyle.setProperty ("opacity", document.opacity.val.value); } // --> </script> 塗りのレッスンに戻る |