Element Parameters

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

With element parameters you control the behavior and properties of an element, e.g. if it can be dragged or the position on the stage. These can be set for a group of elements or for every element separately.

Where can I set these parameters?

1. Change the default parameters via the plugin call

The first level to change all default parameters are the plugin options. There you will find 4 options to change the common, text, custom image and custom text parametes:  

new FancyProductDesigner($('#fpd'), 
  elementParameters: {draggable: true},
  textParameters: {textSize: 16},
  customImagesParameters: {minW: 1000, minH: 2000},
  customTextParameters: {removable: true}


2. Parameters object for products and designs

As mentioned in the Getting Started guide you set up your products and designs via a JSON file. Here you have all of your initial elements defined and in the parameters object you can define individual properties for single elements.


3. Using the API

Another possibility would be to add elements to the stage using the API, e.g. with the addElement() method.  

  var myProductDesigner = new FancyProductDesigner($('#fpd'));
  myProductDesigner.addElement('image', 'image_url.png', 'Image Title', {autoCenter: true, price: 20, draggable: true});