Jquery load file and test for hidden content - callback not helpiing
Posted on 2013-05-28
I have been trying to load an external file into a div - no problem
have been testing to see if some content is hidden - no problem
var $s = $('.scrollable');
$s.wrapInner('<div />'); // wrap inner contents
var hidden = $s.height() < $s.children('div').height();
$s.children('div').replaceWith( $s.children('div').html() ); //unwrap
have been trying to do it in same function so it will all happen in order with one onclick
No matter how I try it even callback it seems to have to finish the entire function before the file appears in the div so, obviously, the hidden content detection fails every time.
Is this possible to do. I want to load the file into a div and, if content exceeds div - indicate there is more available at the bottom of the div - scrollbars are fine on the browsers but iphone and ipad scroll fine bit i am trying to indicate there is "more'. I thought I could load the div then test the content for hidden true/false and if true then unhide the notice element at the bottom of the content div.
Any help appreciated