jquery - RaphaelJS scale a path on hover -
i add pop effect when hover on svg path. have tried causes paths fly off past bottom of browser window.
i have read post , attempted compensate coordinate increase failed setup. link
example of path:
var paths = { lakes: { name: 'lakes', value: 'notselected', path: 'm199,606l121,-45l18,60l-32,60l-52,157l-99,-9l-13,-70l-17,8l-22,0l-11,-30l9,-26l61,-45l12,-6l21,-35l4,-19z' },
etc.
and use hover (only hover shown)
obj.hover(function(){ if(paths[arr[this.id]].value == 'notselected') { this.animate({ fill: '#32cd32' }, 300); }
which works fade in chosen colour. first added:
this.animate({transform: 'scale(1.1)'}, 300);
and when spotted path moving bottom tried translate coordinates
this.animate({transform: 'translate(-199,-606)'}, 300);
and still move away. member pointed out paths drawing large y, problem?
(i redraw svg obj.attr(attributes).attr( { transform: "s0.81,0.81,150,-2000" } );
counter y value)`
this example works
http://jsfiddle.net/chrisloughnane/euwrq/
///// below did not work correctly in ie6,8 or 9 /////
i found solution @timmain's post cant-scale-multiple-paths-in-raphael
using scaleraphaƫl , adding
this.tofront(); this.scale(1.2);
so hover now
'obj .hover(function(){ if(paths[arr[this.id]].value == 'notselected') { this.animate({ fill: '#32cd32' }, 300); } this.tofront(); this.scale(1.2);'
i got effect after.
Comments
Post a Comment