I want to get the height in pixels of the background-image of this HTML element via jQuery, how?
<section class="profile-banner" style="background: url(http://www.mydomain.com/images/myimage.png) 50% 50% no-repeat;"></section>
update
I now have this, but I never see the height alert box alert('height:' + height);
.
Why?
var url = $('.profile-banner').css('background-image').replace('url(', '').replace(')', '').replace("'", '').replace('"', '');
alert(url);
var bgImg = $('<img />');
bgImg.hide();
bgImg.bind('load', function()
{
var height = $(this).height();
alert('height:' + height);
});