JAVASCRIPT   103
Custom js
Guest on 5th August 2022 06:57:52 AM


  1. jQuery(document).ready(function(){
  2.         /* ---------------------------------------------------------------------- */
  3.         /*      Menu
  4.         /* ---------------------------------------------------------------------- */
  5.        
  6.         // Needed variables
  7.         var $content            = $("#content");
  8.        
  9.         // Run easytabs
  10.         $content.easytabs({
  11.           animate                       : true,
  12.           updateHash            : false,
  13.           transitionIn          :'slideDown',
  14.           transitionOut         :'slideUp',
  15.           animationSpeed        :600,
  16.           tabs                          :".tmenu",
  17.           tabActiveClass        :'active',
  18.         });
  19.  
  20.        
  21.         // Hover menu effect
  22.         $content.find('.tabs li a').hover(
  23.                 function() {
  24.                         $(this).stop().animate({ marginTop: "-7px" }, 200);
  25.                 },function(){
  26.                         $(this).stop().animate({ marginTop: "0px" }, 300);
  27.                 }
  28.         );
  29.  
  30.         // Menu Navigation
  31.          $(".menu .tabs").carouFredSel({
  32.         responsive          : true,
  33.         direction           : "left",
  34.             circular: false,
  35.         infinite: false,
  36.         pagination              : "#menu-controls",  
  37.         auto                            : false,
  38.         scroll                  : {
  39.             items           : 1,
  40.             duration        : 300,                        
  41.             wipe    : true
  42.         },
  43.                 prev    : {    
  44.                         button  : "#menu-prev",
  45.                         key             : "right"
  46.                 },
  47.                 next    : {
  48.                         button  : "#menu-next",
  49.                         key             : "left"
  50.                 },
  51.             swipe: {
  52.                 onTouch: true
  53.             },
  54.         items: {
  55.             width: 140,
  56.             visible: {
  57.               min: 2,
  58.               max: 5
  59.             }
  60.         }          
  61.     });
  62.         /* ---------------------------------------------------------------------- */
  63.         /*      Cats Filter
  64.         /* ---------------------------------------------------------------------- */
  65.        
  66.         var $catsfilter                 = $('.cats-filter');
  67.  
  68.         // Copy categories to item classes
  69.         $catsfilter.find('a').click(function() {
  70.                 var currentOption = $(this).attr('data-filter');
  71.                 $(this).parent().parent().find('a').removeClass('current');
  72.                 $(this).addClass('current');
  73.         });    
  74.  
  75.         /* ---------------------------------------------------------------------- */
  76.         /*      Portfolio
  77.         /* ---------------------------------------------------------------------- */
  78.        
  79.         // Needed variables
  80.         var $plist              = $('#portfolio-list');
  81.         var $pfilter            = $('#portfolio-filter');
  82.                
  83.         // Run Isotope  
  84.         $plist.isotope({
  85.                 filter                          : '*',
  86.                 layoutMode              : 'masonry',
  87.                 animationOptions        : {
  88.                 duration                        : 750,
  89.                 easing                          : 'linear'
  90.            }
  91.         });    
  92.        
  93.         // Isotope Filter
  94.         $pfilter.find('a').click(function(){
  95.           var selector = $(this).attr('data-filter');
  96.                 $plist.isotope({
  97.                 filter                          : selector,
  98.                 animationOptions        : {
  99.                 duration                        : 750,
  100.                 easing                          : 'linear',
  101.                 queue                           : false,
  102.            }
  103.           });
  104.           return false;
  105.         });    
  106. });

Raw Paste

Login or Register to edit or fork this paste. It's free.