Remove an element

Modified on Mon, 19 Dec 2022 at 03:43 PM

If you want to remove an element, e.g. before generating the product image, you can use the API of FPD first and then you can use the fabricjs API.

Using getElementByTitle method to return the fabricjs object: 

var fabricElement = thsirtDesigner.getElementByTitle('title-of-an-element');


Now through the fabricElement variable you can use any method for that fabricjs object, e.g. the remove method. 

//wait until product is created
$('#fpd').on('productCreate', function(){

  //e.g. now you are able to generate an image without a specific element layer