<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" width="400" height="400">
<script type="text/javascript"><![CDATA[
var svgns = "http://www.w3.org/2000/svg";
function MakeObj( TagName, Attributes )
{
var o = document.createElementNS( svgns, TagName );
for( var property in Attributes )
o.setAttributeNS( null, property, Attributes[property] );
return o;
}
function Growth( obj, GrowthHeight )
{
if( !GrowthHeight )
GrowthHeight = 10;
var o_x = obj.x.baseVal.value;
var o_y = obj.y.baseVal.value;
var ay_over = MakeObj( 'animate', {
'attributeType': 'XML',
'attributeName': 'y',
'from': (o_y).toString(),
'to': (o_y - GrowthHeight).toString(),
'dur': '0.5s',
'begin': 'mouseover',
'fill': 'freeze'
} );
obj.appendChild( ay_over );
var ax_over = MakeObj( 'animate', {
'attributeType': 'XML',
'attributeName': 'x',
'from': (o_x).toString(),
'to': (o_x - GrowthHeight).toString(),
'dur': '0.5s',
'begin': 'mouseover',
'fill': 'freeze'
} );
obj.appendChild( ax_over );
var ay_out = MakeObj( 'animate', {
'attributeType': 'XML',
'attributeName': 'y',
'from': (o_y - GrowthHeight).toString(),
'to': (o_y).toString(),
'dur': '0.5s',
'begin': 'mouseout',
'fill': 'freeze'
} );
obj.appendChild( ay_out );
var ax_out = MakeObj( 'animate', {
'attributeType': 'XML',
'attributeName': 'x',
'from': (o_x - GrowthHeight).toString(),
'to': (o_x).toString(),
'dur': '0.5s',
'begin': 'mouseout',
'fill': 'freeze'
} );
obj.appendChild( ax_out );
}
function GrowthMul( objs, GrowthHeight )
{
for( var i = 0; i < objs.length; i++ )
Growth( objs[i], GrowthHeight );
}
]]></script>
<style>
.room {
fill: #ccc;
stroke: #999;
stroke-width: 2;
}
.room:hover {
fill: #c00;
stroke: #d00;
}
</style>
<g transform="translate(200 60)">
<g transform="matrix(1 0 0 0.5773 0 -0.8165)">
<g transform="matrix(0.707 0.707 -0.707 0.707 0 0)">
<rect class="room" x="-50" y="-50" width="50" height="20" />
<path class="room" d="M50 -50 l60 0 0 140 -140 0 0 -60 80 0z" />
<rect class="room" x="120" y="-50" width="100" height="140" />
</g>
</g>
</g>
<script type="text/javascript">GrowthMul( document.getElementsByTagName( 'rect' ) );</script>
</svg>