//function to trim the titles
function trimTitles(titleClass, heightLimit) {
jQuery(titleClass).each(function(){
var cuHeight = jQuery(this).height();
if(cuHeight > heightLimit) { //set height if bigger than 81px
jQuery(this).css({'height':heightLimit, 'overflow': 'hidden'});
}
});
}
//function usage
if($(window).width()>991){
trimTitles('.mobile-owl-carousel h4.title',42);
}
No comments:
Post a Comment