var $j = jQuery.noConflict(); $j(document).ready(function() { "use strict"; dropDownMenu(); languageMenu(); setDropDownMenuPosition(); dropDownMenu2(); selectMenu(); initAccordion(); initAccordionFullWidth(); accordionFullWidth(); initAccordionContentLink(); backToTop(); backButtonInterval(); fitVideo(); initCounter(); initToCounter(); initDoughnutProgressBar(); initDoughnutProgressBar2(); initFlexSlider(); initFullWidthHolder(); initListAnimation(); initMessages(); initNiceScroll(); initBlog(); socialShareOpen(); initParallax(parallax_speed); addPlaceholderSearchWidget(); placeholderReplace(); initPortfolioSlider(); prettyPhoto(); initProgressBars(); initProgressBarsVertical(); viewPort(); loadMore(); initCheckSafariBrowser(); }); $j(window).load(function(){ "use strict"; magicPanes(); $j('header').removeClass('hide_background'); $j('.touch .main_menu li:has(div.second)').doubleTapToGo(); // load script to close menu on youch devices logo_height = $j('.logo img').height(); setLogoHeightOnLoad(); checkLogOnSmallestSize(); $j('.logo a').css('visibility','visible'); initProjects(); resetFilter(); initElements(); initTabs(); setSidebarBackgroundColor(); setBlogPortfolioListHeight(); initPortfolioSingleInfo(); initPortfolioHover(); }); $j(window).scroll(function() { "use strict"; var scroll = $j(window).scrollTop(); if($j(window).width() > 768 && $j('.no_fixed').length === 0){ headerSize(scroll); } }); function magicPanes(){ "use strict"; var $magicLine = $j("#magic"); var $menulinks = $j(".main_menu > ul > li"); if($j(".main_menu .active").length > 0){ $j('body').removeClass('menuHoverOn'); $magicLine.width($j(".active").outerWidth(true)).css("left", $j(".active").position().left); $magicLine.width($j(".active").outerWidth(true) - 30).css("left", $j(".active").position().left + 15).data("origLeft", $magicLine.position().left).data("origWidth", $magicLine.width()); var $el; var $leftPos; var $newWidth; $menulinks.mouseenter(function() { $el = $j(this); $leftPos = $el.position().left; $newWidth = $el.outerWidth(true); return $magicLine.stop().animate({ left: $leftPos, width: $newWidth },300); }).mouseleave(function() { return $magicLine.stop().animate({ left: $magicLine.data("origLeft"), width: $magicLine.data("origWidth") }, 300); }); $j('nav > ul > li a').each(function() { $j(this).click(function(){ if($j(this).attr('href') !== "http://#" && $j(this).attr('href') !== "#"){ $j('a').parent().removeClass('active'); if($j(this).closest('.second').length === 0){ $j(this).parent().addClass('active'); }else{ $j(this).closest('.second').parent().addClass('active'); } $magicLine.data("origLeft", $leftPos + 15).data("origWidth", $newWidth - 30); $magicLine.stop().animate({ left: $magicLine.data("origLeft"), width: $magicLine.data("origWidth") }); }else{ return false; } }); }); }else{ $j('body').addClass('menuHoverOn'); } } function initElements(){ "use strict"; var pcFilter = "win16|win32|win64|mac|macintel"; //PCÀÎÁö È®ÀÎ if (pcFilter.indexOf(navigator.platform.toLowerCase()) >= 0) { if($j(".element_from_fade").length){ $j('.element_from_fade').each(function(){ var $this = $j(this); $this.appear(function() { $this.addClass('element_from_fade_on'); },{accX: 0, accY: -200}); }); } if($j(".element_from_left, .element_from_left1, .element_from_left2, .element_from_left3").length){ $j('.element_from_left, .element_from_left1, .element_from_left2, .element_from_left3').each(function(){ var $this = $j(this); $this.appear(function() { $this.addClass('element_from_left_on'); },{accX: 0, accY: -200}); }); } if($j(".element_from_right").length){ $j('.element_from_right').each(function(){ var $this = $j(this); $this.appear(function() { $this.addClass('element_from_right_on'); },{accX: 0, accY: -200}); }); } if($j(".element_from_top").length){ $j('.element_from_top').each(function(){ var $this = $j(this); $this.appear(function() { $this.addClass('element_from_top_on'); },{accX: 0, accY: -200}); }); } if($j(".element_from_bottom, .element_from_bottom1,.element_from_bottom2,.element_from_bottom3,.element_from_bottom4,.element_from_bottom5").length){ $j('.element_from_bottom, .element_from_bottom1,.element_from_bottom2,.element_from_bottom3,.element_from_bottom4,.element_from_bottom5').each(function(){ var $this = $j(this); $this.appear(function() { $this.addClass('element_from_bottom_on'); },{accX: 0, accY: -200}); }); } if($j(".element_transform").length){ $j('.element_transform').each(function(){ var $this = $j(this); $this.appear(function() { $this.addClass('element_transform_on'); },{accX: 0, accY: -200}); }); } }else{ if($j(".element_from_fade").length){ $j('.element_from_fade').each(function(){ var $this = $j(this); $this.removeClass(); }); } if($j(".element_from_left, .element_from_left1, .element_from_left2, .element_from_left3").length){ $j('.element_from_left, .element_from_left1, .element_from_left2, .element_from_left3').each(function(){ var $this = $j(this); $this.removeClass(); }); } if($j(".element_from_right").length){ $j('.element_from_right').each(function(){ var $this = $j(this); $this.removeClass(); }); } if($j(".element_from_top").length){ $j('.element_from_top').each(function(){ var $this = $j(this); $this.removeClass(); }); } if($j(".element_from_bottom, .element_from_bottom1,.element_from_bottom2,.element_from_bottom3,.element_from_bottom4,.element_from_bottom5").length){ $j('.element_from_bottom, .element_from_bottom1,.element_from_bottom2,.element_from_bottom3,.element_from_bottom4,.element_from_bottom5').each(function(){ var $this = $j(this); $this.removeClass(); }); } if($j(".element_transform").length){ $j('.element_transform').each(function(){ var $this = $j(this); $this.removeClass(); }); } } } function initProjects(){ "use strict"; $j('.filter_holder').each(function(){ var filter_height = 0; $j(this).find('li.filter').each(function(){ filter_height += $j(this).height(); }); $j(this).on('click',function(data){ var $drop = $j(this), $bro = $drop.siblings('.hidden'); if(!$drop.hasClass('expanded')){ $drop.find('ul').css('z-index','100'); $drop.find('ul').height(filter_height+35); //35 is height of first default item $drop.addClass('expanded'); var label = $drop.find('.label span'); label.text(label.attr('data-label')); } else { $drop.find('ul').height(35); $drop.removeClass('expanded'); var $selected = $j(data.target), ndx = $selected.index(); if($bro.length){ $bro.find('option').removeAttr('selected').eq(ndx).attr('selected','selected').change(); } } }); }); $j('.filter_holder .filter').on('click',function(){ $j('.close_single_portfolio').click(); var $this = $j(this).text(); var dropLabels = $j('.filter_holder').find('.label span'); dropLabels.each(function(){ $j(this).text($this); }); }); $j('.projects_holder').mixitup({ showOnLoad: 'all', transitionSpeed: 600, minHeight: 150, onMixEnd: function(){ initPortfolioHover(); } }); } function resetFilter(){ "use strict"; var label = $j('.filter_holder').find('.label span'); label.text(label.attr('data-label')); $j('.filter_holder').find('li.filter').removeClass('active'); } function checkLogOnSmallestSize(){ "use strict"; if($j(window).width() > 420 && $j(window).width() < 801){ if(logo_height >= 80){ $j('.logo a').height(70); $j('.logo').css('padding','5px 0px 5px 0px'); }else{ var padding = (80-logo_height)/2; $j('.logo').css('padding',padding+'px 0px'); } } else if ($j(window).width() <= 420){ if(logo_height >= 60){ $j('.logo a').height(50); $j('.logo').css('padding','10px 0px 10px 0px'); }else{ var padding = (60-logo_height)/2; $j('.logo').css('padding',padding+'px 0px'); } } else { $j('.logo').css('padding','0px'); } }