function td_updateMetaboxes() { var cur_selection = jQuery('#reviewSelector option:selected').text(); if(cur_selection.indexOf("No") !== -1) { //alert('ra'); jQuery('.rating_type').hide(); jQuery('.review_desc').hide(); } else { jQuery('.rating_type').hide(); jQuery('.rate_' + cur_selection).show(); jQuery('.review_desc').show(); //alert(cur_selection); } } jQuery(document).ready(function($) { td_updateMetaboxes(); $('#reviewSelector').change(function() { td_updateMetaboxes(); }); $('.radio-post-template-wrapper').click(function(event){ var available = $(this).attr('available'); if(available=='pro'){ event.preventDefault(); } }); $('.radio-post-template-wrapper').hover(function(){ var available = $(this).attr('available'); if(available=='pro'){ $('.pro-tmp-msg').show(); } },function(){ $('.pro-tmp-msg').hide(); }); $(".section h4.group-heading").click(function() { $(this).next('.group-content').toggle(); var attr_arrow = $(this).find('.heading-arrow').hasClass('side'); if(attr_arrow==true){ $(this).find('.heading-arrow').removeClass('side'); $(this).find('.heading-arrow').addClass('down'); $(this).find('.fa').removeClass('fa-angle-right'); $(this).find('.fa').addClass('fa-angle-down'); } else if(attr_arrow==false) { $(this).find('.heading-arrow').removeClass('down'); $(this).find('.heading-arrow').addClass('side'); $(this).find('.fa').removeClass('fa-angle-down'); $(this).find('.fa').addClass('fa-angle-right'); } }); /* $('.controls > img').click(function(event){ var post_template = $(this).prevAll('.of-radio-img-label').html(); if(post_template==='post_template1' || post_template==='post_template2'){ alert('true'); }else{ alert('false'); event.preventDefault(); } }); */ //Append product review for post var count = $('#post_review_count').val(); $('.docopy-revirew-stars').click(function(){ count++; $('.product_reivew_section').append('