I have a js code that points to 2 div ids: <div id="marshmallow"></div>
and <div id="cheese"></div>
But if i create the divs on the Header of the element code (it auto-sizes to entire page, and it doesn’t work properly).
Im trying to do, when i drag the element to the page, that element should carry the divs.
I tried this:
var div;
var div2; div = $('<div>id="marshmallow</div>'); div2 = $('<div>id="cheese</div>');
But nothing. Do you have any idea/suggestion?
PS: Before of creating this topic, i tried on all the ways to do it, i checked like 30 plugins code for try understand and nothing, because anyone is similar to what im trying to do, the only one i could check, is not free plugin
hi @cangrimen - have a go with the below within the Initialise function:
var newDiv = $('<div id="marshmallow"></div>');
newDiv.css("width", "100%");
newDiv.css("height", "100%");
instance.canvas.append(newDiv);
You don’t want to be adding Divs or Canvass inside the Header. Instead you want to append them to the canvas object which is the outer container for your plugin on the page.