I created a custom jquery event called \'loading\' in my application. I want to append a masking element with a spinner, when this event is triggered. I can figure out tha
http://jsfiddle.net/mblase75/eGyRH/3/ -- Chrome lets me add a child element to an tag, even though it's not displayed at all. It's visible in the DOM debugger, just not in the browser window.
However, I can test it's .width()
and see that's equal to zero or not: http://jsfiddle.net/mblase75/eGyRH/4/
alert($('.element').append('asdf').children().width());
However, this will also be zero width if, for instance, I'm adding the span to a hidden div: http://jsfiddle.net/mblase75/eGyRH/5/ -- so it's not totally reliable either.