Hi

I'm building a website over this tutorial.
I'm trying to figure out how to add an auto height based on the contenís height. It was originaly locked to the windows size but I want it to expand further down.

Line 455 of the original code:
Code:
		calcHeight : function() {

			var heightPreview = winsize.height - this.$item.data( 'height' ) - marginExpanded,
				itemHeight = winsize.height;

			if( heightPreview < settings.minHeight ) {
				heightPreview = settings.minHeight;
				itemHeight = settings.minHeight + this.$item.data( 'height' ) + marginExpanded;
			}

			this.height = heightPreview;
			this.itemHeight = itemHeight;

		},
My solution that works 50% of the time (works perfect localy):
Code:
		calcHeight : function() {
			var lol = this.$fullimage[0].getElementsByTagName('img')[0];
			var oImage = new Image();
			
			oImage.onload = function(){
				this.height// width of loaded image
			}
			
			oImage.src = lol.src;
			this.height = oImage.height;
			this.itemHeight = oImage.height+650;
		},
		setHeights : function() {

			var self = this,
				onEndFn = function() {
					if( support ) {
						self.$item.off( transEndEventName );
					}
					self.$item.addClass( 'og-expanded' );
				};
Why wont this work? Can I maybe find the image src in another way?
Please help. Thank you so much in advance.