Change Image with Jquery? setElementParameters works with text
D
Dp4
started a topic
almost 8 years ago
How can I replace an initial image with jquery? I was able to change text with fancyProductDesigner.setElementParameters({text:"hello
world"},"title"); however when I try to change image type and change the "source" parameter nothing is changed. Can someone help me understand which parameter I need to change so that the canvas image source is swapped out?
Best Answer
D
Dp4
said
almost 8 years ago
Just to answer my own question, the new image needs to be added as a replacement.
i am have this problem too, fancyProductDesigner.setElementParameters do anithing and don't change image.
p.s.
i try use this for changing boundingbox (transparancy image), for example i need to change boundingbox size on t-shirt print like A5, A4, A3 and change proper price for this format. Change price are work ok, but when i try to change img, nothing happens.
B
Brad
said
over 7 years ago
I am trying to accomplish both of these things you mentioned, but I'm not having any luck. Are you using the Wordpress version?
Would you mind sharing a bit of your code? I've tried using this code in the footer of my site, but it doesn't work:
Dp4
How can I replace an initial image with jquery? I was able to change text with fancyProductDesigner.setElementParameters({text:"hello world"},"title"); however when I try to change image type and change the "source" parameter nothing is changed. Can someone help me understand which parameter I need to change so that the canvas image source is swapped out?
Just to answer my own question, the new image needs to be added as a replacement.
- Oldest First
- Popular
- Newest First
Sorted by Newest FirstMichael Eckebrecht
Ok, I solved the issue myself.
$(this).find('picture').on('click', function(evt) {
var imagePath = $(this).attr("data-img");
if(typeof(yourDesigner.getElementByTitle('NewImage')) !== 'undefined' ) {
yourDesigner.addCustomImage(imagePath, 'NewImage');
}
});
thx.
Michael Eckebrecht
Hello DP4,
have you got simple example for me, how will be work´s?
I try to change the source-parameter in jQuery like this:
$(this).find('picture').on('click', function(evt) {
var imagePath = $(this).attr("data-img");
if(typeof(yourDesigner.getElementByTitle('NewImage')) !== 'undefined' ) {
yourDesigner.replace = imagePath;
}
});
thank´s for up :)
7up
i am have this problem too, fancyProductDesigner.setElementParameters do anithing and don't change image.
p.s.
i try use this for changing boundingbox (transparancy image), for example i need to change boundingbox size on t-shirt print like A5, A4, A3 and change proper price for this format. Change price are work ok, but when i try to change img, nothing happens.
Brad
I am trying to accomplish both of these things you mentioned, but I'm not having any luck. Are you using the Wordpress version?
Would you mind sharing a bit of your code? I've tried using this code in the footer of my site, but it doesn't work:
fancyProductDesigner.setElementParameters({text:"hello world"},"firstdate");
Dp4
Just to answer my own question, the new image needs to be added as a replacement.
-
Adding Fancy Products to Categories
-
Shortcode for specfic product designer
-
What theme is recommended to use with FPD ?
-
Exclude Image from export
-
Google Font Family adds extras
-
Floating Dialog box
-
Uploadzone not working
-
Image transparency like in T-shirt demo
-
How do I get clipart
-
What does the LOAD button do / what is it for?
See all 2194 topics