(function($) {
$( document ).ready(function() {
$('.site-header').after("");
$(".menu-toggle-container").append("");
$(".menu-toggle-container").append("");
$(".menu-toggle-container").append("");
var tempTop;
$('.sidebar-toggle-tab').click(function(){
//$('.sidebar').show();
tempTop = $(window).scrollTop();
$('.sidebar').animate({width:'toggle'},100);
//$('.footer-menu-overlay').css('width',$(window).width());
//$('.footer-menu-overlay').css('height',$(window).height());
$('body').css('position','fixed');
$('body').css('top',-tempTop);
//$('.footer-menu-overlay').show();
$('body').css('overflow','hidden');
});
$('.close-sidebar').click(function(){
//console.log('321');
$('.sidebar').hide();
$('.content').show();
$('.footer-widgets').show();
$('.footer-sec-bottom').show();
$('body').css('overflow','initial');
$('body').css('height','auto');
$('body').css('position','initial');
$(window).scrollTop(tempTop);
});
$('.menu-toggle-tab').click(function(){
//$('.site-footer').show();
//console.log($(window).scrollTop());
tempTop = $(window).scrollTop();
$('.site-footer').animate({width:'toggle'},100);
$('.footer-menu-overlay').css('width',$(window).width());
$('.footer-menu-overlay').css('height',$(window).height());
$('body').css('position','fixed');
$('body').css('top',-tempTop);
$('.footer-menu-overlay').show();
$('body').css('overflow','hidden');
});
$('.footer-menu-overlay').click(function(){
$('.site-footer').hide();
$('.sidebar').hide();
$('.footer-menu-overlay').hide();
$('body').css('overflow','initial');
$('body').css('height','auto');
$('body').css('position','initial');
$(window).scrollTop(tempTop);
});
if( $('body').hasClass('home') || $('body').hasClass('page-template-page_blog') ){
//console.log('not-removed');
} else {
$('.meta-pub-date').remove();
//console.log('pub-date-removed');
}
//console.log('js-loaded');
if( $('.post-content .post-meta').is(':visible') ){
} else {
$('.post-byline .post-date').css('display','block');
}
if (sessionStorage.clickcount) {
$('.mc-form1 #mc_embed_signup').addClass('perm-hide-noreverse');
$('#site-footer').css('padding-bottom','0px');
}
var lastScrollTop = 0;
var gaLimit = false;
var footReached = false;
$(window).scroll(function() {
//console.log('i');
if( gaLimit == false ) {
gaLimit = true;
ga('send', 'event', 'scroll', 'scroll', 'page-scroll');
setTimeout(function() {
gaLimit = false;
}, 20000);
}
//Hide sidebar ad when footer is shown
/*console.log($("#genesis-footer-widgets").offset().top);
console.log($(window).height());
console.log(($("#genesis-footer-widgets").offset().top - $(window).height()));
console.log($(window).scrollTop());
console.log('-------------');*/
if( $(window).scrollTop() > ($("#genesis-footer-widgets").offset().top - $(window).height()) ){
footReached = true;
$('#AdThrive_Sidebar_9_desktop').hide();
} else {
if( footReached == true ){
$('#AdThrive_Sidebar_9_desktop').show();
}
}
});
//Hide Email form until bottom on mobile devices
if( $(window).width() < 800 ){
$('.mc-form1 #mc_embed_signup').addClass('perm-hide');
} else {
$('.mc-form1 #mc_embed_signup').removeClass('perm-hide');
}
$('.bot-contact-img').click(function(){
//console.log('close');
$('.mc-form1 #mc_embed_signup').addClass('perm-hide-noreverse');
$('#site-footer').css('padding-bottom','0px');
sessionStorage.clickcount = 1;
});
//For Category Pages
if ($(".cat-pages")[0]){
$('.read-more-trans a').text('Continue reading');
var tempHtml;
//console.log($('.wpp-list li').length);
for( var i=1; i<$('.wpp-list li').length; i++ ){
tempHtml = '';
//console.log($('li:nth-child(' + i + ') .cat-excerpt').html());
//console.log($('li:nth-child(' + i + ') .cat-excerpt').html());
//console.log($('li:nth-child(' + i + ') .cat-excerpt').html().indexOf('\n'));
//console.log($('li:nth-child(' + i + ') .cat-excerpt').html().length);
tempHtml = $('.wpp-list li:nth-child(' + i + ') .cat-excerpt').html() + '';
//console.log(tempHtml);
tempHtml = tempHtml.replace("\n", "
", "g");
//console.log(tempHtml);
//console.log($('.cat-excerpt').html().indexOf('\n'));
$('.wpp-list li:nth-child(' + i + ') .cat-excerpt').html(tempHtml);
}
}
//Category Icons Side Bar
$('.cat-side').hover(function(){
$('img', this).attr('src','//financialpanther.com/wp-content/uploads/2017/04/side-hustle-icon-1-h.png');
}, function(){
$('img', this).attr('src','//financialpanther.com/wp-content/uploads/2017/04/side-hustle-icon-1-1.png');
});
$('.cat-debt').hover(function(){
$('img', this).attr('src','//financialpanther.com/wp-content/uploads/2017/04/debt-icon-h.png');
}, function(){
$('img', this).attr('src','//financialpanther.com/wp-content/uploads/2017/04/debt-icon.png');
});
$('.cat-save').hover(function(){
$('img', this).attr('src','//financialpanther.com/wp-content/uploads/2017/04/savings-icon-h.png');
}, function(){
$('img', this).attr('src','//financialpanther.com/wp-content/uploads/2017/04/savings-icon.png');
});
$('.cat-invest').hover(function(){
$('img', this).attr('src','//financialpanther.com/wp-content/uploads/2017/04/investing-icon-h.png');
}, function(){
$('img', this).attr('src','//financialpanther.com/wp-content/uploads/2017/04/investing-icon.png');
});
$('.cat-story').hover(function(){
$('img', this).attr('src','//financialpanther.com/wp-content/uploads/2017/04/my-story-icon1-h-1.png');
}, function(){
$('img', this).attr('src','//financialpanther.com/wp-content/uploads/2017/04/my-story-icon1.png');
});
$('.cat-fi').hover(function(){
$('img', this).attr('src','//financialpanther.com/wp-content/uploads/2017/04/fi-icon-h.png');
}, function(){
$('img', this).attr('src','//financialpanther.com/wp-content/uploads/2017/04/fi-icon.png');
});
$('.cat-tp').hover(function(){
$('img', this).attr('src','//financialpanther.com/wp-content/uploads/2017/04/top-posts-icon-h.png');
}, function(){
$('img', this).attr('src','//financialpanther.com/wp-content/uploads/2017/04/top-posts-icon.png');
});
$('.cat-travelhack').hover(function(){
$('img', this).attr('src','//financialpanther.com/wp-content/uploads/2017/04/travel-hacking-icon-h-1.png');
}, function(){
$('img', this).attr('src','//financialpanther.com/wp-content/uploads/2017/04/travel-hacking-icon.png');
});
//Mobile Menu
$('.mobile-menu-button').on('click', function() {
//console.log('1');
if($('.mobile-menu').is(':visible')){
$('.mobile-menu').hide();
$('.mobile-menu-button').text('Menu');
} else {
$('.mobile-menu').show();
$('.mobile-menu-button').text('Close');
}
});
$('.menu-toggle').click(function(){
$('.nav-primary').show();
});
//Side hustle hover
$('.side-hustle-income-link').hover(function(){
$('.sh-tiny-font').addClass('light-green-color');
$('.sh-tiny-font img').attr('src','//financialpanther.com/wp-content/uploads/2017/04/chart1-h.png');
}, function(){
$('.sh-tiny-font').removeClass('light-green-color');
$('.sh-tiny-font img').attr('src','//financialpanther.com/wp-content/uploads/2017/04/chart1.png');
});
$('.side-hustle-income-link').on('click', function() {
ga('send', 'event', 'sidebar-side-hustle', 'click', 'sidebar-side-hustle-income');
});
//Social Icons hover
$('.email-logo-h').hover(function(){
$(this).attr('src','//financialpanther.com/wp-content/uploads/2017/04/email-icon-h.png');
}, function(){
$(this).attr('src','//financialpanther.com/wp-content/uploads/2017/04/email-icon.png');
});
$('.fb-logo-h').hover(function(){
$(this).attr('src','//financialpanther.com/wp-content/uploads/2017/04/fb-icon-h.png');
}, function(){
$(this).attr('src','//financialpanther.com/wp-content/uploads/2017/04/fb-icon.png');
});
$('.twitter-logo-h').hover(function(){
$(this).attr('src','//financialpanther.com/wp-content/uploads/2017/04/twitter-icon-h.png');
}, function(){
$(this).attr('src','//financialpanther.com/wp-content/uploads/2017/04/twitter-icon.png');
});
$('.insta-logo-h').hover(function(){
$(this).attr('src','//financialpanther.com/wp-content/uploads/fp-instagram-1-h.png');
}, function(){
$(this).attr('src','//financialpanther.com/wp-content/uploads/fp-instagram-1.png');
});
$('.pin-logo-h').hover(function(){
$(this).attr('src','//financialpanther.com/wp-content/uploads/youtube-icon1-h.png');
}, function(){
$(this).attr('src','//financialpanther.com/wp-content/uploads/youtube-icon1.png');
});
$('.mp-cat-box').hover(function(){
$('.learn-more-button',this).css('background','#1a92a2');
}, function(){
$('.learn-more-button',this).css('background','#096f9b');
});
//For most commented section
$('.mc-title').click(function(){
if( $('.mc-title').hasClass('mc-title-selected') ){
//Do nothing
} else {
$('.mc-title').addClass('mc-title-selected');
$('.mp-title').removeClass('mc-title-selected');
$('img',this).attr('src','https://financialpanther.com/wp-content/uploads/commetn-b1.png');
$('.mc-title').css('color','#000');
$('.most-commented-side').show();
$('.most-popular-side').hide();
$('.mp-title img').attr('src','https://financialpanther.com/wp-content/uploads/popular-fade.png');
$('.mp-title').css('color','#999');
}
});
$('.mp-title').click(function(){
if( $('.mp-title').hasClass('mc-title-selected') ){
//Do nothing
//$('.mp-title').css('background','#f5f5f5');
} else {
//$('.mp-title').css('background','green');
$('.mp-title').addClass('mc-title-selected');
$('.mc-title').removeClass('mc-title-selected');
$('img',this).attr('src','https://financialpanther.com/wp-content/uploads/popular.png');
$('.mp-title').css('color','#000');
$('.most-commented-side').hide();
$('.most-popular-side').show();
$('.mc-title img').attr('src','https://financialpanther.com/wp-content/uploads/comment-fade.png');
$('.mc-title').css('color','#999');
}
});
//Money Making Resources Open New Window Hover
$('.mmr-col1').hover(function(){
$("a img",this).attr('src','https://financialpanther.com/wp-content/uploads/new-window-h.png');
}, function(){
$("a img",this).attr('src','https://financialpanther.com/wp-content/uploads/new-window.png');
});
//Money Making Resources show more
$('.mmr-resources-sec').on('click touch', function () {
$('img',this).attr('src','https://financialpanther.com/wp-content/uploads/down-arrow1.png');
$(this).css('cursor','default');
$('.mmr-resources',this).addClass('no-text-decoration');
$('.mmr-long-col',this).show();
});
//Money Making Resources RATINGS show more
$('.rating-sec').on('click touch', function () {
$('.ratings-right-arrow',this).attr('src','https://financialpanther.com/wp-content/uploads/down-arrow1.png');
$(this).css('cursor','default');
$('span',this).addClass('no-text-decoration');
$('p',this).show();
});
//Get URL to see if coming from welcome email
var currUrl = window.location.href;
if (currUrl.indexOf('#welcome') > -1){
$('.welcome-text').show();
}
//Reorder MMR List Based on Radio Buttons
$('input[type=radio][name=group-apps]').change(function() {
if (this.value == 'ta') {
//console.log('ta');
/*$('#apps-container > div').each(function(){
var num = Number($(this)[0].className.substring($(this)[0].className.indexOf('ta-')+3,$(this)[0].className.indexOf('ta-')+5));
var tempName =
})*/
for (var i=1; i<=25; i++){
if (i == 1){
$('.ta-1').prependTo('#apps-container');
} else {
var tempName1 = '.ta-' + i;
var tempName2 = '.ta-' + (i-1);
$(tempName1).insertAfter(tempName2);
}
}
} else if (this.value == 'cate') {
//console.log('cate');
for (var i=1; i<=25; i++){
if (i == 1){
$('.cg-1').prependTo('#apps-container');
} else {
var tempName1 = '.cg-' + i;
var tempName2 = '.cg-' + (i-1);
$(tempName1).insertAfter(tempName2);
}
}
} else if (this.value == 'alpha') {
//console.log('alpha');
for (var i=1; i<=25; i++){
if (i == 1){
$('.az-1').prependTo('#apps-container');
} else {
var tempName1 = '.az-' + i;
var tempName2 = '.az-' + (i-1);
$(tempName1).insertAfter(tempName2);
}
}
}
});
var currSHI = 2;
var updateSHI = function(){
if(currSHI == 1){
$('.sh-promo-img1').css('left','270px');
$('.sh-promo-img2').animate({left: '-270px'},500);
$('.sh-promo-img1').animate({left: '0px'},500);
currSHI = 2;
} else if(currSHI == 2){
$('.sh-promo-img2').css('left','270px');
$('.sh-promo-img1').animate({left: '-270px'},500);
$('.sh-promo-img2').animate({left: '0px'},500);
currSHI = 1;
} /*else if(currSHI == 3){
$('.sh-promo-img3').css('left','270px');
$('.sh-promo-img2').animate({left: '-270px'},500);
$('.sh-promo-img3').animate({left: '0px'},500);
currSHI = 4;
} else if(currSHI == 4){
$('.sh-promo-img4').css('left','270px');
$('.sh-promo-img3').animate({left: '-270px'},500);
$('.sh-promo-img4').animate({left: '0px'},500);
currSHI = 5;
} else if(currSHI == 5){
$('.sh-promo-img5').css('left','270px');
$('.sh-promo-img4').animate({left: '-270px'},500);
$('.sh-promo-img5').animate({left: '0px'},500);
currSHI = 1;
}*/
};
//Side Hustle Promo
if ( $('.sh-signup1').length){
window.setInterval(function(){
updateSHI();
}, 6000);
}
//Most commented
$('.mc-title').hover(function(){
if( $('.mc-title').hasClass('mc-title-selected') ){
//Do nothing
} else {
$('img',this).attr('src','https://financialpanther.com/wp-content/uploads/comment-blue.png');
$('.mc-title').css('color','#096f9b');
}
}, function(){
if( $('.mc-title').hasClass('mc-title-selected') ){
//Do nothing
} else {
$('img',this).attr('src','https://financialpanther.com/wp-content/uploads/comment-fade.png');
$('.mc-title').css('color','#999');
}
});
$('.mp-title').hover(function(){
if( $('.mp-title').hasClass('mc-title-selected') ){
//Do nothing
} else {
$('img',this).attr('src','https://financialpanther.com/wp-content/uploads/popular-blue.png');
$('.mp-title').css('color','#096f9b');
}
}, function(){
if( $('.mp-title').hasClass('mc-title-selected') ){
//Do nothing
} else {
$('img',this).attr('src','https://financialpanther.com/wp-content/uploads/popular-fade.png');
$('.mp-title').css('color','#999');
}
});
//Stats for top main section
$('.offers-box a:nth-child(1)').click(function(){
ga('send', 'event', 'main-bonuses-top', 'click', 'chime');
});
$('.offers-box a:nth-child(2)').click(function(){
ga('send', 'event', 'main-bonuses-top', 'click', 'm1');
});
$('.offers-box a:nth-child(3)').click(function(){
ga('send', 'event', 'main-bonuses-top', 'click', 'brex');
});
$('.offers-box a:nth-child(4)').click(function(){
ga('send', 'event', 'main-bonuses-top', 'click', 'sofi-money');
});
$('.offers-box a:nth-child(5)').click(function(){
ga('send', 'event', 'main-bonuses-top', 'click', 'lili');
});
$('.offers-box a:nth-child(6)').click(function(){
ga('send', 'event', 'main-bonuses-top', 'click', 'sofi-invest');
});
$('.offers-box a:nth-child(7)').click(function(){
ga('send', 'event', 'main-bonuses-top', 'click', 'yieldstreet');
});
$('.pop-posts-box a:nth-child(1)').click(function(){
ga('send', 'event', 'main-pop-posts-top', 'click', 'bank-bonuses');
});
$('.pop-posts-box a:nth-child(2)').click(function(){
ga('send', 'event', 'main-pop-posts-top', 'click', 'gig-apps');
});
$('.pop-posts-box a:nth-child(3)').click(function(){
ga('send', 'event', 'main-pop-posts-top', 'click', 'how-5-interest');
});
$('.pop-posts-box a:nth-child(4)').click(function(){
ga('send', 'event', 'main-pop-posts-top', 'click', 'where-5-interest');
});
//Hide ads that appear before and after images
console.log("========== 1 ====================");
var numClasses = $('.has-image-child').length;
var idAdName;
//console.log(numClasses);
for (var i = 0; i < numClasses; i++) {
if( ($('.has-image-child')[i].previousElementSibling.id).indexOf('AdThrive_Content') > -1){
idAdName = "#" + $('.has-image-child')[i].previousElementSibling.id;
//console.log(idAdName);
$(idAdName).addClass( "adSelected" );
}
if( ($('.has-image-child')[i].nextElementSibling.id).indexOf('AdThrive_Content') > -1){
idAdName = "#" + $('.has-image-child')[i].nextElementSibling.id;
$(idAdName).addClass( "adSelected" );
//console.log(idAdName);
}
}
//Hide ads that appear 2 SPOTS before and after images
for (var i = 0; i < numClasses; i++) {
if( ($('.has-image-child')[i].previousElementSibling.previousElementSibling.id).indexOf('AdThrive_Content') > -1){
idAdName = "#" + $('.has-image-child')[i].previousElementSibling.previousElementSibling.id;
//console.log(idAdName);
$(idAdName).addClass( "adSelected" );
}
if( ($('.has-image-child')[i].nextElementSibling.nextElementSibling.id).indexOf('AdThrive_Content') > -1){
idAdName = "#" + $('.has-image-child')[i].nextElementSibling.nextElementSibling.id;
$(idAdName).addClass( "adSelected" );
//console.log(idAdName);
}
}
//Hide ads that are only 1 paragraph apart
var numAds = $('.adthrive-ad').length;
console.log(numAds);
for (var i = 0; i < numAds; i++) {
if( $('.adthrive-ad')[i].previousElementSibling.previousElementSibling != null ){
if( ($('.adthrive-ad')[i].previousElementSibling.previousElementSibling.id).indexOf('AdThrive_Content') > -1){
idAdName = "#" + $('.adthrive-ad')[i].previousElementSibling.previousElementSibling.id;
//console.log(idAdName);
$(idAdName).addClass( "adSelected" );
}
}
}
//Hide ads below post, in comments
$(".adthrive-below-post").hide();
});
//Convert all credit cards
jQuery('a').each(function(i, obj) {
//console.log(jQuery(this).attr('href'));
/*if( jQuery(this).attr('href') == "https://financialpanther.com/chasesapphirereserve" ) {
jQuery(this).replaceWith(function() {
return 'card_name';
});
} else if ( jQuery(this).attr('href') == "https://financialpanther.com/chasepreferred" ) {
jQuery(this).replaceWith(function() {
return 'card_name';
});
} else if ( jQuery(this).attr('href') == "https://financialpanther.com/chaseinkcash" ) {
jQuery(this).replaceWith(function() {
return 'card_name';
});
} else if ( jQuery(this).attr('href') == "https://financialpanther.com/chaseinkunlimited" ) {
jQuery(this).replaceWith(function() {
return 'card_name';
});
} else if ( jQuery(this).attr('href') == "https://financialpanther.com/chaseink" ) {
jQuery(this).replaceWith(function() {
return 'card_name';
});
} else if ( jQuery(this).attr('href') == "https://financialpanther.com/southwestpremierbusiness" ) {
jQuery(this).replaceWith(function() {
return 'card_name';
});
} */
if ( jQuery(this).attr('href') == "https://financialpanther.com/deltagoldbusiness" ) {
jQuery(this).replaceWith(function() {
return 'card_name';
});
} /*else if ( jQuery(this).attr('href') == "https://financialpanther.com/citibusinessaa" ) {
jQuery(this).replaceWith(function() {
return 'card_name';
});
}*/ else if ( jQuery(this).attr('href') == "https://financialpanther.com/deltaplatinumbusiness" ) {
jQuery(this).replaceWith(function() {
return 'card_name';
});
} else if ( jQuery(this).attr('href') == "https://financialpanther.com/americanexpressbusinessgold" ) {
jQuery(this).replaceWith(function() {
return 'card_name';
});
} /*else if ( jQuery(this).attr('href') == "https://financialpanther.com/southwestplus" ) {
jQuery(this).replaceWith(function() {
return 'card_name';
});
}*/ else if ( jQuery(this).attr('href') == "https://financialpanther.com/hiltonbiz" ) {
jQuery(this).replaceWith(function() {
return 'card_name';
});
};
/*
} else if ( jQuery(this).attr('href') == "https://financialpanther.com/hyatt" ) {
jQuery(this).replaceWith(function() {
return 'card_name';
});
} else if ( jQuery(this).attr('href') == "https://financialpanther.com/southwestperformancebusiness" ) {
jQuery(this).replaceWith(function() {
return 'card_name';
});
} else if ( jQuery(this).attr('href') == "https://financialpanther.com/southwestpriority" ) {
jQuery(this).replaceWith(function() {
return 'card_name';
});
} else if ( jQuery(this).attr('href') == "https://financialpanther.com/southwestpremier" ) {
jQuery(this).replaceWith(function() {
return 'card_name';
});
}/*
/*else if ( jQuery(this).attr('href') == "xxxxxxxxxxxxxx" ) {
jQuery(this).replaceWith(function() {
return 'xxxxxxxxxxx';
});
}*/
});
//console.log("snippet test");
//console.log($("body").hasClass("single-post"));
//console.log($(".type-post").hasClass("category-articles"));
console.log("------------------------------------------ Article Author check");
console.log(!$(".type-post").hasClass("category-articles"));
if( !$(".type-post").hasClass("category-articles") ){
jQuery('
By: Kevin Ha ').insertBefore(jQuery(".entry-meta"));
}
//Add articles to footer of Archives page
$(".page-id-788 .financial-panther-footer-sub").append('');
})( jQuery );