javascript - What is more correct "setPosition" or "style.left/right"? -
i trying make mootools drag on iframe.
qestion:
is more correct use
var div = parent.document.getelementbyid("price_info"); div.setposition({ x: e.clientx-offx });   or
var div = parent.document.getelementbyid("price_info"); div.style.left = (e.clientx-offx) + 'px';   this info me fixing bigger problem... (here)
it comes down same thing. setposition() writes element's style object, manually.
i suppose if you've taken decision build code in framework should use api possible, unless there specific reason ignore , use vanilla js in place.
also, setposition() returns element(s) affected, whereas .style not, may factor regard chaining, example.
Comments
Post a Comment