Poor functioning of beautiful code function in JS code.

[ad_1]

Hello

This is not a support request, I just gave an illustrative example of how badly the “beautiful code” function works for JS code, which is particularly important to me.

I would be happy to improve it.

Thank you

jQuery(function(){
    var navIsBig = true;
    var $nav = jQuery('#masthead .custom-logo');
	var height_original = jQuery('#masthead .custom-logo').css("height").replace("px","");
	var height_small = height_original * 0.666;
	var width_original = jQuery('#masthead .custom-logo').css("width").replace("px","");	
	var width_small = width_original * 0.666;

jQuery(document).scroll( function() {
   var value = jQuery(this).scrollTop();

  if ( value > 100 && navIsBig ){
      $nav.stop().animate({
           height:height_small,width:width_small
      },100);
      navIsBig = false;
  } else if (value <= 100 && !navIsBig ) {
      $nav.stop().animate({
          height:height_original,width:width_original
      },100);
      navIsBig = true;
  }
});
});
jQuery(function(){
		var navIsBig = true;
		var $nav = jQuery('#masthead .custom-logo');
		var height_original = jQuery('#masthead .custom-logo').css("height").replace("px","");
		var height_small = height_original * 0.666;
		var width_original = jQuery('#masthead .custom-logo').css("width").replace("px","");
		var width_small = width_original * 0.666;
		jQuery(document).scroll( function() {
			var value = jQuery(this).scrollTop();
			if ( value > 100 && navIsBig ){
				$nav.stop().animate({
					height:height_small,width:width_small
				}
									,100);
				navIsBig = false;
			}
			else if (value <= 100 && !navIsBig ) {
				$nav.stop().animate({
					height:height_original,width:width_original
				}
									,100);
				navIsBig = true;
			}
		}
							   );
	}
		  );

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer