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


i started using raphael.js few days ago , i'm enjoying it. thing haven't been able figure out how "paper" or svg/vml tag fill browser window swf. see example.

note way above example resizes browser window

i able "paper" resize browser window, no luck getting vector graphics adjust size. feedback appreciated.

edit

i tried bunch of different routes this. viewbox worked great svg only. figured out how using raphael sets , little code on window.onresize event. i'll post findings later tonight or tomorrow. i'd still see other solutions question if there any.

it took me awhile came solution problem. i've wrapped solution in small js file can used raphael. can js file along simple documentation here. see in action.

how works:

  1. use viewbox svg
  2. wrap vml nodes in group node
  3. wrap raphael constructor vml group node passed raphael constructor
  4. alter few css properties when paper resized deal centering, clipping , maintaining correct aspect ratio.

any feedback appreciated.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -