jQuery(document).ready(function($) { "use strict"; // Fly-Out Navigation $(".mvp-fly-but-click").on('click', function(){ $("#mvp-fly-wrap").toggleClass("mvp-fly-menu"); $("#mvp-fly-wrap").toggleClass("mvp-fly-shadow"); $(".mvp-fly-but-wrap").toggleClass("mvp-fly-open"); $(".mvp-fly-fade").toggleClass("mvp-fly-fade-trans"); }); // Back to Top Button var duration = 500; $('.back-to-top').on('click', function(event) { event.preventDefault(); $('html, body').animate({scrollTop: 0}, duration); return false; }); // Search Toggle $(".mvp-search-click").on('click', function(){ $("#mvp-search-wrap").toggleClass("mvp-search-toggle"); }); // Mobile Social Toggle $(".mvp-mob-soc-click").on('click', function(){ $(".mvp-mob-soc-list").toggleClass("mvp-mob-soc-tog"); }); // Trending Toggle $(".mvp-post-trend-but-click").on('click', function(){ $("#mvp-post-trend-wrap").toggleClass("mvp-post-trend-tog"); }); // Comments Toggle $(".mvp-com-click").on('click', function(){ $("#comments").show(); $("#disqus_thread").show(); $("#mvp-comments-button").hide(); }); // Continue Reading Toggle $(".mvp-ad-rel-click").on('click', function(){ $("#mvp-content-main").css('max-height','none'); $('#mvp-ad-rel-wrap').css('margin-top','20px'); $("#mvp-ad-rel-top").hide(); }); // Columns Toggle $('.mvp-feat1-right-wrap').each(function() { $(this).find(".mvp-tab-col-cont").hide(); //Hide all content $(this).find("ul.mvp-feat1-list-buts li.mvp-feat-col-tab").addClass("active").show(); //Activate first tab $(this).find(".mvp-tab-col-cont:first").show(); //Show first tab content }); $("ul.mvp-feat1-list-buts li").on('click', function(e) { $(this).parents('.mvp-feat1-right-wrap').find("ul.mvp-feat1-list-buts li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tab $(this).parents('.mvp-feat1-right-wrap').find(".mvp-tab-col-cont").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content $(this).parents('.mvp-feat1-right-wrap').find(activeTab).fadeIn(); //Fade in the active ID content e.preventDefault(); }); $("ul.mvp-feat1-list-buts li a").on('click', function(e) { e.preventDefault(); }); // Widget Columns Toggle $('.mvp-widget-tab-wrap').each(function() { $(this).find(".mvp-tab-col-cont").hide(); //Hide all content $(this).find("ul.mvp-feat1-list-buts li.mvp-feat-col-tab").addClass("active").show(); //Activate first tab $(this).find(".mvp-tab-col-cont:first").show(); //Show first tab content }); $("ul.mvp-feat1-list-buts li").on('click', function(e) { $(this).parents('.mvp-widget-tab-wrap').find("ul.mvp-feat1-list-buts li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tab $(this).parents('.mvp-widget-tab-wrap').find(".mvp-tab-col-cont").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content $(this).parents('.mvp-widget-tab-wrap').find(activeTab).fadeIn(); //Fade in the active ID content e.preventDefault(); }); $("ul.mvp-feat1-list-buts li a").on('click', function(e) { e.preventDefault(); }); }); // Scoreboard (function( window, $, undefined ) { $.fn.touchwipe = function(settings) { var config = { min_move_x: 20, min_move_y: 20, wipeLeft: function() { }, wipeRight: function() { }, wipeUp: function() { }, wipeDown: function() { }, preventDefaultEvents: true }; if (settings) $.extend(config, settings); this.each(function() { var startX; var startY; var isMoving = false; function cancelTouch() { this.removeEventListener('touchmove', onTouchMove); startX = null; isMoving = false; } function onTouchMove(e) { if(config.preventDefaultEvents) { e.preventDefault(); } if(isMoving) { var x = e.touches[0].pageX; var y = e.touches[0].pageY; var dx = startX - x; var dy = startY - y; if(Math.abs(dx) >= config.min_move_x) { cancelTouch(); if(dx > 0) { config.wipeLeft(); } else { config.wipeRight(); } } else if(Math.abs(dy) >= config.min_move_y) { cancelTouch(); if(dy > 0) { config.wipeDown(); } else { config.wipeUp(); } } } } function onTouchStart(e) { if (e.touches.length == 1) { startX = e.touches[0].pageX; startY = e.touches[0].pageY; isMoving = true; this.addEventListener('touchmove', onTouchMove, false); } } if ('ontouchstart' in document.documentElement) { this.addEventListener('touchstart', onTouchStart, false); } }); return this; }; $.elastislide = function( options, element ) { this.$el = $( element ); this._init( options ); }; $.elastislide.defaults = { speed : 450, // animation speed easing : '', // animation easing effect imageW : 190, // the images width margin : 0, // image margin right border : 0, // image border minItems : 1, // 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 carousel will make sure this item is visible onClick : function() { return false; } // click item callback }; $.elastislide.prototype = { _init : function( options ) { this.options = $.extend( true, {}, $.elastislide.defaults, options ); //