Hello folks,

I'm trying to return a value into minSlide: key inside bxSlider() method.
Code:
	<script>
		<!-- Detect Viewport -->
		//Greater than 934 4 boxes
		//Less 934 3 boxes
		//Less than 583 2 boxes
			
		function adjustStyle(width) {
		    var width = parseInt(width);
			//document.getElementById("vwsize").innerHTML = width;
			if ((width > 583) AND (width < 943)) {
				return 3;
			} else if (width < 583) {
				return 2;
			} else if (width > 942) {
				return 4;
			}
		}
	
		$(document).ready(function(){
		    adjustStyle($(this).width());
			var minImages = $(window).resize(function() {
		    					adjustStyle($(this).width());
							})
			
			$('.bxslider').bxSlider({
				slideWidth: 500,
				minSlides: minImages,
				maxSlides: 20,
				slideMargin: 20,
			});
		});
	</script>
Unfortunately it's not working.
So what I had done wrong?

Thanks in advance.