wp/wp-content/themes/IN-MOTION-package-u1/in-motion/js/main.js
changeset 0 d970ebf37754
equal deleted inserted replaced
-1:000000000000 0:d970ebf37754
       
     1 jQuery(document).ready(function($) {
       
     2 
       
     3   // get the action filter option item on page load
       
     4   var $filterType = $('#filterOptions li.active a').attr('class');
       
     5 	
       
     6   // get and assign the ourHolder element to the
       
     7 	// $holder varible for use later
       
     8   var $holder = $('ul.portfolio-circles');
       
     9 
       
    10   // clone all items within the pre-assigned $holder element
       
    11   var $data = $holder.clone();
       
    12 
       
    13   // attempt to call Quicksand when a filter option
       
    14 	// item is clicked
       
    15 	$('#filterOptions li a').click(function(e) {
       
    16 		// reset the active class on all the buttons
       
    17 		$('#filterOptions li').removeClass('active');
       
    18 		
       
    19 		// assign the class of the clicked filter option
       
    20 		// element to our $filterType variable
       
    21 		var $filterType = $(this).attr('class');
       
    22 		$(this).parent().addClass('active');
       
    23 		
       
    24 		if ($filterType == 'all') {
       
    25 			// assign all li items to the $filteredData var when
       
    26 			// the 'All' filter option is clicked
       
    27 			var $filteredData = $data.find('li');
       
    28 		} 
       
    29 		else {
       
    30 			// find all li elements that have our required $filterType
       
    31 			// values for the data-type element
       
    32 			var $filteredData = $data.find('li[data-type~=' + $filterType + ']');
       
    33 		}
       
    34 		
       
    35 		// call quicksand and assign transition parameters
       
    36 		$holder.quicksand($filteredData, {
       
    37 			duration: 800,
       
    38 			easing: 'easeInOutQuad',
       
    39 			enhancement: function() {
       
    40 			  $(function(){
       
    41 						$("#portfolio-filter a").bind("mouseenter",function(){	   
       
    42 						   name = $(this).data("name");	   
       
    43 						   $('#portfolio-content ul.portfolio-circles').find('.'+name).stop().animate({backgroundPosition: '-170px 0px'},300);
       
    44 						   
       
    45 						}).bind("mouseleave",function(){	   
       
    46 						   name = $(this).data("name");
       
    47 							$('#portfolio-content ul.portfolio-circles').find('.'+name).stop().animate({backgroundPosition: '0px 0px'},300);
       
    48 						
       
    49 						});
       
    50 						
       
    51 						$('#portfolio-content ul.portfolio-circles li').bind("mouseenter",function(){
       
    52 							$(this).find('.circle-p').stop().animate({backgroundPosition: '-170px 0px'},300);
       
    53 						
       
    54 						}).bind("mouseleave",function(){
       
    55 							$(this).find('.circle-p').stop().animate({backgroundPosition: '0px 0px'},300);
       
    56 						
       
    57 						});
       
    58 						
       
    59 						
       
    60 						
       
    61 					});
       
    62 					
       
    63 					jQuery(document).ready(function($){
       
    64 						$("li.all").show();
       
    65 							
       
    66 						$("#thumbs a.view, ul.paginate a.view").click(function(){
       
    67 							var section_id = "#" + $(this).closest(".content-wrapper").attr("id");
       
    68 							if ($("#portfolio-item-wrapper-container").length > 0){
       
    69 								slide_empty_portfolio_item();
       
    70 							}
       
    71 							$("ul#thumbs li, ul.paginate li").removeClass("active_item");
       
    72 							$(this).closest("li").addClass("active_item");
       
    73 							if ($("#portfolio-item-wrapper-container").length < 1){
       
    74 								if ($(section_id + " .divider-heading").length < 1) {
       
    75 									$(section_id).prepend("<div id='portfolio-item-wrapper-container' style='display:none'></div>");
       
    76 								} else {
       
    77 									$(section_id).find(".divider-heading").after("<div id='portfolio-item-wrapper-container' style='display:none'></div>");
       
    78 								}
       
    79 							}
       
    80 							var url = $(this).attr("href") + " #portfolio-item-wrapper";						        
       
    81 							show_item_inline(url, "#portfolio-item-wrapper-container", section_id, 600, "");					
       
    82 						return false
       
    83 						})
       
    84 					});
       
    85 			}
       
    86 		});
       
    87 		return false;
       
    88 	});
       
    89 });
       
    90