Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- backgroundSize : function ( element ) {
- var background = new Image();
- var url = '';
- url = element.css('background-image').match(/(?:url\()(.*)(?:\))/m)[1];
- background.src = url;
- if(background.width == 0 && background.height == 0){
- img = $('<img src="'+url+'" class="hidden" />').appendTo(self).load(function(){
- background.width = $(this).width();
- background.height = $(this).height();
- $(this).remove();
- });
- }
- return {"w": background.width, "h": background.height};
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement