/** ** menu-trigger plugins. **/ $(function(){ $(".menu-trigger").on('click', function() { $(this).toggleClass('active'); $(".menu_open").fadeToggle(); $(".gnav li").removeClass('active'); }); }); /** ** back to top fadein plugins. **/ $(function(){ $('#pagetop a').click(function () { $('body,html').animate({ scrollTop: 0 }, 1000); return false; }); }); /** ** scrollFadein animetion plugins. **/ $(document).ready(function(){ $('.effect').css({ 'opacity': '0', 'position': 'relative', 'bottom': '-30px' }); $('.effect_reverse').css({ 'opacity': '0', 'position': 'relative', 'top': '-30px' }); $(window).scroll(function (){ $('.effect').each(function(){ var imgPos = $(this).offset().top; var scroll = $(window).scrollTop(); var windowHeight = $(window).height(); var startheight = 150; if (scroll > imgPos - windowHeight + startheight){ $(this).animate({ 'opacity': '1', 'bottom': '0' }, 850); } }); $('.effect_reverse').each(function(){ var imgPos = $(this).offset().top; var scroll = $(window).scrollTop(); var windowHeight = $(window).height(); var startheight = 150; if (scroll > imgPos - windowHeight + startheight){ $(this).animate({ 'opacity': '1', 'top': '0' }, 1050); } }); }); }); /** ** anchorlink plugins. **/ $(function(){ $('.anchorlink').click(function() { var speed = 700; var href= $(this).attr("href"); var target = $(href == "#" || href == "" ? 'html' : href); var position = target.offset().top; $('body,html').animate({scrollTop:position}, speed, 'swing'); return false; }); }); /** ** magnificPopup settings. **/ $(function(){ $('.future .btn_link a').magnificPopup({ type: 'inline', preloader: false }); $('.popupmovie').magnificPopup({ type: 'iframe', mainClass: 'mfp-fade', disableOn: 0, removalDelay: 160, preloader: false, fixedContentPos: false, closeMarkup: '' }); $('.module-more .pic01 li a').magnificPopup({ type: 'image', closeMarkup: '' }); $('.grid li a').magnificPopup({ type: 'image', closeMarkup: '', gallery: { enabled: true } }); $(document).on('click', '.modal-dismiss', function (e) { e.preventDefault(); $.magnificPopup.close(); }); });