{"id":2038,"date":"2024-05-05T19:36:11","date_gmt":"2024-05-05T18:36:11","guid":{"rendered":"https:\/\/poshangyan.com\/?page_id=2038"},"modified":"2024-05-05T19:39:31","modified_gmt":"2024-05-05T18:39:31","slug":"2038-2","status":"publish","type":"page","link":"https:\/\/poshangyan.com\/index.php\/2038-2\/","title":{"rendered":"Check Your BMI"},"content":{"rendered":"\n\t\t<style>\n          #calc_wrapper{\n          \t--family-calc-vis:dm sans,sans-serif;\n            --title-color:#fff;\n            --values-color:#394f5c;\n            --text-color:#000;\n          }\n\n          .toggle-switch {\n  display: inline-block;\n  position: relative;\n  width: 30px;\n  height: 17px;\n  margin-left:15px;\n  margin-top: 4px;\n}\n\n.toggle-switch input {\n  display: none;\n}\n\n.toggle-switch-slider {\n  position: absolute;\n  cursor: pointer;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  background-color: #ccc;\n  border-radius: 17px;\n  transition: 0.4s;\n}\n\n.toggle-switch-slider:before {\n  position: absolute;\n  content: \"\";\n  height: 13px;\n  width: 13px;\n  left: 2px;\n  bottom: 2px;\n  background-color: white;\n  border-radius: 50%;\n  transition: 0.4s;\n}\n\ninput:checked + .toggle-switch-slider {\n  background-color: #4f94d4;\n}\n\ninput:checked + .toggle-switch-slider:before {\n  transform: translateX(13px);\n}\n\n.imperial_inputs{\n    display:none;\n}\n    \t\t<\/style>\n\n\n        <div class=\"calc_wrapper\" id=\"calc_wrapper\">\n            <div class=\"calc_header\">\n                <div class=\"calc_header_left\">\n                                        <div class=\"calc_header_title\">\n                        BMI Calculator                    <\/div>\n                                                            <div class=\"calc_header_desc\">\n                        Use this calculator to check your body mass index (BMI).                    <\/div>\n                                    <\/div>\n                                <a href=\"https:\/\/www.calculator.io\/bmi-calculator\/\" target=\"_blank\" style=\"text-decoration: none;\">\n                                <div class=\"calc_header_right\">\n                    <img src=\"https:\/\/poshangyan.com\/wp-content\/plugins\/bmi-adultkid-calculator\/images\/bmiberegner.png\" alt=\"BMI Calculator\">\n                <\/div>\n                                <\/a>\n                            <\/div>\n            <div class=\"custom_flex_calc_wrapper\">\n\n\n                <div class=\"calc_data\">\n\n                    \n                        <style>\n                            .button-group {\n                                display: flex;\n\t\t\t\t\t\t\t\twidth:100%\n                            }\n\n                            input[type=\"radio\"][name=\"units_checkbox\"] {\n                                display: none;\n                            }\n\n                            .radio-label {\n                                padding: 5px 10px;\n                                margin: 0;\n                                color: black;\n                                background-color: #cccccc;\n                                cursor: pointer;\n                                transition: all 0.3s ease;\n                            }\n\n                            input[type=\"radio\"]:checked + .radio-label {\n                                color: white;\n                                background-color: #4f94d4;\n                            }\n                            label[for=\"metric\"]{\n                                border-radius:5px 0 0  5px ;\n                            }\n                            label[for=\"imperial\"]{\n                                border-radius:0 5px 5px  0;\n                            }\n                        <\/style>\n                        <div class=\"button-group\" style=\"margin-bottom:16px;align-items: center;\">\n                            <span class=\"switcher_color\" style=\"width:100%\">\n                            Unit type                            <\/span>\n\n                            <input type=\"radio\" id=\"metric\" name=\"units_checkbox\" value=\"metric\" checked>\n                            <label for=\"metric\" class=\"radio-label\">Metric<\/label>\n\n                            <input type=\"radio\" id=\"imperial\" name=\"units_checkbox\" value=\"imperial\">\n                            <label for=\"imperial\" class=\"radio-label\">Imperial<\/label>\n                        <\/div>\n                        \n                        <div class=\"metric_inputs\">\n                            <div class=\"calc_data_height\">\n                                <span for=\"calc_height_input\">\n                                    Height                                <\/span>\n                                <input id=\"calc_height_input\" class=\"calc_input_custom\" type=\"text\" placeholder=\"Your height\">\n                                <div class=\"calc_placeholder\">\n                                    cm.                                <\/div>\n                            <\/div>\n                            <div for=\"calc_height_input\" class=\"alert-mess\">\n                                Please enter value between 125 and 225.                            <\/div>\n                            <div class=\"calc_data_weight\">\n                                <span for=\"calc_weight_input\">\n                                    Weight                                <\/span>\n                                <input id=\"calc_weight_input\"  class=\"calc_input_custom\" type=\"text\" placeholder=\"Your weight\">\n                                <div class=\"calc_placeholder\">\n                                    kg.                                <\/div>\n                            <\/div>\n                            <div for=\"calc_weight_input\" class=\"alert-mess\">\n                                Please enter value between 10.0 and 500.0 ( one decimal ).                            <\/div>\n\n                        <\/div>\n\n\n                        <div class=\"imperial_inputs\">\n                            <div class=\"calc_data_height\">\n                                <span for=\"calc_height_input\">\n                                    Height                                <\/span>\n                                <div class=\"custom_flex_wrapper\">\n                                    <input id=\"calc_height_input_ft\" style=\"width:45%\" class=\"calc_input_custom\" type=\"text\" placeholder=\"\">\n                                    <input id=\"calc_height_input_in\" style=\"width:45%\" class=\"calc_input_custom\" type=\"text\" placeholder=\"\">\n                                    <div class=\"calc_placeholder year\">\n                                        ft.                                    <\/div>\n                                    <div class=\"calc_placeholder\">\n                                        in.                                    <\/div>\n                                <\/div>\n                            <\/div>\n                            <div for=\"calc_height_input_ft\" class=\"alert-mess\">\n                                Please enter value between 4.2 and 7.3                            <\/div>\n                            <div class=\"calc_data_weight\">\n                                <span for=\"calc_weight_input\">\n                                    Weight                                <\/span>\n                                <div class=\"custom_flex_wrapper\">\n                                    <input id=\"calc_weight_input_lb\" style=\"width:45%\" class=\"calc_input_custom\" type=\"text\" placeholder=\"\">\n                                    <input id=\"calc_weight_input_st\" style=\"width:45%\" class=\"calc_input_custom\" type=\"text\" placeholder=\"\">\n                                    <div class=\"calc_placeholder year\">\n                                        lb.                                    <\/div>\n                                    <div class=\"calc_placeholder\">\n                                        st.                                    <\/div>\n                                <\/div>\n                            <\/div>\n                            <div for=\"calc_weight_input_lb\" class=\"alert-mess\">\n                                Please enter value between 22.0 and 1000.0 ( one decimal ).                            <\/div>\n                        <\/div>\n\n                        <div class=\"calc_input_button\" id=\"calc_input_button\">\n                            Calculate BMI  <img style=\"width:9px;height:12px\" src=\"https:\/\/poshangyan.com\/wp-content\/plugins\/bmi-adultkid-calculator\/images\/Arrow.png\" >\n                        <\/div>\n\n\n\n                <\/div>\n\n\n\n\n                <div class=\"calc_info\">\n                    <div class=\"calc_info_placeholder e1714934080\">\n                        Use this calculator to check your body mass index (BMI), which can be a helpful tool in determining your weight category. Or, use it to calculate your child\u2019s BMI.                    <\/div>\n                    <div class=\"calc_info_data e1714934080\" style=\"display:none\">\n                        <div class=\"calc_info_data_title\">\n                            Your Body Mass Index (BMI) is                        <\/div>\n                        <div style=\"margin-bottom:50px\" class=\"calc_info_data_value\" id=\"calc_bmi\">\n                        <\/div>\n                        <div class=\"calc_info_data_title\">\n                            Based on your input, your BMI is in the category                        <\/div>\n                        <div class=\"calc_info_data_value\" id=\"calc_conclusion\">\n                        <\/div>\n                        <div class=\"calc_info_line\">\n                            <div class=\"calc_info_line_result_wrapper\">\n                                <div class=\"calc_info_line_result\">\n                                    You                                <\/div>\n                            <\/div>\n\n                            <div class=\"calc_info_line_underweight\">\n                                Underweight                            <\/div>\n                            <div class=\"calc_info_line_healthy\">\n                                Healthy                            <\/div>\n                            <div class=\"calc_info_line_overweight\">\n                                Overweight                            <\/div>\n                            <div class=\"calc_info_line_obese\">\n                                Obese                            <\/div>\n                        <\/div>\n\n\n                        <div class=\"calc_info_conclusion\" id=\"calc_info_conclusion\">\n                            For your height, a healthy weight would be between <span id=\"healthy_weight\" class=\"calc_info_data_value\"><\/span> kilograms                        <\/div>\n\n                        <div class=\"calc_info_conclusion\" id=\"calc_info_conclusionLb\" style=\"display:none\">\n                            For your height, a healthy weight would be between <span id=\"healthy_weightLb\" class=\"calc_info_data_value\"><\/span> lb.                        <\/div>\n\n\n\n                    <\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n\n    <script>\n    document.addEventListener('DOMContentLoaded', function(){\n        (function( $ ) {\n\n\n            var units = 'metric';\n\n            $('input[name=\"units_checkbox\"]').on('change',function(){\n                if ($(this).val() == 'imperial')\n                {\n                    $('.imperial_inputs').css('display','block');\n                    $('.metric_inputs').css('display','none');\n\n\n                    units = 'imperial';\n                }else{\n                    $('.imperial_inputs').css('display','none');\n                    $('.metric_inputs').css('display','block');\n\n\n                    units = 'metric';\n                }\n            })\n\n\n            function moveRect(e){\n                switch(e.key){\n\n                    case \"Enter\":  \/\/ \u0435\u0441\u043b\u0438 \u043d\u0430\u0436\u0430\u0442\u0430 \u043a\u043b\u0430\u0432\u0438\u0448\u0430 \u0432\u043b\u0435\u0432\u043e\n                        var can = true;\n                        if(units == 'metric'){\n                            $('#calc_height_input').each(function(){\n                                if(parseInt($(this).val()) < 125 || parseInt($(this).val()) > 225 || !Number.isInteger(parseInt($(this).val())) || $(this).val()[0]=='0'){\n                                    $('.alert-mess[for=\"'+$(this).attr('id')+'\"]').css('opacity','1');\n                                    $(this).addClass('alert');\n                                    can = false;\n                                }else{\n                                    $('.alert-mess[for=\"'+$(this).attr('id')+'\"]').css('opacity','0');\n                                    $(this).removeClass('alert');\n                                    height = $(this).val()\n                                }\n\n\n                            })\n                            $('#calc_weight_input').each(function(){\n\n                                    if(parseFloat($(this).val()) < 10 || parseFloat($(this).val()) > 500 || fweight(parseFloat($(this).val())) > 1 || parseFloat($(this).val())!=$(this).val() || $(this).val()[0]=='0'){\n                                        $('.alert-mess[for=\"'+$(this).attr('id')+'\"]').css('opacity','1');\n                                        $(this).addClass('alert');\n                                        can = false;\n                                    }else{\n                                        $('.alert-mess[for=\"'+$(this).attr('id')+'\"]').css('opacity','0');\n                                        $(this).removeClass('alert');\n                                        weight = parseFloat($(this).val());\n                                    }\n\n                            })\n                            \/\/console.log(can);\n                            if(can){\n                                                                $('#calc_input_button').html('Recalculate BMI  <img src=\"https:\/\/poshangyan.com\/wp-content\/plugins\/bmi-adultkid-calculator\/images\/Vector Smart Object.png\" >');\n                                $('#calc_input_button').addClass('re');\n\n                                var bmi = (parseFloat(weight)\/(parseInt(height)\/100*parseInt(height)\/100)).toFixed(2);\n                                console.log(bmi);\n                                if( bmi <=18.49 ){\n                                    $('.calc_info_placeholder.e1714934080').css('display','none');\n                                    $('.calc_info_data.e1714934080').css('display','block');\n                                    $('#calc_bmi').html(bmi);\n                                    $('#calc_conclusion').html('Underweight');\n                                    var left = 0;\n                                    if(bmi > 12){\n\n                                        left = (bmi - 12)*($('.calc_info_line_underweight').width()\/6.5);\n                                        console.log(left);\n                                    }\n                                    $('.calc_info_line_result_wrapper').css('left',(left-30)+'px' );\n                                }\n                                if(bmi >= 18.5 && bmi <=24.99 ){\n                                    $('.calc_info_placeholder.e1714934080').css('display','none');\n                                    $('.calc_info_data.e1714934080').css('display','block');\n                                    $('#calc_bmi').html(bmi);\n                                    $('#calc_conclusion').html('Healthy');\n\n                                    var left = 0;\n                                    if(bmi > 18.5){\n                                        left = (bmi - 18.5)*($('.calc_info_line_healthy').width()\/6.5);\n                                    }\n                                    $('.calc_info_line_result_wrapper').css('left',((left+$('.calc_info_line_underweight').width())-30)+'px' );\n                                }\n                                if(bmi >= 25 && bmi <=29.99 ){\n                                    $('.calc_info_placeholder.e1714934080').css('display','none');\n                                    $('.calc_info_data.e1714934080').css('display','block');\n                                    $('#calc_bmi').html(bmi);\n                                    $('#calc_conclusion').html('Overweight');\n                                    var left = 0;\n                                    if(bmi > 25){\n                                        left = (bmi - 25)*($('.calc_info_line_overweight').width()\/5);\n                                    }\n                                    $('.calc_info_line_result_wrapper').css('left',((left+$('.calc_info_line_underweight').width()+$('.calc_info_line_healthy').width())-30)+'px' );\n                                }\n                                if(bmi >= 30 ){\n                                    $('.calc_info_placeholder.e1714934080').css('display','none');\n                                    $('.calc_info_data.e1714934080').css('display','block');\n                                    $('#calc_bmi').html(bmi);\n                                    $('#calc_conclusion').html('Obese');\n                                    var left = 0;\n                                    if(bmi > 30){\n                                        left = (bmi - 30)*($('.calc_info_line_obese').width()\/5);\n                                    }\n                                    if(bmi > 35){\n                                        left = $('.calc_info_line_obese').width();\n                                    }\n                                    $('.calc_info_line_result_wrapper').css('left',((left+$('.calc_info_line_underweight').width()+$('.calc_info_line_healthy').width() +$('.calc_info_line_overweight').width())-30)+'px' );\n                                }\n                                var healthy_min = Math.round(18.5 * (parseInt(height)\/100*parseInt(height)\/100));\n                                var healthy_max = Math.round(24.99 * (parseInt(height)\/100*parseInt(height)\/100));\n\n\n\n                                if(units == 'metric'){\n                                    $('#healthy_weight').html(healthy_min+' - '+healthy_max);\n                                    $('#calc_info_conclusionLb').css('display','none');\n                                    $('#calc_info_conclusion').css('display','block');\n                                }else{\n                                    $('#healthy_weightLb').html(Math.round(healthy_min*2.20462)+' - '+Math.round(healthy_max*2.20462));\n                                    $('#calc_info_conclusionLb').css('display','block');\n                                    $('#calc_info_conclusion').css('display','none');\n                                }\n                                \/\/$('#healthy_weightLb').html(Math.round(healthy_min*2.20462)+' - '+Math.round(healthy_max*2.20462));\n\n\n                                                            }\n                        }else{\n\n\n\n\n\n\n\n\n                            var feets = $('#calc_height_input_ft').val();\n                            var inches = $('#calc_height_input_in').val();\n                            if(isNaN(parseFloat(feets))){\n                                feets = 0;\n                            }\n                            if(isNaN(parseFloat(inches))){\n                                inches = 0;\n                            }\n                            var height_imp = ((parseFloat(feets) + parseFloat(inches) \/ 12) * 30.48).toFixed(0);\n\n                            if(height_imp < 125 || height_imp > 225 ){\n                                $('.alert-mess[for=\"calc_height_input_ft\"]').css('opacity','1');\n                                $('#calc_height_input_ft').addClass('alert');\n                                $('#calc_height_input_in').addClass('alert');\n                                can = false;\n                            }else{\n                                $('.alert-mess[for=\"calc_height_input_ft\"]').css('opacity','0');\n                                $('#calc_height_input_ft').removeClass('alert');\n                                $('#calc_height_input_in').removeClass('alert');\n                            }\n\n                            height = height_imp;\n\n\n                            var pounds = $('#calc_weight_input_lb').val();\n                            var stones = $('#calc_weight_input_st').val();\n                            if(isNaN(parseFloat(pounds))){\n                                pounds = 0;\n                            }\n                            if(isNaN(parseFloat(stones))){\n                                stones = 0;\n                                console.log('alo')\n                            }\n                            var weight_imp = ((parseFloat(pounds) + parseFloat(stones) \/ 14) \/ 2.20462 ).toFixed(0);\n\n                            if(weight_imp < 10 || weight_imp > 500){\n                                $('.alert-mess[for=\"calc_weight_input_lb\"]').css('opacity','1');\n                                $('#calc_weight_input_lb').addClass('alert');\n                                $('#calc_weight_input_st').addClass('alert');\n                                can = false;\n                            }else{\n                                $('.alert-mess[for=\"calc_weight_input_lb\"]').css('opacity','0');\n                                $('#calc_weight_input_lb').removeClass('alert');\n                                $('#calc_weight_input_st').removeClass('alert');\n                            }\n                            console.log(parseFloat(stones))\n                            weight = weight_imp;\n                            \/\/console.log(can);\n                            if(can){\n                                                                $('#calc_input_button').html('Recalculate BMI  <img src=\"https:\/\/poshangyan.com\/wp-content\/plugins\/bmi-adultkid-calculator\/images\/Vector Smart Object.png\" >');\n                                $('#calc_input_button').addClass('re');\n\n                                var bmi = (parseFloat(weight)\/(parseInt(height)\/100*parseInt(height)\/100)).toFixed(2);\n                                console.log(bmi);\n                                if( bmi <=18.49 ){\n                                    $('.calc_info_placeholder.e1714934080').css('display','none');\n                                    $('.calc_info_data.e1714934080').css('display','block');\n                                    $('#calc_bmi').html(bmi);\n                                    $('#calc_conclusion').html('Underweight');\n                                    var left = 0;\n                                    if(bmi > 12){\n\n                                        left = (bmi - 12)*($('.calc_info_line_underweight').width()\/6.5);\n                                        console.log(left);\n                                    }\n                                    $('.calc_info_line_result_wrapper').css('left',(left-30)+'px' );\n                                }\n                                if(bmi >= 18.5 && bmi <=24.99 ){\n                                    $('.calc_info_placeholder.e1714934080').css('display','none');\n                                    $('.calc_info_data.e1714934080').css('display','block');\n                                    $('#calc_bmi').html(bmi);\n                                    $('#calc_conclusion').html('Healthy');\n\n                                    var left = 0;\n                                    if(bmi > 18.5){\n                                        left = (bmi - 18.5)*($('.calc_info_line_healthy').width()\/6.5);\n                                    }\n                                    $('.calc_info_line_result_wrapper').css('left',((left+$('.calc_info_line_underweight').width())-30)+'px' );\n                                }\n                                if(bmi >= 25 && bmi <=29.99 ){\n                                    $('.calc_info_placeholder.e1714934080').css('display','none');\n                                    $('.calc_info_data.e1714934080').css('display','block');\n                                    $('#calc_bmi').html(bmi);\n                                    $('#calc_conclusion').html('Overweight');\n                                    var left = 0;\n                                    if(bmi > 25){\n                                        left = (bmi - 25)*($('.calc_info_line_overweight').width()\/5);\n                                    }\n                                    $('.calc_info_line_result_wrapper').css('left',((left+$('.calc_info_line_underweight').width()+$('.calc_info_line_healthy').width())-30)+'px' );\n                                }\n                                if(bmi >= 30 ){\n                                    $('.calc_info_placeholder.e1714934080').css('display','none');\n                                    $('.calc_info_data.e1714934080').css('display','block');\n                                    $('#calc_bmi').html(bmi);\n                                    $('#calc_conclusion').html('Obese');\n                                    var left = 0;\n                                    if(bmi > 30){\n                                        left = (bmi - 30)*($('.calc_info_line_obese').width()\/5);\n                                    }\n                                    if(bmi > 35){\n                                        left = $('.calc_info_line_obese').width();\n                                    }\n                                    $('.calc_info_line_result_wrapper').css('left',((left+$('.calc_info_line_underweight').width()+$('.calc_info_line_healthy').width() +$('.calc_info_line_overweight').width())-30)+'px' );\n                                }\n                                var healthy_min = Math.round(18.5 * (parseInt(height)\/100*parseInt(height)\/100));\n                                var healthy_max = Math.round(24.99 * (parseInt(height)\/100*parseInt(height)\/100));\n\n                                if(units == 'metric'){\n                                    $('#healthy_weight').html(healthy_min+' - '+healthy_max);\n                                    $('#calc_info_conclusionLb').css('display','none');\n                                    $('#calc_info_conclusion').css('display','block');\n                                }else{\n                                    $('#healthy_weightLb').html(Math.round(healthy_min*2.20462)+' - '+Math.round(healthy_max*2.20462));\n                                    $('#calc_info_conclusionLb').css('display','block');\n                                    $('#calc_info_conclusion').css('display','none');\n                                }\n\n\n\n\n                                \n                            }\n\n\n\n\n\n\n\n                        }\n                        break;\n                }\n            }\n            function check_imperial(can){\n                var feets = $('#calc_height_input_ft').val();\n                var inches = $('#calc_height_input_in').val();\n                if(isNaN(parseFloat(feets))){\n                    feets = 0;\n                }\n                if(isNaN(parseFloat(inches))){\n                    inches = 0;\n                }\n                var height_imp = ((parseFloat(feets) + parseFloat(inches) \/ 12) * 30.48).toFixed(0);\n\n                if(height_imp < 125 || height_imp > 225 ){\n                    $('.alert-mess[for=\"calc_height_input_ft\"]').css('opacity','1');\n                    $('#calc_height_input_ft').addClass('alert');\n                    $('#calc_height_input_in').addClass('alert');\n                    can = false;\n                }else{\n                    $('.alert-mess[for=\"calc_height_input_ft\"]').css('opacity','0');\n                    $('#calc_height_input_ft').removeClass('alert');\n                    $('#calc_height_input_in').removeClass('alert');\n                }\n\n                height = height_imp;\n\n\n                var pounds = $('#calc_weight_input_lb').val();\n                var stones = $('#calc_weight_input_st').val();\n                if(isNaN(parseFloat(pounds))){\n                    pounds = 0;\n                }\n                if(isNaN(parseFloat(stones))){\n                    stones = 0;\n                    console.log('alo')\n                }\n                var weight_imp = ((parseFloat(pounds) + parseFloat(stones) \/ 14) \/ 2.20462 ).toFixed(0);\n\n                if(weight_imp < 10 || weight_imp > 500){\n                    $('.alert-mess[for=\"calc_weight_input_lb\"]').css('opacity','1');\n                    $('#calc_weight_input_lb').addClass('alert');\n                    $('#calc_weight_input_st').addClass('alert');\n                    can = false;\n                }else{\n                    $('.alert-mess[for=\"calc_weight_input_lb\"]').css('opacity','0');\n                    $('#calc_weight_input_lb').removeClass('alert');\n                    $('#calc_weight_input_st').removeClass('alert');\n                }\n                console.log(parseFloat(stones))\n                weight = weight_imp;\n                return can;\n            }\n            addEventListener(\"keydown\", moveRect);\n            const fweight = x => ( (x.toString().includes('.')) ? (x.toString().split('.').pop().length) : (0) );\n            var height = '';\n            var weight = '';\n            var checkingRegExp = new RegExp(\/^(\\d)$\/g);\n            $('#calc_height_input').on('input',function(){\n                if(\/^[\\d.]*$\/.test($(this).val())  && $(this).val().split(\".\").length < 3){\n                    height = $(this).val();\n                }else{\n                    $(this).val(height);\n                }\n\n                if(parseInt($(this).val()) < 125 || parseInt($(this).val()) > 225 || !Number.isInteger(parseInt($(this).val())) || $(this).val()[0]=='0'){\n                    $('.alert-mess[for=\"'+$(this).attr('id')+'\"]').css('opacity','1');\n                    $(this).addClass('alert');\n                }else{\n                    $('.alert-mess[for=\"'+$(this).attr('id')+'\"]').css('opacity','0');\n                    $(this).removeClass('alert');\n                }\n            })\n            $('#calc_weight_input').on('input',function(){\n                if(\/^[\\d.]*$\/.test($(this).val()) && $(this).val().split(\".\").length < 3 ){\n                    weight = $(this).val();\n                }else{\n                    $(this).val(weight);\n                }\n                    if(parseFloat($(this).val()) < 10 || parseFloat($(this).val()) > 500 || fweight(parseFloat($(this).val())) > 1 || parseFloat($(this).val())!=$(this).val() || $(this).val()[0]=='0'){\n                        $('.alert-mess[for=\"'+$(this).attr('id')+'\"]').css('opacity','1');\n                        $(this).addClass('alert');\n                        can = false;\n                    }else{\n                        $('.alert-mess[for=\"'+$(this).attr('id')+'\"]').css('opacity','0');\n                        $(this).removeClass('alert');\n                    }\n            })\n            var prev1 = 0;\n            var prev2 = 0;\n            var prev3 = 0;\n            var prev4 = 0;\n\n            $('#calc_height_input_ft').on('input',function(){\n                if(\/^[\\d.]*$\/.test($(this).val())){\n                    prev1 = $(this).val();\n                }else{\n                    $(this).val(prev1);\n                }\n                var can = check_imperial(true);\n            })\n            $('#calc_height_input_in').on('input',function(){\n                if(\/^[\\d.]*$\/.test($(this).val())){\n                    prev2 = $(this).val();\n                }else{\n                    $(this).val(prev2);\n                }\n                var can = check_imperial(true);\n            })\n            $('#calc_weight_input_lb').on('input',function(){\n                if(\/^[\\d.]*$\/.test($(this).val())){\n                    prev3 = $(this).val();\n                }else{\n                    $(this).val(prev3);\n                }\n                var can = check_imperial(true);\n            })\n            $('#calc_weight_input_st').on('input',function(){\n                if(\/^[\\d.]*$\/.test($(this).val())){\n                    prev4 = $(this).val();\n                }else{\n                    $(this).val(prev4);\n                }\n                var can = check_imperial(true);\n            })\n\n\n\n\n\n\n\n\n            $('#calc_input_button').on('click',function(){\n                var can = true;\n\n\n                if(units == 'metric'){\n\n\n                    $('#calc_height_input').each(function(){\n\n\n                            if(parseInt($(this).val()) < 125 || parseInt($(this).val()) > 225 || !Number.isInteger(parseInt($(this).val())) || $(this).val()[0]=='0'){\n                                $('.alert-mess[for=\"'+$(this).attr('id')+'\"]').css('opacity','1');\n                                $(this).addClass('alert');\n                                can = false;\n                            }else{\n                                $('.alert-mess[for=\"'+$(this).attr('id')+'\"]').css('opacity','0');\n                                $(this).removeClass('alert');\n                                height = $(this).val();\n                            }\n\n                    })\n                    $('#calc_weight_input').each(function(){\n\n\n                            if(parseFloat($(this).val()) < 10 || parseFloat($(this).val()) > 500 || fweight(parseFloat($(this).val())) > 1 || parseFloat($(this).val())!=$(this).val() || $(this).val()[0]=='0'){\n                                $('.alert-mess[for=\"'+$(this).attr('id')+'\"]').css('opacity','1');\n                                $(this).addClass('alert');\n                                can = false;\n                            }else{\n                                $('.alert-mess[for=\"'+$(this).attr('id')+'\"]').css('opacity','0');\n                                $(this).removeClass('alert');\n                                weight = $(this).val();\n                            }\n\n                    })\n                }else{\n\n                    if(can){\n                        can = check_imperial(true);\n                    }\n\n\n                }\n                \/\/console.log(can);\n                if(can){\n                    \n                    $('#calc_input_button').html('Recalculate BMI  <img src=\"https:\/\/poshangyan.com\/wp-content\/plugins\/bmi-adultkid-calculator\/images\/Vector Smart Object.png\" >');\n                    $('#calc_input_button').addClass('re');\n                    console.log(weight)\n                    console.log(height)\n                    var bmi = (parseFloat(weight)\/(parseInt(height)\/100*parseInt(height)\/100)).toFixed(2);\n                    console.log(bmi);\n                    if( bmi <=18.49 ){\n                        $('.calc_info_placeholder.e1714934080').css('display','none');\n                        $('.calc_info_data.e1714934080').css('display','block');\n                        $('#calc_bmi').html(bmi);\n                        $('#calc_conclusion').html('Underweight');\n                        var left = 0;\n                        if(bmi > 12){\n\n                            left = (bmi - 12)*($('.calc_info_line_underweight').width()\/6.5);\n                            console.log(left);\n                        }\n                        $('.calc_info_line_result_wrapper').css('left',(left-30)+'px' );\n                    }\n                    if(bmi >= 18.5 && bmi <=24.99 ){\n                        $('.calc_info_placeholder.e1714934080').css('display','none');\n                        $('.calc_info_data.e1714934080').css('display','block');\n                        $('#calc_bmi').html(bmi);\n                        $('#calc_conclusion').html('Healthy');\n\n                        var left = 0;\n                        if(bmi > 18.5){\n                            left = (bmi - 18.5)*($('.calc_info_line_healthy').width()\/6.5);\n                        }\n                        $('.calc_info_line_result_wrapper').css('left',((left+$('.calc_info_line_underweight').width())-30)+'px' );\n                    }\n                    if(bmi >= 25 && bmi <=29.99 ){\n                        $('.calc_info_placeholder.e1714934080').css('display','none');\n                        $('.calc_info_data.e1714934080').css('display','block');\n                        $('#calc_bmi').html(bmi);\n                        $('#calc_conclusion').html('Overweight');\n                        var left = 0;\n                        if(bmi > 25){\n                            left = (bmi - 25)*($('.calc_info_line_overweight').width()\/5);\n                        }\n                        $('.calc_info_line_result_wrapper').css('left',((left+$('.calc_info_line_underweight').width()+$('.calc_info_line_healthy').width())-30)+'px' );\n                    }\n                    if(bmi >= 30 ){\n                        $('.calc_info_placeholder.e1714934080').css('display','none');\n                        $('.calc_info_data.e1714934080').css('display','block');\n                        $('#calc_bmi').html(bmi);\n                        $('#calc_conclusion').html('Obese');\n                        var left = 0;\n                        if(bmi > 30){\n                            left = (bmi - 30)*($('.calc_info_line_obese').width()\/5);\n                        }\n                        if(bmi > 35){\n                            left = $('.calc_info_line_obese').width();\n                        }\n                        $('.calc_info_line_result_wrapper').css('left',((left+$('.calc_info_line_underweight').width()+$('.calc_info_line_healthy').width() +$('.calc_info_line_overweight').width())-30)+'px' );\n                    }\n                    var healthy_min = Math.round(18.5 * (parseInt(height)\/100*parseInt(height)\/100));\n                    var healthy_max = Math.round(24.99 * (parseInt(height)\/100*parseInt(height)\/100));\n\n                    if(units == 'metric'){\n                        $('#healthy_weight').html(healthy_min+' - '+healthy_max);\n                        $('#calc_info_conclusionLb').css('display','none');\n                        $('#calc_info_conclusion').css('display','block');\n                    }else{\n                        $('#healthy_weightLb').html(Math.round(healthy_min*2.20462)+' - '+Math.round(healthy_max*2.20462));\n                        $('#calc_info_conclusionLb').css('display','block');\n                        $('#calc_info_conclusion').css('display','none');\n                    }\n\n                                }\n            })\n        })( jQuery );\n})\n\n    <\/script>\n    \n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"poshangyan.com","author_link":"https:\/\/poshangyan.com\/index.php\/author\/poshangyan-com\/"},"uagb_comment_info":0,"uagb_excerpt":null,"_links":{"self":[{"href":"https:\/\/poshangyan.com\/index.php\/wp-json\/wp\/v2\/pages\/2038"}],"collection":[{"href":"https:\/\/poshangyan.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/poshangyan.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/poshangyan.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/poshangyan.com\/index.php\/wp-json\/wp\/v2\/comments?post=2038"}],"version-history":[{"count":4,"href":"https:\/\/poshangyan.com\/index.php\/wp-json\/wp\/v2\/pages\/2038\/revisions"}],"predecessor-version":[{"id":2043,"href":"https:\/\/poshangyan.com\/index.php\/wp-json\/wp\/v2\/pages\/2038\/revisions\/2043"}],"wp:attachment":[{"href":"https:\/\/poshangyan.com\/index.php\/wp-json\/wp\/v2\/media?parent=2038"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}