Replace image element in svg dynamically

CEDfleffitDib

New Member
I would like to replace an image element of svg tag. I want that every call to an object which holds the image in controller.js, i will take this image and represent this image as a blur background image by svg in different file called default.js.how should i do it?default.html :\[code\]<div id="backgroundImage"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <filter id="myGaussianBlur" x="0" y="0"> <feGaussianBlur in="SourceGraphic" stdDeviation="2"></feGaussianBlur> </filter> </defs> <image id="backImage" xlink:href="http://stackoverflow.com/questions/12767436/surf.jpg" width="100%" height="100%" preserveAspectRatio="none" filter="url(#myGaussianBlur)" /> </svg> </div> \[/code\]I would like to replace the image in image id ="backImage" in other image.Controller.js:\[code\]function setObject(element, value) { var id = value.id; var image = value.image; ????}\[/code\]Thanks
 
Back
Top