Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 在DIV和don中调整SVG的大小';t保持纵横比_Html_Svg_Resize_Jquery Ui Resizable - Fatal编程技术网

Html 在DIV和don中调整SVG的大小';t保持纵横比

Html 在DIV和don中调整SVG的大小';t保持纵横比,html,svg,resize,jquery-ui-resizable,Html,Svg,Resize,Jquery Ui Resizable,如何通过jQuery UI调整DIV中SVG图像的大小?我想调整DIV的大小,但不在此DIV中保留SVG图像的纵横比 HTML 将preserveAspectRatio=“none”添加到元素,例如 <svg style="width:100%; height:100%; " version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"

如何通过jQuery UI调整DIV中SVG图像的大小?我想调整DIV的大小,但不在此DIV中保留SVG图像的纵横比

HTML

将preserveAspectRatio=“none”添加到
元素,例如

<svg style="width:100%; height:100%; " version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="340.156px" height="340.152px" viewBox="0 0 340.156 340.152" preserveAspectRatio="none" enable-background="new 0 0 340.156 340.152" xml:space="preserve">

您可能还需要将
位置:相对
添加到父容器中,以使SVG工作
高度:100%
$('div').resizable();
<svg style="width:100%; height:100%; " version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="340.156px" height="340.152px" viewBox="0 0 340.156 340.152" preserveAspectRatio="none" enable-background="new 0 0 340.156 340.152" xml:space="preserve">