//You need an anonymous function to wrap around your function to avoid conflict  
(function($){
	$.fn.extend({

		time        : null,
		eleWidth    : 0,
		windowWidth : 0,

		minWidth: function() {

			return this.each(function() {
				$wraper = $( this );
				$wraper.thisResize( false );
				$wraper.timer = setTimeout( 
					function(){
						$wraper.thisResize( true );
					},
					100
				);
				$( window ).resize( function() {
					$wraper.thisResize( false );
				});
			});
		},

		thisResize: function( timeout ){
			$this = this;
			$this.windowWidth = $( window ).width();
			$this.eleWidth = 0;
			$this.children( 'ul' ).each( function(){
				$elementWraper = $( this );
				$this.eleWidth = $this.eleWidth + parseInt( $elementWraper.css( 'marginLeft' )) + parseInt( $elementWraper.css( 'marginRight' ));
				$elementWraper.children( 'li' ).each( function(){
					$element = $( this );
					if( !$element.hasClass( 'last' ) && $element.index() > 0 || $element.index() == 0 ){
						$this.eleWidth = $this.eleWidth + $element.outerWidth( true );
					} else {
						return false;
					}
				});
			});
			if( $this.windowWidth > $this.eleWidth + 20 ){
				$this.css({ width: '100%' });
			} else {
				$this.css({ width: $this.eleWidth + 20 + 'px' });
			}
			if( timeout ){
				$wraper.timer = setTimeout( 
					function(){
						$wraper.thisResize( true );
					},
					100
				);
			}
		}
	});
})(jQuery);
