From: Anthony Talarico Date: Fri, 12 Aug 2016 20:56:20 +0000 (-0400) Subject: reducing the max character count for blocks at specific view width. max is down to... X-Git-Tag: v1.0.0^2~126 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=b0f006ce5319fda4282cd43d2aaebda51f6f0601;p=WP-Themes%2Fpetoskeyarea.git reducing the max character count for blocks at specific view width. max is down to 11 at 640 to 667 --- diff --git a/js/app.js b/js/app.js index cde400b..a778dfd 100644 --- a/js/app.js +++ b/js/app.js @@ -136,9 +136,25 @@ $(document).ready(function () { }); + var view_btn = $(".view-all"); + var block = $('.glm-block'); + var btn_text_length, btn_text; + // initialize the slick sliders on the events and blocks front page function check_window_width(){ - var block = $('.glm-block'); + + if($(window).width() < 667 && $(window).width() > 639){ + $(view_btn).each( function (){ + btn_text = $(this).text(); + btn_text_length = $(this).text().length; + console.log(btn_text_length); + + if(btn_text_length > 12){ + $(this).text(btn_text.substr(0,12)); + } + }); + } + if( $(window).width() == 640 ){ $(block).css("margin", "0 -15px"); } diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index fe8769f..2ec0dfe 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -127,9 +127,25 @@ $(document).ready(function () { }); + var view_btn = $(".view-all"); + var block = $('.glm-block'); + var btn_text_length, btn_text; + // initialize the slick sliders on the events and blocks front page function check_window_width(){ - var block = $('.glm-block'); + + if($(window).width() < 667 && $(window).width() > 639){ + $(view_btn).each( function (){ + btn_text = $(this).text(); + btn_text_length = $(this).text().length; + console.log(btn_text_length); + + if(btn_text_length > 12){ + $(this).text(btn_text.substr(0,12)); + } + }); + } + if( $(window).width() == 640 ){ $(block).css("margin", "0 -15px"); }