Note that there are some explanatory texts on larger screens.

plurals
  1. POEnsure that div is loaded before calling js function
    primarykey
    data
    text
    <p>EDIT: iam using ajax to load text in my content that is why onload on head is not applicable. </p> <p>I have an almost complete project here <a href="http://sandbox.littlegraffyx.com/bible/test2.html" rel="nofollow noreferrer">http://sandbox.littlegraffyx.com/bible/test2.html</a> (enter gen 1:1 on bottom left to start)</p> <p>The only problem I have is to ensure that my main div where the main text is displayed is fully loaded before I call a function that will autofit the text content on the window.</p> <p>There are times that my autofit function is working and there are times it isn't and the only reason I can think of why it's not working is maybe the div isn't fully loaded yet when I call the function.</p> <pre><code>echo "&lt;div id=\"verse\"&gt;" . $bcontent . "&lt;/div&gt;"; echo "&lt;script type='text/javascript'&gt; scaleQuote();"; echo "&lt;/script&gt;"; </code></pre> <p>The scalequote sample is found in my other question here</p> <p><a href="https://stackoverflow.com/questions/11060866/adjust-size-based-on-height-vertical-length">Adjust size based on height (vertical length)</a></p> <p>Here are the searches I made and I can't see how can I apply the solutions offered in these post in my case that is why I am asking one myself. Hoping I will not be down voted for "lack of research"</p> <p><a href="https://stackoverflow.com/questions/6242619/how-do-i-run-a-function-only-when-a-div-gets-loaded">How do I run a function only when a div gets loaded?</a></p> <p><a href="https://stackoverflow.com/questions/9410393/getting-the-height-and-width-of-a-div-after-loading-info-into-it-from-an-externa">getting the height and width of a div after loading info into it from an external source with jquery</a></p> <p>thanks in advance and sorry for my english</p> <p>File references</p> <p><a href="http://pastebin.com/wwQumwKJ" rel="nofollow noreferrer">http://pastebin.com/wwQumwKJ</a> - my JS file</p> <p><a href="http://pastebin.com/FnyST8iz" rel="nofollow noreferrer">http://pastebin.com/FnyST8iz</a> - my html file</p> <p><a href="http://pastebin.com/BYfSUjQJ" rel="nofollow noreferrer">http://pastebin.com/BYfSUjQJ</a> - my css file</p> <p>Except from getting the database contents, my php file is pretty much what is posted above.</p>
    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.
 

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