Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.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

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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.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
Css 将Raphael SVG纸张绝对定位到容器div_Css_Svg_Raphael - Fatal编程技术网

Css 将Raphael SVG纸张绝对定位到容器div

Css 将Raphael SVG纸张绝对定位到容器div,css,svg,raphael,Css,Svg,Raphael,有没有办法使拉斐尔纸对象相对于它所在的div是绝对的?这样就完全填满了div?由于我使用的纸张是相对于其div的,所以在调整窗口大小的过程中,我遇到了鼠标位置问题以及其他问题 如果您也在使用jquery,那么每次调整窗口大小时,您都可以调整raphael纸张的大小。您可以使用raphael的jqueryresize(),然后使用raphael的setSize() $( window ).resize(function() { //get the size of your

有没有办法使拉斐尔纸对象相对于它所在的div是绝对的?这样就完全填满了div?由于我使用的纸张是相对于其div的,所以在调整窗口大小的过程中,我遇到了鼠标位置问题以及其他问题

如果您也在使用jquery,那么每次调整窗口大小时,您都可以调整raphael纸张的大小。您可以使用raphael的jquery
resize()
,然后使用raphael的
setSize()

$( window ).resize(function() {   

        //get the size of your container div
        var div_width = $("#containerDiv").width();
        var div_height = $("#containerDiv").height();

        paper.setSize(div_width, div_height);
});

不知道这个答案是否有用。。