 			@$badylInner.css addCss if addCss
 			@state = newState
 
+		measureInnerWidth: ($el) ->
+			$el.append $measureDiv = $("<div>").css display: "block", width: "100%"
+			result = $measureDiv.width()
+			$measureDiv.remove()
+			result
+
 	$.fn.badyl = (method, args...) ->
 		@each ->
 			badyl = $(@).data 'badyl'

			@state = null
			@badylized = no
			@$refEl = $(@$el.attr "data-badyl-ref-el")
			@prevWindowScrollTop = 0
			@badylize()

			# (window.badyls or= []).push @

					margin: "-#{@config.offset}px 0"
				.append @$badylInner = $("""<div>""")
					.css
						width: "#{@containerInnerWidth}px"
						height: "#{@badylInnerHeight}px"
						padding: "#{@config.offset}px 0"
					.append @$originalElement = @$el.clone()
