javascript - Elements position changing after setting position to absolute -
I have participated in a very strange problem that I have been able to fix, but in a disgusting way.
I have the following working code which captures the element left and up (using MooTools) then it uses But as soon as I change the condition of the completion of the code in the code above it, it has to be changed. Works but horrible: As you can see, I am using an end time to isolate the left / top settings and status settings. The following code does not work. Store So, we can use it. and I have tried to cloning the object and its anything seems to work. Does anyone know how to find similar improvements but without The way I tried to explain my problem well, but it is a strange thing to comment with any question. Thank you for any suggestions. I believe (I'm not sure because you have the In short, you have to first set setStyles to copy these criteria into the style attribute is. It works all too well.
var Sortable = new class ({initialize: function (element, container)} {// element and Store its settings Element = element; this.size = element.getSize (); This.position = element.getPosition (container); // Set position element.setStyles ({left: this.position.x, top : This.position.y}) setTimeout (this.goAbsolute.bind (this), 0);}, goAbsolute: function () {this.element.setStyle ('position', 'absolute');}});
var Sortable = new class ({initialize: function (element, container) {// element and its settings. Element = element; this.size = Element.getSize (); This.position = element.getPosition (container); // set position element.setStyles ({left: this.position.x, top: this.position.y, position: 'absolute'});}});
this.size = element.getSize (); For example,
size.x will be equal to 100. Then with the line of this couple
this.size = element.getSize (); Element.setStyle ('position', 'complete');
Size. X will now equal 0. Although it was set after completion.
setTimeout ? Or this is the best way.
float: left Not mentioned) that you have the same problem as you, which I have answered well.
top and
left on all the elements. After doing this, set
position: full on all the elements.
Comments
Post a Comment