Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding elements with jQuery messes up positioning
    primarykey
    data
    text
    <p>I've been doing some web stuff with jQuery and css, and came across a problem, which I'm unable to find a solution to. I've written a code, where using jQuery, I get data from server and according to that data I add new elements. The elements have a lot of absolute positioning in them, and it messes up whenever I add them via jQuery. My code is here:</p> <pre><code>function output(progress, data) { $("#lookup .bar").css('width', (100/3*progress) + '%'); if (progress === 3) { $("#lookup div.container").html(data); $('#lookup').css("text-align", "left"); } } </code></pre> <p>Basicly, I just remove the progress bar, and set my text-align to left, because of otherwise even more messed up aligning, this is the only workaround I found... The problem I'm having looks like this: <img src="https://i.stack.imgur.com/qPIM1.png" alt="enter image description here"></p> <p>Although normally, it should look like this: <img src="https://i.stack.imgur.com/1G8nf.png" alt="enter image description here"></p> <p>The strange thing is that the problem fixes itself whenever I refresh styling, for example with firebug, I would just delete some padding, then restore it, and the problem is gone... I feel that it has to do something with jQuery part. I'm pretty sure styling is fine, but if you need me to paste a code here, just ask, and I'll update the post.</p> <p>UPDATE: Live preview on jsbin: <a href="http://jsbin.com/awomen/5/" rel="nofollow noreferrer">http://jsbin.com/awomen/5/</a> I know the code is ugly ;)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload