jQuery(document).ready(function () { if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) { jQuery(".ArpPricingTableColumnWrapper").bind('touchstart', function () { }); } var mobile_view_width = jQuery('#arp_template_main_container').attr('data-mobile-width'); if (mobile_view_width == '') var device_width = 480; else var device_width = mobile_view_width; width = jQuery(window).width(); var template_type = ''; var preview = jQuery("#is_tbl_preview").val(); if (preview == 1) { jQuery("span.ribbontext_1").addClass('ribbontext_preview'); jQuery("span.ribbontext_2").addClass('ribbontext_preview'); } array = new Array(); var template = ''; jQuery('.arp_template_main_container').each(function () { template = jQuery(this).attr('data-arp-template'); jQuery('.' + template).find(".arp_allcolumnsdiv").find('.ArpPricingTableColumnWrapper').each(function (i) { if (jQuery(this).find('.arpcolumnheader').hasClass('has_arp_shortcode')) array[i] = 'has_header_scode'; else array[i] = 0; }); }); default_scode_position = new Array('arplitetemplate_1', 'arplitetemplate_11'); position_scode_2 = new Array('arplitetemplate_8'); if (jQuery.inArray(template, default_scode_position) > -1) { if (jQuery.inArray('has_header_scode', array) > -1) { jQuery('.' + template).find(".arp_allcolumnsdiv").find('.ArpPricingTableColumnWrapper').each(function (i) { jQuery(this).find('.arpcolumnheader').addClass('has_arp_shortcode'); div = jQuery('
'); if (!jQuery(this).find('.arpcolumnheader').find('div').hasClass('arp_header_shortcode')) { div.insertAfter(jQuery(this).find('.arpcolumnheader').find('.arppricetablecolumntitle')); } }); } } else if (jQuery.inArray(template, position_scode_2) > -1) { if (jQuery.inArray('has_header_scode', array) > -1) { jQuery('.' + template).find(".arp_allcolumnsdiv").find('.ArpPricingTableColumnWrapper').each(function (i) { jQuery(this).find('.arpcolumnheader').addClass('has_arp_shortcode'); div = jQuery(''); if (!jQuery(this).find('.arpcolumnheader').find('div').hasClass('arp_header_shortcode')) { jQuery(this).find('.arpcolumnheader').prepend(div); } }); } } if (template == 'arplitetemplate_8') { jQuery('.ArpPricingTableColumnWrapper').each(function () { jQuery(this).find('div.arp_header_shortcode').css('min-height', '100px'); }); } setTimeout(function () { arp_hide_blank_rows(); remove_column_height(); arp_header_title_responsive(); arp_price_text_responsive(); arp_price_label_responsive(); arp_short_code_responsive(); arp_price_wrapper_responsive(); adjust_column_height(); arp_column_desc_responsive(); set_best_plan_button_height(); arp_column_wrapper_height(); set_slider_height(); }, 1000); responsive_template_width_calculation(); jQuery('.ArpPricingTableColumnWrapper').each(function () { if (jQuery(this).hasClass('column_highlight')) { jQuery(this).attr('has_column_highlighted', 'true'); } else { jQuery(this).attr('has_column_highlighted', 'false'); } }); adjust_template_footer_height(); }); function responsive_template_width_calculation() { jQuery('.arp_template_main_container').each(function () { $this = jQuery(this); var container_width = $this.width(); var columns = $this.find('.ArpPricingTableColumnWrapper:visible').length; var toal_columns = $this.find('.ArpPricingTableColumnWrapper').length; var total_hidden_column = (toal_columns - columns); var display_col_mobile = 1; var display_col_tablet = 3; var display_col_desktop = $this.attr('data-column-desktop') var caption = $this.find('.ArpPricingTableColumnWrapper.maincaptioncolumn:visible').length; var mobile_width = $this.attr('data-mobile-width'); var tablet_width = $this.attr('data-tablet-width'); var current_width = jQuery(window).width(); var is_responsive = $this.attr('data-is-responsive'); var all_column_width = $this.attr('data-all-column-width'); var caption_custom_width = $this.find('.maincaptioncolumn').attr('has_custom_column_width'); var column_space = $this.attr('data-space-columns'); var responsive_width = $this.attr('data-responsive-width-arr'); responsive_width = jQuery.parseJSON(responsive_width); var desktop_width_include_space = responsive_width.with_space; var desktop_width_exclude_space = responsive_width.no_space; var width_inc_space = desktop_width_include_space[0]; var width_exc_space = desktop_width_exclude_space[0]; if (total_hidden_column > 0) { var width_exc_space_without_par = width_exc_space.replace('%', ''); width_exc_space_without_par = parseInt(width_exc_space_without_par); var tot_wid = (width_exc_space_without_par * toal_columns); width_exc_space = tot_wid / columns + '%'; var width_inc_space_without_par = width_inc_space.replace('%', ''); width_inc_space_without_par = parseInt(width_inc_space_without_par); var tot_space_wid = (width_inc_space_without_par * toal_columns); width_inc_space = (tot_space_wid / columns) + '%'; } if (current_width <= mobile_width) { jQuery('.arp_hidden_div').remove(); if (is_responsive == 1) { if (display_col_mobile == 'All' || (display_col_mobile > columns)) { display_col_mobile = columns; } else { var container_width = $this.css('width').replace('px', ''); container_width = parseInt(container_width); var display_cols = display_col_mobile; display_cols = parseInt(display_cols); if (column_space > 0) { var column_width = $this.find('.ArpPricingTableColumnWrapper:visible').css('width').replace('px', ''); column_width = parseInt(column_width); var actual_width = ((container_width / display_cols)); actual_width = actual_width - column_space; var final_width = ((actual_width * 100) / container_width); final_width = Math.floor(final_width); if (display_cols == 1) { final_width = 100; } if (caption_custom_width == 'true') { $this.find('.ArpPricingTableColumnWrapper:not(.maincaptioncolumn)').css('width', final_width + '%'); } else { $this.find('.ArpPricingTableColumnWrapper:visible').css('width', final_width + '%'); } } else { var column_width = 100 / parseInt(display_cols); if (caption_custom_width == 'true') { $this.find('.ArpPricingTableColumnWrapper:not(.maincaptioncolumn)').css('width', column_width + '%'); } else { $this.find('.ArpPricingTableColumnWrapper:visible').css('width', column_width + '%'); } } } } else { if (caption > 0 && caption_custom_width == 'true') { $this.find('.ArpPricingTableColumnWrapper:not(.maincaptioncolumn):visible').css('width', all_column_width + 'px'); } else { $this.find('.ArpPricingTableColumnWrapper:visible').css('width', all_column_width + 'px'); } $this.find('.ArpPricingTableColumnWrapper:visible').each(function (e) { if ((e + 1) % display_col_mobile == 0) { jQuery(this).after(''); } }); } } else if (current_width <= tablet_width && current_width > mobile_width) { jQuery('.arp_hidden_div').remove(); if (is_responsive == 1) { if (display_col_tablet == 'All' || (display_col_tablet > columns)) { display_col_tablet = columns; } else { var container_width = $this.css('width').replace('px', ''); container_width = parseInt(container_width); var display_cols = display_col_tablet; display_cols = parseInt(display_cols); if (column_space > 0) { var column_width = $this.find('.ArpPricingTableColumnWrapper:visible').css('width').replace('px', ''); column_width = parseInt(column_width); var actual_width = ((container_width / display_cols)); actual_width = actual_width - column_space; var final_width = ((actual_width * 100) / container_width); final_width = Math.floor(final_width); if (caption_custom_width == 'true') { $this.find('.ArpPricingTableColumnWrapper:not(.maincaptioncolumn)').css('width', final_width + '%'); } else { $this.find('.ArpPricingTableColumnWrapper:visible').css('width', final_width + '%'); } } else { var column_width = 100 / parseInt(display_cols); if (caption_custom_width == 'true') { $this.find('.ArpPricingTableColumnWrapper:not(.maincaptioncolumn)').css('width', column_width + '%'); } else { $this.find('.ArpPricingTableColumnWrapper:visible').css('width', column_width + '%'); } } } } else { if (caption > 0 && caption_custom_width == 'true') { $this.find('.ArpPricingTableColumnWrapper:not(.maincaptioncolumn):visible').css('width', all_column_width + 'px'); } else { $this.find('.ArpPricingTableColumnWrapper:visible').css('width', all_column_width + 'px'); } $this.find('.ArpPricingTableColumnWrapper:visible').each(function (e) { if ((e + 1) % display_col_tablet == 0) { jQuery(this).after(''); } }); } } else { jQuery('.arp_hidden_div').remove(); if (caption_custom_width == 'true') { $this.find('.ArpPricingTableColumnWrapper:not(.maincaptioncolumn)').css('width', ''); } else { $this.find('.ArpPricingTableColumnWrapper').css('width', '') } } }); } function arplite_redirect(re_url, is_new_tab, is_script, object, template_id, column_id) { var plan_id = jQuery('#' + column_id).attr('data-order'); var is_preview = jQuery(object).parents('.arp_template_main_container').attr('data-table-preview'); var ajaxurl_value = jQuery('#ajaxurl').val(); if (jQuery('#main_column_0').hasClass('maincaptioncolumn')) { var caption_column = 1; } else { var caption_column = 0; } if (is_preview == 0) { jQuery.ajax({ url: ajaxurl_value, type: 'POST', data: 'action=arplite_insert_plan_id&arp_template_id=' + template_id + '&arp_plan_id=' + plan_id + '&caption_column=' + caption_column, statusCode: { 401: function () { arpricelite_redirection_handler(is_script, object, re_url, is_new_tab); }, 403: function () { arpricelite_redirection_handler(is_script, object, re_url, is_new_tab); }, 400: function () { arpricelite_redirection_handler(is_script, object, re_url, is_new_tab); }, 404: function () { arpricelite_redirection_handler(is_script, object, re_url, is_new_tab); }, 500: function () { arpricelite_redirection_handler(is_script, object, re_url, is_new_tab); } }, success: function () { arpricelite_redirection_handler(is_script, object, re_url, is_new_tab); }, error: function () { arpricelite_redirection_handler(is_script, object, re_url, is_new_tab); }, }); } else { if (!/^https?:\/\//i.test(re_url) && re_url != "#" && re_url != "") { re_url = "http://" + re_url; } if (is_new_tab == '1') { var win = window.open(re_url, '_blank'); win.focus(); } else { location.href = re_url; } } } jQuery(window).load(function () { adjust_column_height(); }); jQuery(window).resize(function (e) { if (typeof (window.orientation) !== undefined && window.orientation < 1) { return false; } setTimeout(function () { remove_column_height(); arp_header_title_responsive(); arp_price_text_responsive(); arp_price_label_responsive(); arp_price_wrapper_responsive(); arp_short_code_responsive(); adjust_column_height(); arp_column_desc_responsive(); set_best_plan_button_height(); arp_column_wrapper_height(); set_slider_height(); arp_hide_blank_rows(); }, 1000); var mobile_view_width = jQuery('#arp_template_main_container').attr('data-mobile-width'); if (mobile_view_width == '') var device_width = 480; else var device_width = mobile_view_width; width = jQuery(window).width(); var template_type = ''; responsive_template_width_calculation(); }); function remove_column_height() { jQuery(".ArpTemplate_main").each(function () { cols = jQuery(this).find("ul.arppricingtablebodyoptions").length; var $this = jQuery(this); jQuery($this).find('li').css('height', ''); jQuery($this).find('li').css('min-height', ''); jQuery($this).find('li').css('line-height', ''); jQuery($this).find('li').css('padding', ''); }); } function adjust_column_height() { if( typeof arp_template_responsive_array_front === 'undefined' || !jQuery.isFunction(arp_template_responsive_array_front) ){ return; } var responsive_templates = arp_template_responsive_array_front(); var body_li_level_types = responsive_templates.body_li_level_types; var property = ''; var row_border = jQuery('#arp_template_main_container').attr('data-row-border'); var caption_row_border = jQuery('#arp_template_main_container').attr('data-caption-row-border'); jQuery(".ArpTemplate_main").each(function () { cols = jQuery(this).find(".arp_allcolumnsdiv").find(".ArpPricingTableColumnWrapper").length; $this = jQuery(this); var template = $this.parent().attr('data-reference-template'); if (body_li_level_types.type_1.indexOf(template) > -1) { property = 'min-height'; } else { property = 'height'; } jQuery(this).find(".ArpPricingTableColumnWrapper").each(function (x) { var $this_wrapper = jQuery(this); jQuery(this).find('ul.arp_opt_options li').each(function (y) { if ($this.find(".arpplan.maincaptioncolumn").is(':visible')) { var base_height = $this.find(".arpplan.maincaptioncolumn li#arp_row_" + y).height(); } if (base_height == null || base_height < 0) { var base_height = $this.find("ul.arp_opt_options li#arp_row_" + y).height(); } if (base_height < 0) { base_height = $this.find(".ArpPricingTableColumnWrapper:visible:first").find("ul.arp_opt_options li#arp_row_" + y).height(); } if (base_height > 0) { var height = $this_wrapper.filter(':visible').find('ul.arp_opt_options li#arp_row_' + y).height(); if (base_height > height) { jQuery($this).find("li#arp_row_" + y).css(property, (base_height)); } if (height > base_height) { if (height - base_height == caption_row_border) { jQuery($this).find("li#arp_row_" + y).css(property, (height)); } else { jQuery($this).find("li#arp_row_" + y).css(property, (height + 10)); } } if (height == 0) { jQuery($this).find('li#arp_row_' + y).css(property, base_height); } } if (base_height == 0) { if (x != 0) { height = $this_wrapper.find("ul.arp_opt_options li#arp_row_" + y).height(); if (height > base_height) { row_id = "arp_row_" + y; $this.find("li#" + row_id).css(property, height); } if (base_height > height) { row_id = "arp_row_" + y; $this.find("li#" + row_id).css(property, base_height); } } } }); }); }); arp_header_title_responsive(); } function adjust_column_title() { var base_height_arr = new Array(); var col_title_height_arr = new Array(); var sort_keys = new Array(); var base_height_json = ''; jQuery('.ArpPricingTableColumnWrapper').each(function (x) { var col_id = jQuery(this).attr('id'); var base_height = jQuery(this).find('.arpcolumnheader').height(); base_height_arr[x] = base_height; sort_keys[x] = base_height; if (jQuery(this).hasClass('maincaptioncolumn')) var col_title_height = jQuery(this).find('.arpcaptiontitle').height(); else var col_title_height = jQuery(this).find('.arppricetablecolumntitle').height(); col_title_height_arr[x] = col_title_height; }); sort_keys.sort(function (a, b) { return b - a; }); heighest_height = sort_keys[0]; var h_column_id = ''; for (var key in base_height_arr) { if (heighest_height == base_height_arr[key]) h_column_id = 'main_column_' + key; } var base_height = jQuery('#' + h_column_id).find('.arpcolumnheader').height(); if (jQuery('.ArpPricingTableColumnWrapper#' + h_column_id).hasClass('maincaptioncolumn')) var base_title_height = jQuery('#' + h_column_id).find('.arpcaptiontitle').height(); else var base_title_height = jQuery('#' + h_column_id).find('.bestPlanTitle').height(); jQuery('.ArpPricingTableColumnWrapper').each(function () { if (h_column_id != jQuery(this).attr('id')) { jQuery(this).find('.arpcolumnheader').height(base_height); if (jQuery(this).hasClass('maincaptioncolumn')) jQuery(this).find('.arpcaptiontitle').height(base_title_height); else jQuery(this).find('.arppricetablecolumntitle').height(base_title_height); } }); } function arp_header_title_responsive() { if( typeof arp_template_responsive_array_front === 'undefined' || !jQuery.isFunction(arp_template_responsive_array_front) ){ return; } var responsive_templates = arp_template_responsive_array_front(); var header_temp_obj_1 = responsive_templates.header_level_types_front_array_1; var header_temp_obj_2 = responsive_templates.header_level_types_front_array_2; var switch_front_radio_val = jQuery("#arprice_toggle_content_value").val(); jQuery('.arp_template_main_container').each(function () { var template = jQuery(this).attr('data-reference-template'); if (template && template != "") { if (header_temp_obj_1.type_1.indexOf(template) > -1) { jQuery('.ArpPricingTableColumnWrapper', this).each(function () { jQuery(this).find('.arpcolumnheader').css('height', 'auto'); jQuery(this).find('.arpcolumnheader').find('.bestPlanTitle,.arpcaptiontitle ').css('height', 'auto'); }); } else if (header_temp_obj_1.type_3.indexOf(template) > -1) { jQuery('.ArpPricingTableColumnWrapper', this).each(function () { jQuery(this).find('.arpcolumnheader').css('height', 'auto'); jQuery(this).find('.arpcolumnheader').find('.arppricetablecolumntitle').css('height', 'auto'); }); } else { jQuery('.ArpPricingTableColumnWrapper', this).each(function () { jQuery(this).find('.arpcolumnheader').find('.bestPlanTitle ').css('height', 'auto'); }); } var max_height = 0; if (header_temp_obj_1.type_1.indexOf(template) > -1) { jQuery('.ArpPricingTableColumnWrapper', this).each(function (x) { if (max_height < jQuery(this).find('.arpcolumnheader,.arpcaptiontitle ').height()) { max_height = jQuery(this).find('.arpcolumnheader,.arpcaptiontitle ').height(); } }); } else if (header_temp_obj_1.type_3.indexOf(template) > -1) { jQuery('.ArpPricingTableColumnWrapper', this).each(function (x) { if (max_height < jQuery(this).find('.arppricetablecolumntitle').height()) { max_height = jQuery(this).find('.arppricetablecolumntitle').height(); } }); } else { jQuery('.ArpPricingTableColumnWrapper', this).each(function (x) { var new_height = jQuery(this).find('.arpcolumnheader').find('.bestPlanTitle').height(); if (max_height < new_height) { max_height = new_height; } }); } if (header_temp_obj_2.type_4.indexOf(template) > -1) { jQuery('.ArpPricingTableColumnWrapper', this).each(function () { jQuery(this).find('.arpcolumnheader').height(max_height); jQuery(this).find('.arpcolumnheader').find('.arpcaptiontitle').height(max_height - 40); jQuery(this).find('.arpcolumnheader').find('.bestPlanTitle').height(max_height - 59); }); } else if (header_temp_obj_2.type_1.indexOf(template) > -1) { jQuery('.ArpPricingTableColumnWrapper', this).each(function () { jQuery(this).find('.arpcolumnheader').find('.bestPlanTitle').height(max_height); }); jQuery('.arpcaptiontitle', this).css('margin-top', jQuery('.ArpPricingTableColumnWrapper:not(.ArpPricingTableColumnWrapper.maincaptioncolumn)', this).first().find('.arppricetablecolumntitle').outerHeight() + 'px'); } else if (header_temp_obj_2.type_5.indexOf(template) > -1) { jQuery('.ArpPricingTableColumnWrapper', this).each(function () { jQuery(this).find('.arpcolumnheader').find('.arppricetablecolumntitle').height(max_height); }); jQuery('.arpcaptiontitle', this).css('margin-top', jQuery('.ArpPricingTableColumnWrapper:not(.ArpPricingTableColumnWrapper.maincaptioncolumn)', this).first().find('.arppricetablecolumntitle').outerHeight() + 'px'); } else if (header_temp_obj_2.type_2.indexOf(template) > -1) { jQuery('.ArpPricingTableColumnWrapper', this).each(function () { jQuery(this).find('.arpcolumnheader').find('.bestPlanTitle').height(max_height); }); jQuery('.arpcaptiontitle', this).css('margin-top', jQuery('.ArpPricingTableColumnWrapper:not(.ArpPricingTableColumnWrapper.maincaptioncolumn)', this).first().find('.arppricetablecolumntitle').outerHeight() - 1 + 'px'); } else { jQuery('.ArpPricingTableColumnWrapper', this).each(function () { jQuery(this).find('.arpcolumnheader').find('.bestPlanTitle').height(max_height); }); } } }); } function arp_price_text_responsive() { if( typeof arp_template_responsive_array_front === 'undefined' || !jQuery.isFunction(arp_template_responsive_array_front) ){ return; } var responsive_templates = arp_template_responsive_array_front(); var price_text_temp_obj = responsive_templates.price_level_types; jQuery('.arp_template_main_container').each(function () { var template = jQuery(this).attr('data-reference-template'); if (template && template != "" && price_text_temp_obj.type_1.indexOf(template) == -1) { jQuery('.ArpPricingTableColumnWrapper', this).each(function () { jQuery(this).find('.arp_price_value').css('height', 'auto'); }); var max_height = 0; jQuery('.ArpPricingTableColumnWrapper', this).each(function (x) { new_height = jQuery(this).find('.arp_price_value').height(); if (new_height && max_height < new_height) { max_height = jQuery(this).find('.arp_price_value').height(); } }); jQuery('.ArpPricingTableColumnWrapper', this).each(function () { jQuery(this).find('.arp_price_value').height(max_height); }); } if (template && template != "" && price_text_temp_obj.type_3.indexOf(template) > -1) { jQuery('.ArpPricingTableColumnWrapper', this).each(function () { jQuery(this).find('.arp_pricename').css('height', 'auto'); jQuery(this).find('.arpcaptiontitle').css('height', 'auto'); jQuery(this).find('.arpcaptiontitle').css('padding-top', '0'); }); var max_height = 0; jQuery('.ArpPricingTableColumnWrapper', this).each(function (x) { var new_height = jQuery(this).find('.arp_pricename').height(); if (new_height && max_height < new_height) { max_height = new_height; } }); jQuery('.ArpPricingTableColumnWrapper', this).each(function () { jQuery(this).find('.arp_pricename').height(max_height); jQuery(this).find('.arpcaptiontitle').height(max_height); jQuery(this).find('.arpcaptiontitle').css('padding-top', '39px'); }); } if (template && template != "" && price_text_temp_obj.type_4.indexOf(template) > -1) { jQuery('.ArpPricingTableColumnWrapper', this).each(function () { jQuery(this).find('.arp_price_wrapper').css('height', 'auto'); }); var max_height = 0; jQuery('.ArpPricingTableColumnWrapper', this).each(function (x) { var new_height = jQuery(this).find('.arp_price_wrapper').height(); if (new_height && max_height < new_height) { max_height = new_height; } }); jQuery('.ArpPricingTableColumnWrapper', this).each(function () { jQuery(this).find('.arp_price_wrapper').height(max_height); }); } }); } function arp_price_label_responsive() { if( typeof arp_template_responsive_array_front === 'undefined' || !jQuery.isFunction(arp_template_responsive_array_front) ){ return; } var responsive_templates = arp_template_responsive_array_front(); var price_label_temp_obj = responsive_templates.price_label_level_types; jQuery('.arp_template_main_container').each(function () { var template = jQuery(this).attr('data-reference-template'); if (template && template != "" && price_label_temp_obj.type_1.indexOf(template) == -1) { jQuery('.ArpPricingTableColumnWrapper', this).each(function () { jQuery(this).find('.arp_price_duration').css('height', 'auto'); }); var max_height = 0; jQuery('.ArpPricingTableColumnWrapper', this).each(function (x) { var new_height = jQuery(this).find('.arp_price_duration').height(); if (new_height && max_height < new_height) { max_height = jQuery(this).find('.arp_price_duration').height(); } }); jQuery('.ArpPricingTableColumnWrapper', this).each(function () { jQuery(this).find('.arp_price_duration').height(max_height); }); } }); } function arp_price_wrapper_responsive() { if( typeof arp_template_responsive_array_front === 'undefined' || !jQuery.isFunction(arp_template_responsive_array_front)){ return; } var responsive_templates = arp_template_responsive_array_front(); var price_wrapper_temp_obj = responsive_templates.price_wrapper_types; jQuery('.arp_template_main_container').each(function () { var template = jQuery(this).attr('data-reference-template'); if (template && price_wrapper_temp_obj.type_1.indexOf(template) > -1) { jQuery('.ArpPricingTableCOlumnWrapper', this).each(function () { jQuery(this).find('.arp_price_wrapper').css('height', 'auto'); }); var max_height = 0; jQuery('.ArpPricingTableColumnWrapper', this).each(function (x) { var new_height = jQuery(this).find('.arp_price_wrapper').height(); if (new_height && max_height < new_height) { max_height = jQuery(this).find('.arp_price_wrapper').height(); } }); jQuery('.ArpPricingTableColumnWrapper', this).each(function () { jQuery(this).find('.arp_price_wrapper').height(max_height); }); } if (template && price_wrapper_temp_obj.type_2.indexOf(template) > -1) { jQuery('.ArpPricingTableColumnWrapper', this).each(function () { jQuery(this).find('.arp_price_wrapper').css('height', 'auto'); jQuery(this).find('.arp_price_value').css('line-height', 'normal'); jQuery(this).find('.arp_price_duration').css('line-height', 'normal'); }); var max_height = 0; var value_line_height = 0; var duration_line_height = 0; jQuery('.ArpPricingTableColumnWrapper', this).each(function (x) { var new_height = jQuery(this).find('.arp_price_wrapper').height(); var price_value_line_height = jQuery(this).find('.arp_price_value').css('line-height'); var price_duration_line_height = jQuery(this).find('.arp_price_duration').css('line-height'); if (new_height && max_height < new_height) { max_height = jQuery(this).find('.arp_price_wrapper').height(); } price_value_line_height = parseInt(jQuery(this).find('.arp_price_value').css('font-size').replace('px', '')) * 1; var new_line_height = parseInt(price_value_line_height); if (new_line_height && value_line_height < new_line_height) { value_line_height = new_line_height; } price_duration_line_height = parseInt(jQuery(this).find('.arp_price_duration').css('font-size').replace('px', '')) * 1; new_line_height = parseInt(price_duration_line_height); if (new_line_height && duration_line_height < new_line_height) { duration_line_height = new_line_height; } }); jQuery('.ArpPricingTableColumnWrapper', this).each(function () { }); var new_class = 'arp_template_main_container_' + jQuery.now(); jQuery(this).addClass(new_class); if (jQuery(this).find('style#arp_template_main_container_adjust_style').length > 0) { jQuery(this).find('style#arp_template_main_container_adjust_style').remove(); } jQuery(this).append(''); } }); } if (jQuery.isFunction(jQuery().on)) { jQuery(document).on('mouseenter', '.ArpPricingTableColumnWrapper', function (event) { var parent_table = jQuery(this).parents('.ArpPriceTable').first(); if (jQuery(this).hasClass('maincaptioncolumn') == false) jQuery(parent_table).find('.ArpPricingTableColumnWrapper').removeClass('column_highlight'); }); jQuery(document).on('mouseleave', '.ArpPricingTableColumnWrapper', function (event) { jQuery('.ArpPricingTableColumnWrapper').each(function () { var has_column_highlighted = jQuery(this).attr('has_column_highlighted'); if (has_column_highlighted == 'true') { jQuery(this).addClass('column_highlight'); } }); }); } else { jQuery('.ArpPricingTableColumnWrapper').on('mouseenter', function (event) { var parent_table = jQuery(this).parents('.ArpPriceTable').first(); if (jQuery(this).hasClass('maincaptioncolumn') == false) { jQuery(parent_table).find('.ArpPricingTableColumnWrapper').removeClass('column_highlight'); } }); jQuery('.ArpPricingTableColumnWrapper').on('mouseleave', function (event) { jQuery('.ArpPricingTableColumnWrapper').each(function () { var has_column_highlighted = jQuery(this).attr('has_column_highlighted'); if (has_column_highlighted == 'true') { jQuery(this).addClass('column_highlight'); } }); }); } function set_best_plan_button_height() { if( typeof arp_template_responsive_array_front === 'undefined' || !jQuery.isFunction(arp_template_responsive_array_front) ){ return; } var responsive_templates = arp_template_responsive_array_front(); var btn_temp_obj = responsive_templates.button_level_types; jQuery('.arp_template_main_container').each(function () { var template = jQuery(this).attr('data-reference-template') if (btn_temp_obj.type_1.indexOf(template) > -1) { jQuery('.arppricetablebutton', this).each(function () { jQuery(this).height('auto'); }); var max_height = 0; jQuery('.arppricetablebutton', this).each(function () { if (max_height < jQuery(this).height()) { max_height = jQuery(this).height(); } }); jQuery('.arppricetablebutton', this).each(function () { jQuery(this).height(max_height); }); } }); } function arp_column_desc_responsive() { if( typeof arp_template_responsive_array_front === 'undefined' || !jQuery.isFunction(arp_template_responsive_array_front)){ return; } var responsive_templates = arp_template_responsive_array_front(); var col_desc_temp_obj = responsive_templates.column_description_types; var switch_front_radio_val = jQuery("#arprice_toggle_content_value").val(); jQuery('.arp_template_main_container').each(function () { var template = jQuery(this).attr('data-reference-template'); is_column_desc = jQuery(this).find('.column_description').length; if (template && template != "" && is_column_desc > 0 && col_desc_temp_obj.type_1.indexOf(template) == -1) { jQuery('.ArpPricingTableColumnWrapper', this).each(function () { jQuery(this).find('.column_description').css('height', 'auto'); }); var max_height = 0; jQuery('.ArpPricingTableColumnWrapper', this).each(function (x) { var new_height = jQuery(this).find('.column_description').height(); if (new_height && max_height < new_height) { max_height = new_height; } }); jQuery('.ArpPricingTableColumnWrapper', this).each(function () { jQuery(this).find('.column_description').height(max_height); }); } }); } function arp_column_wrapper_height() { jQuery('.arp_template_main_container').each(function () { var $this = jQuery(this); var mobile_width = $this.attr('data-mobile-width'); var is_animated = $this.attr('data-is-animated'); var hover_effect = $this.attr('data-hover-type'); var window_width = jQuery(window).width(); var plus_height = $this.attr('data-column-wrapper-width-arr'); plus_height = parseInt(plus_height); var column_max_height = 0; $this.find('.ArpPricingTableColumnWrapper:visible').each(function () { jQuery(this).css('height', ''); jQuery(this).css('margin-bottom', '20px') var column_height = jQuery(this).height(); if (hover_effect == 'hover_effect' && false === jQuery(this).hasClass('column_highlight')) { if (column_height > column_max_height) { column_max_height = column_height + plus_height; } } else if (hover_effect == 'hover_effect' && true === jQuery(this).hasClass('column_highlight')) { if (column_height > column_max_height) { column_max_height = column_height; } if (plus_height < 0) column_max_height = column_height + plus_height; } else { if (column_height > column_max_height) { column_max_height = jQuery(this).height() + 20; } } }); if (is_animated == 0) $this.find('.ArpPricingTableColumnWrapper:visible').each(function () { jQuery(this).css('height', column_max_height + 'px'); }); }); remove_column_height(); arp_header_title_responsive(); arp_price_text_responsive(); arp_price_label_responsive(); arp_price_wrapper_responsive(); adjust_column_height(); } function set_slider_height() { if( typeof arp_template_responsive_array_front === 'undefined' || !jQuery.isFunction(arp_template_responsive_array_front)){ return; } var responsive_templates = arp_template_responsive_array_front(); var slider_temp_obj = responsive_templates.slider_types; if (jQuery('.caroufredsel_wrapper').length > 0) { setTimeout(function () { jQuery('.arp_template_main_container').each(function () { var is_slide = jQuery(this).find('.ArpPriceTable').attr('data-animate'); if (is_slide && is_slide == 'true') { var template = jQuery(this).find('#arp_ref_template').val(); var slider_height = 0; jQuery('.ArpPricingTableColumnWrapper:not(.maincaptioncolumn)', this).each(function () { if (jQuery(this).is(':visible') && jQuery(this).height() && jQuery(this).height() > 0 && slider_height == 0) { if (parseInt(jQuery(this).find('.arpplan').outerHeight()) > parseInt(jQuery(this).height())) { slider_height = parseInt(jQuery(this).find('.arpplan').height()) + 44; } else { slider_height = parseInt(jQuery(this).height()) + 24; } } }); if (slider_temp_obj.type_1.indexOf(template) > -1) { slider_height = slider_height + 2; } else if (slider_temp_obj.type_2.indexOf(template) > -1) { slider_height = slider_height + 16; } else if (slider_temp_obj.type_3.indexOf(template) > -1) { slider_height = slider_height + 14; } else if (slider_temp_obj.type_4.indexOf(template) > -1) { slider_height = slider_height + 36; } if (slider_height > 0) { jQuery('.caroufredsel_wrapper', this).height(slider_height); } } }); }, 10); } } function adjust_template_footer_height() { jQuery('.arp_template_main_container').each(function () { var is_footer_content = 0; jQuery(this).find('.ArpPricingTableColumnWrapper').each(function () { if (jQuery(this).find('.arp_btn_before_content').is(':visible') === true) { is_footer_content++; } else if (jQuery(this).find('.arp_btn_after_content').is(':visible') === true) { is_footer_content++; } }); jQuery(this).find('.ArpPricingTableColumnWrapper').each(function () { if (is_footer_content > 0 && !jQuery(this).find('.arp_btn_before_content').is(':visible')) { var footer_content_position = jQuery(this).attr('data-column-footer-position'); if (footer_content_position == 0) { jQuery(this).find('.arpcolumnfooter').addClass('has_footer_content').addClass('footer_below_content'); jQuery(this).find('.arpcolumnfooter').find('.arp_btn_after_content').css('display', 'block'); } else if (footer_content_position == 1) { jQuery(this).find('.arpcolumnfooter').addClass('has_footer_content').addClass('footer_above_content'); jQuery(this).find('.arpcolumnfooter').find('.arp_btn_before_content').css('display', 'block'); } } }); if (is_footer_content > 0) { jQuery(this).find('.ArpPricingTableColumnWrapper.maincaptioncolumn').find('.arpcolumnfooter').addClass('has_footer_content'); } }); } function arp_hide_blank_rows() { jQuery('.arp_template_main_container').each(function () { var hide_blank_rows = jQuery(this).attr('data-hide-blank-rows'); if (hide_blank_rows == 'yes') { jQuery(this).find('.ArpPricingTableColumnWrapper').find('.arppricingtablebodycontent').each(function () { jQuery(jQuery(this).find('ul li').get().reverse()).each(function () { jQuery(this).removeClass("arp_hide_bottom_blank_row"); if (ArpisBlank(jQuery(this).text())) { jQuery(this).addClass("arp_hide_bottom_blank_row"); } else { return false; } }); }); } }); } function ArpisBlank(str) { return (!str || /^\s*$/.test(str)); } function arpricelite_redirection_handler(is_script, object, re_url, is_new_tab) { if (!/^https?:\/\//i.test(re_url) && re_url != "#" && re_url != "") { re_url = "http://" + re_url; } if (is_new_tab == '1') { var win = window.open(re_url, '_blank'); win.focus(); } else { location.href = re_url; } } function arp_short_code_responsive() { jQuery('.arp_template_main_container').each(function () { var arp_class = ''; var max_height = 0; var new_height = 0; var template = jQuery(this).attr('data-reference-template'); if (template === 'arplitetemplate_8') { arp_class = '.arp_header_shortcode' } else if (template === 'arplitetemplate_26' || template === 'arplitetemplate_2') { arp_class = '.arp_rounded_shortcode_wrapper' } else if (template === 'arplitetemplate_4') { arp_class = '.arpcolumnheader' } jQuery(this).find('.ArpPricingTableColumnWrapper').each(function () { jQuery(this).find(arp_class).css('height', 'auto'); }); jQuery(this).find('.ArpPricingTableColumnWrapper').each(function (x) { var new_height = jQuery(this).find(arp_class).height(); if (new_height && max_height < new_height) { max_height = jQuery(this).find(arp_class).height(); } }); jQuery(this).find('.ArpPricingTableColumnWrapper').each(function () { jQuery(this).find(arp_class).height(max_height); }); }); }