LoginSignup
1
0

More than 5 years have passed since last update.

Rapahel の枠のサイズを変更

Last updated at Posted at 2012-12-26

外枠だけの変更でよければ、

var paper = Rapahel('container', 300, 300);

な場合、以下のようにすればいいようです。SVG の時と VML の時で処理を分けます。

var w = 500
  , h = 500
  , $paperChild = $('#container').children().attr({ width: w, height: h })
;

if (Raphael.type === 'SVG') {
  $paperChild.attr('viewBox', [0, 0, w, h].join(' '));
} else {
  $paperChild.css('overflow', 'visible');
}

内容も一緒にスケールする方法は、以下のリンクで議論されています。

javascript - Scaling SVG (Raphael.js) like an SWF - Stack Overflow

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0