Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter dinowax

    (@dinowax)

    That didn’t work either, but didn’t hurt it. I appreciate the response, definitely worth a shot. Let me know what else you got.

    Current code:

    jQuery(document).ready(function($){
    
    /************************************************************************************
     * HTML5 PLACEHOLDER JQUERY FALLBACK (uses Modernizr)
     * http://uniquemethod.com/html5-placeholder-text-with-modernizr-and-jquery-fallback
    *************************************************************************************/
    
    	jQuery(function($) {
    	  // check placeholder browser support
    	  if (!Modernizr.input.placeholder) {
    	    // set placeholder values
    	    jQuery(this).find('[placeholder]').each(function($) {
    	      jQuery(this).val( jQuery(this).attr('placeholder') );
    	    });
    
    	    // focus and blur of placeholders
    	    jQuery('[placeholder]').focus(function($) {
    	      if (jQuery(this).val() == jQuery(this).attr('placeholder')) {
    	        jQuery(this).val('');
    	        jQuery(this).removeClass('placeholder');
    	      }
    	    }).blur(function() {
    	      if (jQuery(this).val() == '' || jQuery(this).val() == jQuery(this).attr('placeholder')) {
    	        jQuery(this).val(jQuery(this).attr('placeholder'));
    	        jQuery(this).addClass('placeholder');
    	      }
    	    });
    
    	    // remove placeholders on submit
    	    jQuery('[placeholder]').closest('form').submit(function($) {
    	      jQuery(this).find('[placeholder]').each(function($) {
    	        if (jQuery(this).val() == jQuery(this).attr('placeholder')) {
    	          jQuery(this).val('');
    	        }
    	      });
    	    });
    	  }
    	});
    
    /***********************************************************************************
     * DYNAMIC CSS CLASSES
     * Original Source: http://brandonbuttars.com/demos/jquery-css-classes/
     * Author: Brandon Buttars
    ***********************************************************************************/
    
    	// Zebra Tables
    	jQuery("tbody tr:nth-child(odd),li:nth-child(odd)").addClass("odd");
    	jQuery("tbody tr:nth-child(even),li:nth-child(even)").addClass("even");
    
    	// First-Child & Last-Child
    	jQuery("li:first-child,th:first-child,td:first-child").addClass("first-child");
    	jQuery("li:last-child,th:last-child,td:last-child").addClass("last-child");
    
    	// Hover
    	jQuery("li,input,button,textarea,img").hover(
    		function($){
    			jQuery(this).addClass("hover");
    		},function($){
    			jQuery(this).removeClass("hover");
    	});
    
    	// Focus
    	jQuery("input,textarea").focus(
    		function($) {
    			jQuery(this).addClass("focus");
    			return false;
    	});
    	jQuery("input,textarea").blur(
    		function($) {
    			jQuery(this).removeClass("focus");
    			return false;
    	});
    
    /************************************************************************************
     * INITIALIZE FITVIDS - FLUID-WIDTH VIDEOS
    *************************************************************************************/
    
    	// Target your .container, .wrapper, .post, etc.
    	jQuery(".entry, .post-video").fitVids();
    
    /************************************************************************************
     * INITIALIZE FANCYBOX
    *************************************************************************************/
    
    	jQuery("a[rel=\"fancybox\"]").fancybox({
    		/*maxWidth	: 800,
    		maxHeight	: 600,*/
    		width       : '70%',
    		height		  : '70%',
    		autoSize	  : false,
    		fitToView	  : true,
    		closeClick	: false,
    		openEffect	: 'none',
    		closeEffect	: 'none',
    		helpers     : {
      		title     : {
      			type    : 'over'
      		}
      	}
    	});
    
    /************************************************************************************
     * INITIALIZE ELASTISLIDE CAROUSEL
    *************************************************************************************/
    
    	jQuery(".wrapper-carousel").elastislide({
    
    		imageW : 190, // default image width
    		speed: 250,   // animation speed
    		//easing: 'easeInBack',  // animation easing effect
    		margin: 25,   // image margin right
    		border: 0,    // image border
    
    		minItems: 2,
    		// the minimum number of items to show.
    		// when we resize the window, this will
    		// make sure minItems are always shown
    		// (unless of course minItems is higher
    		// than the total number of elements)
    
    		//current: 0
    		// index of the current item
    		// when we resize the window,
    		// the plugin will make sure that
    		// this item is visible 
    
    		onClick: null
    
    	});
    
    	// Example of how to get the index
    	// of the clicked element:
    	/*
    	jQuery('#carousel').elastislide({
    	    onClick  :  function( $item ) {
    	        alert( 'The clicked item«s index is ' + $item.index() )
    	    }
    	});
    	*/
    
    /***********************************************************************************
     * TABBED CONTENT BOX
    ***********************************************************************************/
    
    	//When page loads...
    	jQuery(".tab-content").hide(); // Hide all content
    	jQuery(".tab-content:first").show(); // Show first tab content
    
    	// On Click Event
    	jQuery("ul.tab li").click(function($) {
    
    		jQuery("ul.tab li").removeClass("current"); // Remove any "current" class
    		jQuery(this).addClass("current"); // Add "current" class to selected tab
    		jQuery(".tab-content").hide(); // Hide all tab content
    
    		// Find the href attribute value to identify the current tab + content
    		var activeTab = jQuery(this).find("a").attr("href");
    
    		jQuery(activeTab).show(); // Fade in the active ID content
    
    		return false;
    
    	});
    
    	jQuery(function($) {
    		//Calculate the height of <header>
        //Use outerHeight() instead of height() if have padding
        var aboveHeight = jQuery('#wrap > header').outerHeight();
    
    		//when scroll
        jQuery(window).scroll(function($) {
    
          //if scrolled down more than the headerís height
          if (jQuery(window).scrollTop() > aboveHeight) {
    
          // if yes, add ìfixedî class to the <nav>
          // add padding top to the #content
          // (value is same as the height of the nav)
          jQuery('#nav-main').addClass('fixed').next()
          .css('padding-top','40px');
    
          } else {
    
          // when scroll up or less than aboveHeight,
          // remove the ìfixedî class, and the padding-top
          jQuery('#nav-main').removeClass('fixed').next()
          .css('padding-top','0');
          }
        });
    	});
    
    /***********************************************************************************
     * Disable scalability with javascript until gesturestart
    ***********************************************************************************/
    
    	if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i)) {
    	  var viewportmeta = document.querySelector('meta[name="viewport"]');
    	  if (viewportmeta) {
    	      viewportmeta.content = 'width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0';
    	      document.body.addEventListener('gesturestart', function () {
    	          viewportmeta.content = 'width=device-width, minimum-scale=0.25, maximum-scale=1.6';
    	      }, false);
    	  }
    	}
    
    });
    Thread Starter dinowax

    (@dinowax)

    Thanks, I’ll give it a try. I appreciate the response.

    Thread Starter dinowax

    (@dinowax)

    I appreciate the input, I gave that a try and no difference. script.js is full of lines that start with $

    jQuery(document).ready(function($){
    
    /************************************************************************************
     * HTML5 PLACEHOLDER JQUERY FALLBACK (uses Modernizr)
     * http://uniquemethod.com/html5-placeholder-text-with-modernizr-and-jquery-fallback
    *************************************************************************************/
    
    	$(function() {
    	  // check placeholder browser support
    	  if (!Modernizr.input.placeholder) {
    	    // set placeholder values
    	    $(this).find('[placeholder]').each(function() {
    	      $(this).val( $(this).attr('placeholder') );
    	    });
    
    	    // focus and blur of placeholders
    	    $('[placeholder]').focus(function() {
    	      if ($(this).val() == $(this).attr('placeholder')) {
    	        $(this).val('');
    	        $(this).removeClass('placeholder');
    	      }
    	    }).blur(function() {
    	      if ($(this).val() == '' || $(this).val() == $(this).attr('placeholder')) {
    	        $(this).val($(this).attr('placeholder'));
    	        $(this).addClass('placeholder');
    	      }
    	    });
    
    	    // remove placeholders on submit
    	    $('[placeholder]').closest('form').submit(function() {
    	      $(this).find('[placeholder]').each(function() {
    	        if ($(this).val() == $(this).attr('placeholder')) {
    	          $(this).val('');
    	        }
    	      });
    	    });
    	  }
    	});
    
    /***********************************************************************************
     * DYNAMIC CSS CLASSES
     * Original Source: http://brandonbuttars.com/demos/jquery-css-classes/
     * Author: Brandon Buttars
    ***********************************************************************************/
    
    	// Zebra Tables
    	$("tbody tr:nth-child(odd),li:nth-child(odd)").addClass("odd");
    	$("tbody tr:nth-child(even),li:nth-child(even)").addClass("even");
    
    	// First-Child & Last-Child
    	$("li:first-child,th:first-child,td:first-child").addClass("first-child");
    	$("li:last-child,th:last-child,td:last-child").addClass("last-child");
    
    	// Hover
    	$("li,input,button,textarea,img").hover(
    		function(){
    			$(this).addClass("hover");
    		},function(){
    			$(this).removeClass("hover");
    	});
    
    	// Focus
    	$("input,textarea").focus(
    		function() {
    			$(this).addClass("focus");
    			return false;
    	});
    	$("input,textarea").blur(
    		function() {
    			$(this).removeClass("focus");
    			return false;
    	});
    
    /************************************************************************************
     * INITIALIZE FITVIDS - FLUID-WIDTH VIDEOS
    *************************************************************************************/
    
    	// Target your .container, .wrapper, .post, etc.
    	$(".entry, .post-video").fitVids();
    
    /************************************************************************************
     * INITIALIZE FANCYBOX
    *************************************************************************************/
    
    	$("a[rel=\"fancybox\"]").fancybox({
    		/*maxWidth	: 800,
    		maxHeight	: 600,*/
    		width       : '70%',
    		height		  : '70%',
    		autoSize	  : false,
    		fitToView	  : true,
    		closeClick	: false,
    		openEffect	: 'none',
    		closeEffect	: 'none',
    		helpers     : {
      		title     : {
      			type    : 'over'
      		}
      	}
    	});
    
    /************************************************************************************
     * INITIALIZE ELASTISLIDE CAROUSEL
    *************************************************************************************/
    
    	$(".wrapper-carousel").elastislide({
    
    		imageW : 190, // default image width
    		speed: 250,   // animation speed
    		//easing: 'easeInBack',  // animation easing effect
    		margin: 25,   // image margin right
    		border: 0,    // image border
    
    		minItems: 2,
    		// the minimum number of items to show.
    		// when we resize the window, this will
    		// make sure minItems are always shown
    		// (unless of course minItems is higher
    		// than the total number of elements)
    
    		//current: 0
    		// index of the current item
    		// when we resize the window,
    		// the plugin will make sure that
    		// this item is visible 
    
    		onClick: null
    
    	});
    
    	// Example of how to get the index
    	// of the clicked element:
    	/*
    	$('#carousel').elastislide({
    	    onClick  :  function( $item ) {
    	        alert( 'The clicked item«s index is ' + $item.index() )
    	    }
    	});
    	*/
    
    /***********************************************************************************
     * TABBED CONTENT BOX
    ***********************************************************************************/
    
    	//When page loads...
    	$(".tab-content").hide(); // Hide all content
    	$(".tab-content:first").show(); // Show first tab content
    
    	// On Click Event
    	$("ul.tab li").click(function() {
    
    		$("ul.tab li").removeClass("current"); // Remove any "current" class
    		$(this).addClass("current"); // Add "current" class to selected tab
    		$(".tab-content").hide(); // Hide all tab content
    
    		// Find the href attribute value to identify the current tab + content
    		var activeTab = $(this).find("a").attr("href");
    
    		$(activeTab).show(); // Fade in the active ID content
    
    		return false;
    
    	});
    
    	$(function() {
    		//Calculate the height of <header>
        //Use outerHeight() instead of height() if have padding
        var aboveHeight = $('#wrap > header').outerHeight();
    
    		//when scroll
        $(window).scroll(function() {
    
          //if scrolled down more than the headerís height
          if ($(window).scrollTop() > aboveHeight) {
    
          // if yes, add ìfixedî class to the <nav>
          // add padding top to the #content
          // (value is same as the height of the nav)
          $('#nav-main').addClass('fixed').next()
          .css('padding-top','40px');
    
          } else {
    
          // when scroll up or less than aboveHeight,
          // remove the ìfixedî class, and the padding-top
          $('#nav-main').removeClass('fixed').next()
          .css('padding-top','0');
          }
        });
    	});
    
    /***********************************************************************************
     * Disable scalability with javascript until gesturestart
    ***********************************************************************************/
    
    	if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i)) {
    	  var viewportmeta = document.querySelector('meta[name="viewport"]');
    	  if (viewportmeta) {
    	      viewportmeta.content = 'width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0';
    	      document.body.addEventListener('gesturestart', function () {
    	          viewportmeta.content = 'width=device-width, minimum-scale=0.25, maximum-scale=1.6';
    	      }, false);
    	  }
    	}
    
    });

    Does that seem right?

Viewing 3 replies - 1 through 3 (of 3 total)