Note that there are some explanatory texts on larger screens.

plurals
  1. PODynamically loaded text not staying inside div
    primarykey
    data
    text
    <p>I have a lot of dynamically loaded content, for some reason Images are doing great, but Links and Text are not.</p> <p>Here is a JSFiddle with the issue: <a href="http://jsfiddle.net/HRs3u/1/" rel="nofollow">http://jsfiddle.net/HRs3u/1/</a></p> <p>I am guessing it has something to do with the text caching or not caching?</p> <p>Here is the append section of the code:</p> <pre><code>function findpost(timestamp, blog){ //console.log(blog); var length = blog.length; for(var e=0; e&lt;length; e++){ var type = blog[e+1]; if(timestamp === blog[e]){ if(type === 0){ $("#content").append("\ &lt;div class='post photo'&gt;\ &lt;img src='"+blog[e+2]+"' width='400px'/&gt;\ &lt;/div&gt;" ); } else if(type === 1){ $("#content").append("\ &lt;div class='post video'&gt;\ "+blog[e+2]+"&lt;br&gt;\ "+blog[e+3]+"\ &lt;/div&gt;" ); console.log("Video"); } else if(type === 2){ $("#content").append("\ &lt;div class='post link' /&gt;\ &lt;a href='"+blog[e+2]+"' target='_blank'&gt;"+blog[e+3]+"&lt;/a&gt;\ &lt;/div&gt;\ "); console.log("Link!"); } else if(type === 3){ var title = blog[e+3]; var text = blog[e+2]; $("#content").append("\ &lt;div class='post text' /&gt;\ &lt;h2&gt;"+title+"&lt;/h2&gt;\ "+text+"\ &lt;/div&gt;\ "); console.log("Text!"); } else if(type === 4){ $("#content").append("\ &lt;div class='post tweet' /&gt;\ "+blog[e+2]+"\ &lt;/div&gt;\ "); console.log("Tweet!"); } else { console.warn("ERROR!"); } } } } </code></pre> <p>And the CSS:</p> <pre><code>/*___Post Divs*/ .post{ display : inline-block; float : left; line-height : 0; margin : 5px; overflow : hidden; border : 1px solid #000; width : 400px; height : 400px; } .post.photo{ background-color: #ccc; } .post.video{ background-color: #0f1; } .post.link{ background-color: #ff4; } .post.text{ background-color: #c0f; } .post.tweet{ background-color: #f44; } </code></pre>
    singulars
    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