jquery - SVG text background image problems -
so i'm designing photo frame designer. can find here. want when 1 of patterns (under solid blocks of colour under text design) clicked text on frame changes have background pattern's image. understand svg uses fill attribute , need make pattern. @ minute. want this need able called on click.
here code. can find full code on website though.
<defs> <pattern id="patt1" patternunits="userspaceonuse" width="1246" height="1000"> <image xlink:href="images/pattern1.jpg" x="0" y="0" width="1247" height="751" /> </pattern> </defs> <text class="text" transform="matrix(2.4428 0 0 1.5 624.6 550.5599)" font-family="'comicsansms'" font-size="41.6368">your words here</text>
and
$("#pattern1").click (function() { $('.text').css('fill', 'url(#patt1)'); });
thanks
Comments
Post a Comment