//=====================================// // details // 2017-01-12// //=====================================// $(document).ready(function () { // ########################### price table odd and even ########################### var tblNum = $(".detail_price").find("table").length; // for (var i = 0; i < tblNum; i++) { // $(".detail_price").find("table").eq(i).find("tr:odd").css("background-color", "#fcfafe"); // $(".detail_price").find("table").eq(i).find("tr:even").css("background-color", "#fff"); // } //price_tbl_btn $(".btn_price_cart").click(function () { var cpdNum = $(".detail_price table td select option:selected").text(); //alert(cpdNum); if (cpdNum == 0) { $(".price_notice").css({'visibility': 'visible'}); $(".price_notice").css("margin-left", "0"); $(".detail_price table td select").css("border-color", "#ee3134"); } else { $(".price_notice").css({'visibility': 'hidden'}); $(".detail_price table td select").css("border-color", "#bdbdbd"); mask_cart = 1; add_to_cart(); } statistical.checkUserBehavior('click'); seoStatistical.checkUserBehavior('click'); }); $(".btn_price_quotation").click(function () { var cpdNum = $(".detail_price table td select option:selected").text(); //alert(cpdNum); if (cpdNum == 0) { $(".price_notice").css({'visibility': 'visible'}); $(".price_notice").css("margin-left", "0"); $('#jpPriceNotice').css("margin-left", "0"); $('#frPriceNotice').css("margin-left", "0"); $(".detail_price table td select").css("border-color", "#ee3134"); } else { $(".price_notice").css({'visibility': 'hidden'}); $(".detail_price table td select").css("border-color", "#bdbdbd"); add_Quotation(); } }); $(".btn_price_quotation_inhibitor").click(function () { var cpdNum = $(".detail_price table td select option:selected").text(); if (cpdNum == 0) { $(".price_notice").css({'visibility': 'visible'}); $(".price_notice").css("margin-left", "0"); $('#jpPriceNotice').css("margin-left", "0"); $('#frPriceNotice').css("margin-left", "0"); $(".detail_price table td select").css("border-color", "#ee3134"); } else { $(".price_notice").css({'visibility': 'hidden'}); $(".detail_price table td select").css("border-color", "#bdbdbd"); //add_Quotation_inhibitor(); add_Quotation(); } }); $(".a_price_inquiry, .btn_price_inquiry, .span_get_quote, .btn_leave_msg").click(function () { $(".mask").show(); $(".inquiry").show(); inquiryFormStyle(); if ($('.container-wrapper').length > 0) { //initContainer(); //qtyChange containerObj.qtyChange(); } }); //detail_price select value!=0 $('.detail_price table td select').change(function () { var cpdNum = $(".detail_price table td select option:selected").text(); if (cpdNum != 0) { $(".detail_price table td select").css("border-color", "#bdbdbd"); $(".price_notice").css({'visibility': 'hidden'}); } }); $("#inquiry_success_tit").find("span").click(function () { $('.inquiry_success').hide(); $('.mask').hide() }) $("#inquiry_tit").find("span").click(function () { $('.inquiry').hide(); $('.mask').hide(); $("#iqDetail_productCount").val(""); jsSelectItemByValue(document.getElementById("amountUnit"), "mg"); }) //sdf $("#a_SDS, #lib_sdf_doc").click(function () { $('.request_sdf').show(); $('.mask').show() }) $("#request_sdf_tit").find("span").click(function () { $('.request_sdf').hide(); $('.mask').hide() }) //Customer Validation //inhibitor kit $("#cocktail_cv_1").click(function () { $("#cocktail_cv_details_1").show(); $(".mask").show(); }) $("#cocktail_cv_2").click(function () { $("#cocktail_cv_details_2").show(); $(".mask").show(); }) $(".cocktail_cv_details span").click(function () { $(".cocktail_cv_details").hide(); $(".mask").hide(); }); $(document).click(function () { $(".cocktail_cv_details").hide(); $(".inquiry").hide(); $(".inquiry_success").hide(); $(".request_sdf").hide(); $(".mask").hide(); $(".inquiry_forms #iqDetail_productCount").val(""); // jsSelectItemByValue(document.getElementById(".inquiry_forms #amountUnit"), "mg"); // jsSelectItemByValue(document.getElementById(".inquiry_forms #amountUnit"), "μL"); $(".inquiry_forms #amountUnit").find("option[text='mg']").attr("selected",true); $(".inquiry_forms #amountUnit").find("option[text='μL']").attr("selected",true); }); $(".cocktail_cv_thumbnail img, .cocktail_cv_details, .btn_leave_msg, .a_price_inquiry,.btn_price_inquiry, .inquiry, .inquiry_success, .request_sdf, #a_SDS, .span_get_quote, #lib_sdf_doc").click(function (event) { event.stopPropagation(); }); //kits_Cocktails:Top Publication Citing Use of MCE Products (20170426 wdf) var kitBriefH = $("#cocktail_brief").height(); if (kitBriefH > 30) { $(".kit_publist").css("margin-top", "25px"); } // ########################### products details ########################### //view More & Collapse $(".details_info_doc").find("a:last").css({"margin-right": "0"}); //view More & Collapse $("#lib_plate_toggle").find(".view_more").click(function () { var libplateScroll = $(window).scrollTop(); viewMore("#lib_plate_toggle"); $("#lib_plate_part").slideDown(1000); $("body,html").animate({scrollTop: libplateScroll + "px"}, 50); }); $("#lib_plate_toggle").find(".collapse").click(function () { $("#lib_plate_part").slideUp(500); $("body,html").animate({scrollTop: ($("#lib_info_4").offset().top-82) + "px"}, 0); collapse("#lib_plate_toggle"); }); // ########################### products details ########################### // Products Details => subTitle Tab $('#details_tit_pro ul li').click(function () { $(this).addClass("actived").siblings().removeClass(); if ($(this).attr('id') == 'li_documentation') { // $("#details_info_pro").find(".details_info").hide(); $('#details_tit_1').click(); goCoordinate('cpd_documentation'); } else if ($(this).attr('id') == 'instruction-book') { // $("#details_info_pro").find(".details_info").hide(); $('#details_tit_1').click(); goCoordinate('cpd_instruction-book'); } else { $("#details_info_pro").find(".details_info").hide().eq($('#details_tit_pro ul li').index(this)).show(); } checkGermany(); }); // Compound => Calculator Modules $('#compoundCalTit ul li').on('click',function () { $(this).addClass("actived").siblings().removeClass(); $("#compoundCalCon").find(".cpd-cal-div").hide().eq($('#compoundCalTit ul li').index(this)).show(); }); $('#newsListTit ul li').on('click',function () { var lftCtusH = $(window).scrollTop() + ($(window).height() - $("#lft_ctus").outerHeight())/2; $("#lft_ctus").stop(true).css("top",lftCtusH); $(this).addClass("actived").siblings().removeClass(); $("#newListCon").find(".news_list").hide().eq($('#newsListTit ul li').index(this)).show(); history.replaceState(null,null,"/news/" + $(this).attr('id') + ".html"); }); //product details right height // $("#pro_rgt").css("height", getProRgtH() + "px"); //cpd_info_con div height $("#details_info_pro").css("height", getproInfoMH() + "px"); //inhibitor kit info 4 $("#kit_info_5 table tr:eq(1)").find("td").css({"padding-top":"5px"}); //library for(i=0; i=20) { $(".pro_publist").css("margin-top","19px"); } else { var imgpriceH=38-imgpriceMinus; $(".pro_publist").css("margin-top",imgpriceH+"px"); } } } else { $(".pro_publist").css("margin-top","38px"); } $('.icon_pdf_doc_coa').on('click', function () { goCoordinate('cpd_documentation'); }); }); //Featured Recommendations 20190613 wdf function fnCPDRelated(divName) { var divnameH = $(divName).height(); if(divnameH > 20) { $(divName).addClass('div_h20'); $(divName).find('.view_collapse').show(); } else { $(divName).removeClass('div_h20'); $(divName).find('.view_collapse').hide(); } $(divName).find('.view_collapse>.view_more').click(function () { $(divName).removeClass('div_h20'); $(this).hide().siblings().show(); }); $(divName).find('.view_collapse>.collapse').click(function () { $(divName).addClass('div_h20'); $(this).hide().siblings().show(); }) } function antCarousel(){ if ($('.pro-carousel-list').length > 0) { $('.pro-carousel-list').slick({ slidesToShow: 3, slidesToScroll: 3, infinite: false, autoplay: false, draggable: true, prevArrow: $(".pro-slick-prev"), nextArrow: $(".pro-slick-next") }); } if($(".pro-antibodies-cont-list").outerHeight() <= 23) { $(".pro-view-more").hide(); } if($(".pro-antibodies-cont-list").outerHeight() > 23) { $(".pro-view-more").show(); } $('#main').on("click",".pro-view-more", function() { $(".pro-related-antibodies-cont").toggleClass("is-unfold"); }); $.each($(".details_info_td"), function() { if($(this).find('.cpd-mod-vv').length === 0) { $(this).find(".pro-antibodies-wrapper").css({"margin-bottom":"0","padding-bottom": "0"}) } }) } function viewMore(divId) { $(divId).find(".view_more").css({"display": "none"}); $(divId).find(".collapse").css({"display": "block"}); } function collapse(divId) { $(divId).find(".view_more").css({"display": "block"}); $(divId).find(".collapse").css({"display": "none"}); } function checkMsg(checkId,msgId,msg){ if($("#"+checkId).val()!=""){ $("#"+msgId).html(""); }else{ $("#"+msgId).html(msg); } } function checkEmailMsg(id,msgId,msg){ if($("#"+id).val()==""){ $("#"+msgId).html("Field is required."); }else if (checkEmailFormat($("#"+id).val().trim()) == false) { $("#"+msgId).html("Please enter a valid email address."); } else { $("#"+msgId).html(""); } } //get cpd_info div max height var cpdInfoHArray = []; function getproInfoMH() { for (var i = 0; i < $("#details_info_pro").find(".details_info").length; i++) { var divHeight = $("#details_info_pro").find(".details_info").eq(i).height(); cpdInfoHArray.push(divHeight); } cpdInfoHArray.sort(function (a, b) { return a - b; }); var cpdInfoH = cpdInfoHArray[cpdInfoHArray.length - 1]; return cpdInfoH; } //20170401 library details rgt height and email margin-top $(document).ready(function () { var libBriefH = $("#library_brief").height(); //alert(libBriefH); if(libBriefH==22){ $("#lib_rgt").css("margin-top","0"); } else { $("#lib_rgt").css("margin-top","22px"); } }); /* * page: compound * modules: experiment figure * time: 20170824 */ var liPictureArr = []; function showProEXP(currentIndex,expType){ var proEXPMask = $("#pro_exp_mask"); var proEXPPop = $("#pro_exp_pop"); var proEXPList = $("#pro_exp_list"); var proEXPDot=$("#pro_exp_pop_dot"); var proEXPDotLeft=0; var proEXPPrev = $("#pro_exp_pop_prev"); var proEXPNext =$("#pro_exp_pop_next"); var proEXPClose = $("#pro_exp_pop_close"); var EXPDLTotal = 0; EXPDLTotal = $(proEXPList).find("dl").length; var EXPDLWidth = $(proEXPList).find("dl").outerWidth(); //alert(EXPDLWidth); var EXPDLTotalWidth = EXPDLTotal * EXPDLWidth; $(proEXPList).find("div").css("width",EXPDLTotalWidth+"px"); if (liPictureArr.length == 0) { $(proEXPList).find("dl").each(function(index, dom) { var dlID = $(this).find("dt").attr("id"); var dlClass= $(this).find("dt").attr("class"); var dlHtml= $(this).html(); liPictureArr.push([dlID,dlClass,dlHtml]); }); } var dist_Array = []; if (expType == '') { dist_Array = liPictureArr; } else { var findArray = []; var otherArray = []; for (var i=0; i { if (item[1] == expType) { findArray.push(item); } else { otherArray.push(item); } });*/ dist_Array = findArray.concat(otherArray); } //reload $(proEXPList).find("dl").empty(); for(var i=0; i 0) { for (var i = 0; i < EXPDLTotal; i++) { $(proEXPDot).append("
  • "); } } // 25, 16px var dotLineNum = Math.ceil(EXPDLTotal/25); // var dotLineNum = 3; $(proEXPPop).css({'height': 526 + (dotLineNum-1)*16}); $(proEXPList).find('dt').css({'height': 320 + (dotLineNum-1)*16 }); $(proEXPPrev).css({'top': 188 + (dotLineNum-1)*16/2}); $(proEXPNext).css({'top': 188 + (dotLineNum-1)*16/2}); proEXPDotLeft = ($(proEXPPop).width()-$(proEXPDot).width())/2; // $(proEXPDot).css("left",proEXPDotLeft+"px"); $(proEXPList).find("div").css("left",(-currentIndex * EXPDLWidth+1)+"px"); $(proEXPDot).find("li").eq(currentIndex).addClass("actived"); firstLast(currentIndex); //click dot $(proEXPDot).find("li").click(function () { currentIndex = $(proEXPDot).find("li").index(this); $(this).addClass("actived").siblings().removeClass(); firstLast(currentIndex); showDL(currentIndex); }); //Click Previous $(proEXPPrev).click(function () { currentIndex = $('#pro_exp_pop_dot>li').index($('.actived')); currentIndex -= 1; // console.log(currentIndex); if(currentIndex<0) { currentIndex =0; return; } if(currentIndex==0) { $(proEXPPrev).addClass("pro_exp_pop_prev_disabled").siblings().removeClass(); }else { $(proEXPNext).removeClass("pro_exp_pop_next_disabled"); } showDL(currentIndex); }); //Click Next $(proEXPNext).click(function () { currentIndex = $('#pro_exp_pop_dot>li').index($('.actived')); currentIndex += 1; // console.log(currentIndex); if (currentIndex > EXPDLTotal-1) { currentIndex = EXPDLTotal-1; return; } if(currentIndex==EXPDLTotal-1){ $(proEXPNext).addClass("pro_exp_pop_next_disabled").siblings().removeClass(); } else { $(proEXPPrev).removeClass("pro_exp_pop_prev_disabled"); } if(currentIndex==0){ $(proEXPPrev).addClass("pro_exp_pop_prev_disabled"); } showDL(currentIndex); }); function showDL(currentIndex) { $(proEXPList).find("div").stop(true, false).animate({"left": (-currentIndex * EXPDLWidth)+"px"}, 500); $(proEXPDot).find("li").eq(currentIndex).addClass("actived").siblings().removeClass(); } function firstLast(currentIndex) { if(currentIndex==0){ $(proEXPPrev).addClass("pro_exp_pop_prev_disabled"); $(proEXPNext).addClass("pro_exp_pop_next_disabled"); }else { $(proEXPPrev).removeClass("pro_exp_pop_prev_disabled"); } if(currentIndex==EXPDLTotal-1){ $(proEXPNext).addClass("pro_exp_pop_next_disabled"); }else { $(proEXPNext).removeClass("pro_exp_pop_next_disabled"); } } //click close $(proEXPClose).click(function () { $(proEXPPrev).unbind(); $(proEXPNext).unbind(); $(proEXPClose).unbind(); closeEXP(); }); $(proEXPMask).click(function () { $(proEXPPrev).unbind(); $(proEXPNext).unbind(); $(proEXPMask).unbind(); closeEXP(); }); function closeEXP() { $(proEXPPop).hide(); $(proEXPMask).hide(); $(proEXPDot).empty(); $(proEXPList).find("div").css("left", "0"); $(proEXPPrev).removeClass("pro_exp_pop_prev_disabled"); $(proEXPNext).removeClass("pro_exp_pop_next_disabled"); } } //// --- The End--- //// var liKitPictureArr = []; function showProKitEXP(currentIndex,expType){ var proKitEXPMask = $("#pro_kit_exp_mask"); var proKitEXPPop = $("#pro_kit_exp_pop"); var proKitEXPList = $("#pro_kit_exp_list"); var proKitEXPDot=$("#pro_kit_exp_pop_dot"); var proKitEXPDotLeft=0; var proKitEXPPrev = $("#pro_kit_exp_pop_prev"); var proKitEXPNext =$("#pro_kit_exp_pop_next"); var proKitEXPClose = $("#pro_kit_exp_pop_close"); var KitEXPDLTotal = 0; if (liKitPictureArr.length == 0) { $(proKitEXPList).find("dl").each(function(index, dom) { var dlID = $(this).find("dt").attr("id"); var dlClass= $(this).find("dt").attr("class"); var dlHtml= $(this).html(); liKitPictureArr.push([dlID,dlClass,dlHtml]); }); } var dist_Array = []; if (expType == '') { dist_Array = liKitPictureArr; } else { var findArray = []; for (var i=0; i 0) { for (var i = 0; i < KitEXPDLTotal; i++) { $(proKitEXPDot).append("
  • "); } } // 25, 16px var dotLineNum = Math.ceil(KitEXPDLTotal/25); // var dotLineNum = 3; $(proKitEXPPop).css({'height': 526 + (dotLineNum-1)*16}); $(proKitEXPList).find('dt').css({'height': 320 + (dotLineNum-1)*16 }); $(proKitEXPPrev).css({'top': 188 + (dotLineNum-1)*16/2}); $(proKitEXPNext).css({'top': 188 + (dotLineNum-1)*16/2}); proKitEXPDotLeft = ($(proKitEXPPop).width()-$(proKitEXPDot).width())/2; // $(proEXPDot).css("left",proEXPDotLeft+"px"); $(proKitEXPList).find("div").css("left",(-currentIndex * KitEXPDLWidth+1)+"px"); $(proKitEXPDot).find("li").eq(currentIndex).addClass("actived"); KitfirstLast(currentIndex); //click dot $(proKitEXPDot).find("li").click(function () { currentIndex = $(proKitEXPDot).find("li").index(this); $(this).addClass("actived").siblings().removeClass(); KitfirstLast(currentIndex); KitshowDL(currentIndex); }); //Click Previous $(proKitEXPPrev).click(function () { currentIndex = $('#pro_kit_exp_pop_dot>li').index($('.actived')); currentIndex -= 1; // console.log(currentIndex); if(currentIndex<0) { currentIndex =0; return; } if(currentIndex==0) { $(proKitEXPPrev).addClass("pro_exp_pop_prev_disabled").siblings().removeClass(); }else { $(proKitEXPNext).removeClass("pro_exp_pop_next_disabled"); } KitshowDL(currentIndex); }); //Click Next $(proKitEXPNext).click(function () { currentIndex = $('#pro_kit_exp_pop_dot>li').index($('.actived')); currentIndex += 1; // console.log(currentIndex); if (currentIndex > KitEXPDLTotal-1) { currentIndex = KitEXPDLTotal-1; return; } if(currentIndex==KitEXPDLTotal-1){ $(proKitEXPNext).addClass("pro_exp_pop_next_disabled").siblings().removeClass(); } else { $(proKitEXPPrev).removeClass("pro_exp_pop_prev_disabled"); } if(currentIndex==0){ $(proKitEXPPrev).addClass("pro_exp_pop_prev_disabled"); } KitshowDL(currentIndex); }); function KitshowDL(currentIndex) { $(proKitEXPList).find("div").stop(true, false).animate({"left": (-currentIndex * KitEXPDLWidth)+"px"}, 500); $(proKitEXPDot).find("li").eq(currentIndex).addClass("actived").siblings().removeClass(); } function KitfirstLast(currentIndex) { if(currentIndex==0){ $(proKitEXPPrev).addClass("pro_exp_pop_prev_disabled"); $(proKitEXPNext).addClass("pro_exp_pop_next_disabled"); }else { $(proKitEXPPrev).removeClass("pro_exp_pop_prev_disabled"); } if(currentIndex==KitEXPDLTotal-1){ $(proKitEXPNext).addClass("pro_exp_pop_next_disabled"); }else { $(proKitEXPNext).removeClass("pro_exp_pop_next_disabled"); } } //click close $(proKitEXPClose).click(function () { $(proKitEXPPrev).unbind(); $(proKitEXPNext).unbind(); $(proKitEXPClose).unbind(); closeKitEXP(); }); $(proKitEXPMask).click(function () { $(proKitEXPPrev).unbind(); $(proKitEXPNext).unbind(); $(proKitEXPMask).unbind(); closeKitEXP(); }); function closeKitEXP() { $(proKitEXPPop).hide(); $(proKitEXPMask).hide(); $(proKitEXPDot).empty(); $(proKitEXPList).find("div").css("left", "0"); $(proKitEXPPrev).removeClass("pro_exp_pop_prev_disabled"); $(proKitEXPNext).removeClass("pro_exp_pop_next_disabled"); } } //// --- The End--- //// /* * page: compound * modules: Clinical Table */ function proClinicalStyle(){ var proClinicalTbl = $("#pro_info_clinical"); var proClinicalNum = $(proClinicalTbl).find("table tbody").find("tr").length; var proClinicalMore = $("#pro_info_clinical_more"); var proClinicalSH = $("#pro_clinical_toggle"); var proScroll = 0; if(proClinicalNum > 3) { $(proClinicalMore).hide(); // $('.stock-tit .stock-more').show(); proClinicalSH.show(); }else{ proClinicalSH.hide(); $(proClinicalTbl).find("table tbody").find("td").css({"border-bottom":"0","border-top":"1px dotted #ebe4f6"}); $(proClinicalTbl).find("table tbody tr:first-child").find("td").css({"border-top":"0"}); } $(proClinicalSH).find(".view_more").click(function () { proScroll = $(window).scrollTop(); viewMore(proClinicalSH); $(proClinicalMore).show(1000); }); $(proClinicalSH).find(".collapse").click(function () { $(proClinicalMore).hide(500); $("body,html").animate({scrollTop: proScroll + "px"}, 500); collapse(proClinicalSH); }) } $(document).ready(function () { proClinicalStyle(); }); //// --- The End--- //// /* * page: compound * modules: right related img * time: 20201013 */ var proRelatedURL = { JPLibURL: '//file.medchemexpress.com/new/images/web/pro-related-lib-jp.png', JPKitURL: '//file.medchemexpress.com/new/images/web/pro-related-kit-jp.png', ENLibURL: '//file.medchemexpress.com/new/images/web/pro-related-lib-en.png', // ENKitPartURL: '//file.medchemexpress.com/new/images/web/pro-related-kit-part-en.png', ENKitURL: '//file.medchemexpress.com/new/images/web/pro-related-kit-en.png', ENAwardURL: '//file.medchemexpress.com/mce-com-email/2023/pro-related-calendar.jpg', CNLibURL: '//file.hg.y866.cn/biomolecule/new/images/web/pro-related-lib-cn.png', // CNKitPartURL: '//file.hg.y866.cn/biomolecule/new/images/web/pro-related-kit-part-en.png', CNKitURL: '//file.hg.y866.cn/biomolecule/new/images/web/pro-related-kit-en.png', // CNAwardURL: '//static.hg.y866.cn/biomolecule/cn-web/web-site/image/protein-discount-activity-2023.jpg', CNAwardURL: 'http://hg.y866.cn/biomolecule/lib/file/mce-cn-email/2025/back-school-autumn-detail-2025.jpg', }; function fnRelatedLibandKitShow(libImgURL, kitImgURL, awardImgURL) { // step1: get element var priceWrapper = $(".detail_price"), libWrapper = $('#J-related-lib-container'), awardWrapper = $('#J-related-award-container'), kitWrapper = $('#J-related-kit-container'), customerReview = $(".pro_star"), otherForms = $(".pro_other_forms"); // step2: calculate left height var proImgH = $(".detail_img").outerHeight() - 8, proPriceH = 0, proLeftH = 0; if($(".other_forms_backordered").length!=0) { proPriceH = priceWrapper.outerHeight(); } else { proPriceH = priceWrapper.outerHeight() - $('.price_notice').outerHeight(); } proLeftH = proImgH > proPriceH ? proImgH : proPriceH; //console.log('proLeftH = '+ proLeftH); // step3: clear right img if(libWrapper.find("a>img").length > 0){ libWrapper.find('a>img').remove(); } /* if(awardWrapper.find("a>img").length > 0){ awardWrapper.find('a>img').remove(); }*/ if(kitWrapper.find("a>img").length > 0){ kitWrapper.find('a>img').remove(); kitWrapper.hide(); } // step4: calculate right height var rightAddH = 0; if (customerReview.length == 0 && otherForms.length == 0) { libWrapper.css("padding-top", "6"); rightAddH = 10; } else { rightAddH = 0; } var customerReviewH = 0, otherFormsH = 0; customerReviewH = customerReview.length > 0 ? customerReview.outerHeight() : 0; otherFormsH = otherForms.length > 0 ? otherForms.outerHeight() : 0; var proRightH = customerReviewH + otherFormsH; // console.log('proRightH = '+ proRightH); // step5: compare left height and right height var relateImgTotalH = proLeftH - proRightH + rightAddH; //console.log('relateImgTotalH = '+ relateImgTotalH); // step6: calculate libWrapper height and awardWrapper var libWrapperH = libWrapper.outerHeight(), awardWrapperH = awardWrapper.is(':hidden') ? 0 : awardWrapper.outerHeight() + 5; // margin-top //console.log('libWrapperH = '+ libWrapperH); //console.log('awardWrapperH = '+ awardWrapperH); //step7: add award img awardWrapper.find('a').append('Award'); if (awardWrapperH > relateImgTotalH) { awardWrapper.hide(); if (webType == 'cn' && isCnBackSchool2025AT()) { awardWrapper.show(); } } // step6: add lib img if (libWrapperH > relateImgTotalH - awardWrapperH) { libWrapper.hide(); }else { libWrapper.find('a').append('Compound Screening Library'); } //step8: add kit img var kitH = relateImgTotalH - libWrapperH - awardWrapperH; // kit padding-top //console.log('kitH = '+ kitH); //fnCocktail(kitH, kitWrapper, kitImgURL); // imgHeight: 105 / 185 + paddingTop: 5 = 110 / 185 px if(kitH >= 110 ){ var cocktailH = 0; if(kitH >= 185){ cocktailH = 186; } else if(kitH >= 130 && kitH < 185){ cocktailH = 130; } else { cocktailH = 0; } kitWrapper.css({'height':cocktailH}); kitWrapper.find('a').append('Inhibitor Cocktails'); kitWrapper.show(); } } //step8: add related data function proRelatedImgJP(varJapan){ if(varJapan== 'Japan'){ fnRelatedLibandKitShow(proRelatedURL.JPLibURL,proRelatedURL.JPKitURL); }else { fnRelatedLibandKitShow(proRelatedURL.ENLibURL, proRelatedURL.ENKitURL, proRelatedURL.ENAwardURL); } } function proRelatedImgEN(varJapan){ if(varJapan == 'Japan'){ fnRelatedLibandKitShow(proRelatedURL.ENLibURL, proRelatedURL.JPKitURL); }else { fnRelatedLibandKitShow(proRelatedURL.ENLibURL, proRelatedURL.ENKitURL, proRelatedURL.ENAwardURL); } } function proRelatedImgCN(){ fnRelatedLibandKitShow(proRelatedURL.CNLibURL, proRelatedURL.CNKitURL, proRelatedURL.CNAwardURL); } // if en/cn set cocktail height var fnENCocktailHeight = function(kitH, kitWrapper, kitImgURL) { // imgHeight: 120 / 180 + paddingTop: 5 = 125 / 185 px => en if(kitH >= 125 ){ var cocktailH = kitH >= 185 ? 185 : 125; kitWrapper.css({'height': cocktailH}); kitWrapper.find('a').append('Inhibitor Cocktails'); } }; var fnCNCocktailHeight = function(kitH, kitWrapper, kitImgURL) { // imgHeight: 105 / 180 + paddingTop: 5 = 110 / 185 px => cn if(kitH >= 110 ){ var cocktailH = 0; if(kitH >= 185){ cocktailH = 185; } else if(kitH >= 130 && kitH < 185){ cocktailH = 130; } else { cocktailH = kitH; } kitWrapper.css({'height':cocktailH}); kitWrapper.find('a').append('Inhibitor Cocktails'); } }; //// --- The End--- //// function proCVStyle(){ var $proCV = $('#pro_cv'); var cvNum = $proCV.find('li').length; var $proCVSH = $('#pro_cv_sh'); var $proMore = $("#pro_cv_list_more"); var $proCVIconMore = $proCVSH.find('.cv_more_icon'); var $proCVIconHide = $proCVSH.find('.cv_hide_icon'); for (var i = 0; i < cvNum; i++) { if (i % 2 == 0) { $proCV.find('li').eq(i).addClass('pro_cv_lft'); } else { $proCV.find('li').eq(i).addClass('pro_cv_rgt'); } } if (cvNum > 6) { SH($proCVIconMore, $proCVIconHide); $proCV.height('150px'); $proCVSH.show(); $proCVIconMore.show(); $($proCVIconMore).on('click', function () { $proCV.height('auto'); $proMore.show(); SH($proCVIconHide, $proCVIconMore); }); $($proCVIconHide).on('click', function () { $proCV.height('150px'); $proMore.hide(); SH($proCVIconMore, $proCVIconHide); }); } else { $proCVSH.hide(); } // $proCV.css('max-height', ''); } function kitCVStyle(){ var proCV = $("#kit_cv_exp"); var cvNum = $(proCV).find(".kit_exp").length; var proCVSH= $("#kit_cv_sh"); var proCVIconMore = $(proCVSH).find(".cv_more_icon"); var proCVIconHide = $(proCVSH).find(".cv_hide_icon"); if (cvNum > 6) { SH(proCVIconMore,proCVIconHide); $(proCV).css({"height": "200px"}); $(proCVIconMore).click(function () { $(proCV).css({"height": "auto"}); SH(proCVIconHide,proCVIconMore); }); $(proCVIconHide).click(function () { $(proCV).css({"height": "200px"}); SH(proCVIconMore,proCVIconHide); }) } else{ $(proCVSH).hide(); } } function proteinCVStyle(){ var proCV = $("#protein_cv"); var cvNum = $(proCV).find("li").length; var proCVSH= $("#protein_cv_sh"); var proCVIconMore = $(proCVSH).find(".cv_more_icon"); var proCVIconHide = $(proCVSH).find(".cv_hide_icon"); if (cvNum > 12) { SH(proCVIconMore,proCVIconHide); $(proCVIconMore).click(function () { $(proCV).find('#pro_cv_list_more').show(); SH(proCVIconHide,proCVIconMore); }); $(proCVIconHide).click(function () { $(proCV).find('#pro_cv_list_more').hide(); SH(proCVIconMore,proCVIconHide); }) } else{ $(proCVSH).hide(); } } function libCVStyle(){ var libCVListInit = $("#lib_cv_list_init"); var libCVListMore = $("#lib_cv_list_more"); var libCVSH= $("#lib_cv_sh"); var libCVIconMore = $(libCVSH).find(".cv_more_icon"); var libCVIconHide = $(libCVSH).find(".cv_hide_icon"); if($(libCVListMore).find("li").length!=0) { SH(libCVIconMore,libCVIconHide); $(libCVIconMore).click(function () { $(libCVListMore).show(); SH(libCVIconHide,libCVIconMore); }); $(libCVIconHide).click(function () { $(libCVListMore).hide(); SH(libCVIconMore,libCVIconHide); }); } else { $(libCVListInit).find("li").css("width","333px"); $(libCVSH).hide(); } } function SH(a,b){$(a).show();$(b).hide();} $(document).ready(function () { proCVStyle(); libCVStyle(); proteinCVStyle(); kitCVStyle(); }); function getQuote(size) { if ($('.container-wrapper').length > 0) { if (size.indexOf(">") == -1) { var quantity = parseInt(size); var package = size.replace(quantity, "").replace(/\s+/g, ""); jsSelectItemByValue(document.getElementById("amountUnit"), package); $("#iqDetail_productCount").val(quantity); } } else { if (size.indexOf(">") == -1) { var quantity = parseInt(size); var package = size.replace(parseInt(size), "").replace(/\s+/g, ""); if (size == '') { $("#iqDetail_productCount").val(''); } else { $("#iqDetail_productCount").val(parseInt(size)); } jsSelectItemByValue(document.getElementById("amountUnit"), package); } if ($("#sel-container").length > 0) { checkLibraryQuantity(); } } if (size == '125 g') { $("#iqDetail_productCount").attr("readonly","readonly"); $("#amountUnit").attr("disabled","disabled"); } else { $("#iqDetail_productCount").removeAttr("readonly"); $("#amountUnit").removeAttr("disabled"); } // $("#amountUnit").find("option[text=package]").attr("selected",true); // $(".mask").show(); // $(".inquiry").show(); } //20170822 CN Inquiry/Message Form function showInquiryForm(popTit) { statistical.checkUserBehavior('click'); seoStatistical.checkUserBehavior('click'); $(".pop_tit>p").html(popTit); $(".mask").show(); $(".inquiry").show(); event.stopPropagation(); } function hideInquiryForm(){ $(".inquiry").hide(); $(".inquiry_success").hide(); $(".oligonucleotide-quotation-info").hide(); $(".mask").hide(); $(".mask-oligonucleotide").hide(); } $(document).ready(function () { $("#inquiry_tit span, #inquiry_success_tit span").click(function () { hideInquiryForm(); }); $(document).click(function () { hideInquiryForm(); }); $(".btn_leave_msg, .btn_bulk_inquiry, .inquiry, #btn_service_inquiry, .oligonucleotide-quotation-info").click(function (event) { event.stopPropagation(); }); // $(".btn_inquiry_submit").click(function () { // $(".btn_inquiry_submit").addClass("form_btn_submit_send").removeClass("btn_inquiry_submit"); // $(".btn_inquiry_submit").attr({"disabled":"disabled"}); // $(".inquiry").hide(); // $(".inquiry_success").show(); // }); // // // Service/Search - none // $("#btn_service_inquiry").click(function () { // $(".btn_inquiry_submit").addClass("form_btn_submit_send").removeClass("btn_inquiry_submit"); // $(".mask").show(); // $(".inquiry_success").show(); // }) //price tbl: apply now 20170804 $(".font_apply_now,.apply_notice").mouseover(function () { $(".apply_notice").show(); }); var tir=0; $('.font_apply_now, .apply_notice').mouseout(function() { clearTimeout(tir); tir = setTimeout(function() { $(".apply_notice").hide(); }, 100); }).mouseover(function() { clearTimeout(tir); }); }); //=====================================// // Price Info // //=====================================// $(document).ready(function(){ //btn_get_quotation_cocktail $(".btn_get_quotation_cocktail").click(function(){ var cpdNum = 0; if($("#con_one_1").is(':hidden')){ cpdNum = parseInt($("#con_one_2 td select option:selected").text()); } else{ cpdNum = parseInt($("#con_one_1 td select option:selected").text()); } if(cpdNum==0){ $(".price_tbl_notice").css({'visibility':'visible'}); $(".price_tbl_notice p").css("margin-left","0px"); $(".cocktail_price table td select").css("border-color","#ee3134"); } else{ $(".price_tbl_notice").css({'visibility':'hidden'}); $(".cocktail_price table td select").css("border-color","#DDD"); } }); //btn_add_cart_cocktail $('.cocktail_price table td select').change(function(){ var cpdNum = 0; if($("#con_one_1").is(':hidden')){ cpdNum = parseInt($("#con_one_2 td select option:selected").text()); } else{ cpdNum = parseInt($("#con_one_1 td select option:selected").text()); } if(cpdNum!=0){ $(".cocktail_price table td select").css("border-color","#DDD"); $(".price_tbl_notice").css({'visibility':'hidden'}); } }); $(".btn_add_cart_cocktail").click(function(){ var cpdNum = 0; if($("#con_one_1").is(':hidden')){ cpdNum = parseInt($("#con_one_2 td select option:selected").text()); } else{ cpdNum = parseInt($("#con_one_1 td select option:selected").text()); } if(cpdNum==0){ $(".price_tbl_notice").css({'visibility':'visible'}); $(".price_tbl_notice p").css("margin-left","162px"); $(".cocktail_price table td select").css("border-color","#ee3134"); } else{ $(".price_tbl_notice").css({'visibility':'hidden'}); $(".cocktail_price table td select").css("border-color","#DDD"); //page top cart show $(".page_top_cart").show(); mask_cart =1; } cpdNum = 0; }); //btn_bulk_inquiry $(".btn_bulk_inquiry_cocktail").click(function(){ $(".price_tbl_notice").css({'visibility':'hidden'}); $(".cocktail_price table td select").css("border-color","#DDD"); $(window).scrollTop(400); $("#bulk_inquiry_cocktail").show(); }); }) function checkProductName(){ var catalogNo=""; var proType = 0; if($.trim($("#email_productName").val()).length>=1){ $.ajax({ url: "mce_cart!checkProdcutName.shtml", type: 'post', data: "email_productName=" + $.trim($("#email_productName").val()), cache: false, dataType: 'json', success:function(data){ var meaasge = ""; $.each(data, function(i, item) { if(i.trim()=="checkMessage"){ meaasge = item; } }); if(meaasge=="success"){ $.each(data, function(i, item) { if(i.trim()=="catalogNo"){ catalogNo = item; } if(i.trim()=="proType"){ proType = item; } }); $("#catalogNo").val(catalogNo); $("#proType").val(proType); $("#noticeMsg").val(""); $("#form_notice").html(""); return "success"; } // else{ // var msg='

    The product name you have entered "'+$.trim($("#email_productName").val())+'" is not contained in MCE catalog.

    '; // $("#noticeMsg").val(msg); // $("#form_notice").html('

    The product name you have entered "'+$.trim($("#email_productName").val())+'" is not contained in MCE catalog.

    '); // return "error"; // } } }); } else { $("#form_notice").html(""); } } function checkProductName2(formId){ var $form = $('#' + formId); var catalogNo=""; var proType = 0; var productName = $form.find("input[name='iqDetail.productName']").val().trim(); if(productName.length >= 1){ $.ajax({ url: "mce_cart!checkProdcutName.shtml", type: 'post', data: "email_productName=" + productName, cache: false, dataType: 'json', success:function(data){ var meaasge = ""; $.each(data, function(i, item) { if(i.trim()=="checkMessage"){ meaasge = item; } }); if(meaasge=="success"){ $.each(data, function(i, item) { if(i.trim()=="catalogNo"){ catalogNo = item; } if(i.trim()=="proType"){ proType = item; } }); $form.find("input[name='iqDetail.catalogNo']").val(catalogNo); $form.find("input[name='proType']").val(proType); $(".noticeMsg").val(""); return "success"; } } }); } } // 20180315 wdf kit and lib thumbnail js effect function thumbnailToEnlarge(thumbnailDiv, pictureDiv){ var thumbnailId = $(thumbnailDiv), pictureMask = $(pictureDiv); var pictureContent = pictureMask.find("img"); var pictureUrl = pictureContent.attr("src"); loadImage(pictureUrl, function () { thumbnailId.hover(function () { thumbnailId.css("cursor","pointer") },function () { thumbnailId.css("cursor","none") }); thumbnailId.click(function () { pictureMask.show(); }); }); pictureMask.click(function () { thumbnailId.removeClass(".pointer"); pictureMask.hide(); }); pictureContent.click(function (e) { e.stopPropagation(); }) } function loadImage(url, callback) { if (url) { var img = new Image(); img.src = url; if (img.complete) { callback.call(img); return; } img.onload = function () { callback.call(img); }; } } $(function () { thumbnailToEnlarge(".thumbnail",".picture-mask"); fnIsoformWidth(); //Isoform List Style fnSetIC50Style(); // IC50 Table Style /* * @page: targetKit * @effect: description tooltip effect */ var timer1 = 0; $('.tooltip-sign').mouseenter(function() { clearTimeout(timer1); var signId = $(this).attr('id'); var panelId = signId + 'Panel'; for(var i = 0; i < $('.tooltip-sign').length; i++){ if(i != parseInt(signId)){ $('.tooltip-panel').eq(i).hide(); } } $('#'+panelId).show(); }); $('.tooltip-panel').mouseenter(function() { clearTimeout(timer1); var panelId = $(this).attr('id'); $('#'+panelId).show(); }); $('.tooltip-sign').mouseleave(function() { var signId = $(this).attr('id'); var panelId = signId + 'Panel'; timer1 = setTimeout(function() { $('#'+panelId).hide(); }, 120); }); $('.tooltip-panel').mouseleave(function() { var panelId = $(this).attr('id'); timer1 = setTimeout(function() { $('#'+panelId).hide(); }, 120); }); // In Vitro & In Vivo ViewHideVivo('.cpd-vitro-list','#J-cpd-vitro-viewhide'); ViewHideVivo('.cpd-vivo-list','#J-cpd-vivo-viewhide'); // ViewHideVivo('.cellular-effects-list','#J-cpd-cellular-effect-viewhide'); // ViewHideVivo('.parmacokinetics-list','#J-cpd-pharmacokinetics-viewhide'); /* * * @page: product details & target kit & Cytokines * @effect Customer Review Click Star * @return scores = $("#J-star-list .selected").length * @date 20190716 * */ (function(){ for(var i=0;i<5;i++){ var _html = ''; $("#J-star-list").append(_html); } $("#J-star-list i").hover(function(){ var index = $(this).index(); for(var i = 0; i <= index; i++){ $("#J-star-list i").eq(i).addClass("actived"); } },function(){ $("#J-star-list i").removeClass("actived"); }); $("#J-star-list i").on("click",function(){ var x = $(this).index(); $("#J-star-list i").removeClass('selected'); for (var i = 0; i <= x; i++) { $("#J-star-list i").eq(i).addClass('selected'); }; }) })(); $('#J-upload-img-file').change(function(){ // success => show: filename var file = $("#J-upload-img-file").val() var pos = file.lastIndexOf("\\"); var _name = file.substring(pos + 1); if ($("input[type='file']")[0].files[0]) { var filesize = $("input[type='file']")[0].files[0].size/1024/1024; $('#J-upload-img-tips').html(_name); if (filesize > 1) { $('#J-upload-size-tips').addClass("red").removeClass("f-gray"); }else { $('#J-upload-size-tips').removeClass("red").addClass("f-gray"); } } else { $('#J-upload-img-tips').html("No file chosen"); $('#J-upload-size-tips').removeClass("red").addClass("f-gray"); } }); }); /* @page: compounds @modules: Isoform width @effect: calculate Isoform Table column width */ // function fnIsoformWidth(){ // var isoformProList = $(".isoform-pro-list"); // var isoformProListLen = isoformProList.length; // for(var i = 0; i < isoformProListLen; i++){ // var isoformProSpan = isoformProList.eq(i).find("span"); // var isoformProSpanLen = isoformProSpan.length; // if(isoformProSpanLen>4) { // isoformProSpan.parent().css({"width":"100%"}); // isoformProSpan.css({"width":"auto"}); // } else { // isoformProSpan.parent().css({"width":(isoformProSpanLen/4*100)+"%" }); // isoformProSpan.css({"width":(1/isoformProSpanLen*100)+"%" }); // } // } // } function fnIsoformWidth(){ var isoformProList = $(".isoform-pro-list"); var isoformProListLen = isoformProList.length; for(var i = 0; i < isoformProListLen; i++){ var isoformProSpan = isoformProList.eq(i).find("span"); var isoformProSpanLen = isoformProSpan.length; if(isoformProSpanLen>4) { isoformProSpan.parent().css({"width":"100%"}); isoformProSpan.css({"width":"auto"}); } else { isoformProSpan.parent().css({"width":(isoformProSpanLen/4*100)+"%" }); isoformProSpan.css({"width":(1/isoformProSpanLen*100)+"%" }); } } } /* @page: compounds @modules: In Vitro & In Vivo @effect: View and Collapse */ function ViewHideVivo(divClass, vcId){ var scroll = 0; $(vcId).find('.view_more').on('click',function () { $(divClass).not(':first').fadeIn(1000); scroll = $(window).scrollTop(); viewMore(vcId); }); $(vcId).find('.collapse').on('click',function () { $(divClass).not(':first').fadeOut(500); $("body,html").animate({scrollTop: scroll + "px"}, 500); collapse(vcId); }); } /** * */ // 20180315 wdf kit and lib thumbnail js effect function modalClose(modalId, clearForm){ var modalId = $(modalId), modalContent = modalId.find(".modal-content"), modalColse = modalId.find(".close"); if(clearForm == undefined) { modalId.click(function () { modalId.css({"display":"none"}); }); modalColse.click(function () { modalId.css({"display":"none"}); }); } else { modalId.click(function () { modalId.css({"display":"none"}); clearForm(); }); modalColse.click(function () { modalId.css({"display":"none"}); clearForm(); }); } modalContent.click(function (e) { e.stopPropagation(); }); modalColse.click(function (e) { e.stopPropagation(); }); } function modalOpen(modalId){ $(modalId).css({"display":"table"}); inquiryFormStyle(); } // Close Modal $(function () { modalClose("#J-review-success",clearReviewForm); modalClose("#J-HNMR-form"); modalClose("#J-HNMR-success",clearHNMRForm); modalClose("#EU-MSDS-PDF"); }); var clearHNMRForm = function(){ clearForm.clearTextControl("#cmInqriry_lastName2"); clearForm.clearTextControl("#cmInqriry_addrEmail2"); clearForm.clearTextControl("#cmInqriryInquiryContent2"); clearForm.clearTextControl("#cmInqriry_companyName2"); clearForm.clearTextControl("#cmInqriry_tel2"); }; var clearReviewForm = function(){ clearForm.clearTextControl("#lotNumberInput"); clearForm.clearTextControl("#pubMedIDInput"); clearForm.clearTextControl("#myNameInput"); clearForm.clearTextControl("#reviewRemarksTextarea"); clearForm.clearFileControl("#J-upload-img-file"); $("#J-upload-img-tips").html("No file chosen"); $('.star-list').find('i').removeClass('selected actived'); }; // clear form control var clearForm = { clearTextControl: function(controlID){ $(controlID).val(""); }, clearFileControl: function(controlID){ var ie = (navigator.appVersion.indexOf("MSIE")!=-1); if( ie ){ var file2= controlID.cloneNode(false); file2.onchange= controlID.onchange; controlID.parentNode.replaceChild(file2,controlID); }else { $(controlID).val(""); } } }; // set inquiry form spacing function inquiryFormStyle(){ statistical.checkUserBehavior('click'); seoStatistical.checkUserBehavior('click'); var inquiryMT = (-$(".inquiry").outerHeight()/2) +'px'; $(".inquiry").css('margin-top', inquiryMT); var titles = $('.inquiry_forms').find('table').find('th>p'); for (var i = 0; i < titles.length; i++){ //console.log(titles.eq(i).height()) if(titles.eq(i).height() < 16) { titles.eq(i).css('margin-top','6px'); } else { titles.eq(i).css('margin-top','-1px'); } } } /* * @page: Compounds * @Date: 20190619 by wdf * Target&IC50 Table => Comments: * 1. Calculates the width of each grid, and displays one if the total grid width <= iContainerW(fixed line width);Otherwise multi-line display * 2. Multi-row case: colNum = iContainerW/ cellMaxWidth (integer); colWidth = iContainerW/colNum * 3. If all the IC50 values in a row are empty, the row is hidden and the Isoform is vertically centered */ function fnSetIC50Style(){ var oContainer = $("#pro-ic50-tbl"); var iContainerW = 827; var spanLen = oContainer.find("span").length; var tdLen = spanLen/2; // Total number of cells var spanArr = []; var spanTotalW = 0; var spanwMax = 0; // span Sum total length var lastW = 0; if(tdLen>1){ for(var i = 0; i < tdLen; i++){ var spanW = [oContainer.find("td").eq(i).find("span").eq(0).outerWidth(),oContainer.find("td").eq(i).find("span").eq(1).outerWidth()].max(); spanArr.push(spanW); spanTotalW += spanW; if(i==tdLen-1){ lastW = oContainer.find("td").eq(i).find("span").eq(0).outerWidth(); } } } spanwMax = spanArr.max(); // console.log("spanwMax= " + spanwMax); // console.log("spanArr=" +spanArr); // if spanwMax > iContainerW => branch; // if spanMax <= iContainerW => nowrap // console.log('lastW'+lastW); if(spanTotalW <= iContainerW){ oContainer.find("td").addClass("ic50-td0"); oContainer.find("td:last-child").css({"width": (iContainerW-lastW)+"px"}); // The last column width oContainer.find(".ic50-td0").wrapAll(""); }else { var trtdNum = parseInt(iContainerW / spanwMax); // Number of columns per row var tdWidth = iContainerW/trtdNum; // colwidth var trLen = spanLen/2/trtdNum; // Total number of rows var lastTrNum = spanLen/2%trtdNum; // The number of last row var lastColspan = trtdNum+1-lastTrNum; // The number of cells to merge in the last row for (var j = 0; j < tdLen; j++) { for (var k = 0; k < trLen; k++) { if (parseInt(j / trtdNum) == k) { oContainer.find("td").eq(j).addClass("ic50-td" + k); } } } oContainer.find("td").css({"width": tdWidth + "px"}); // set colwidth oContainer.find("td:last-child").attr({"colspan": lastColspan}); // The number of cells merged in the last row oContainer.find("td:last-child").css({"width": lastColspan*tdWidth+"px"}); // The last column width // tr grouping for (var k = 0; k < trLen; k++) { oContainer.find(".ic50-td" + k).wrapAll(""); } } oContainer.find("td.ic50-td0 > p:first-child").css({"border-top":"0"}); // The border on the first line p is 0 // If IC50 is all empty in a row, the row is hidden var iTrLength = oContainer.find("tr>tr").length; var str = []; var tdLength = 0; // console.log("tr="+iTrLength); for(var a = 0; a < iTrLength; a++){ tdLength = oContainer.find("tr>tr").eq(a).find("td").length; for(var b = 0; b < tdLength; b++ ){ var aa = oContainer.find("tr>tr").eq(a).find("td").eq(b).find("p").eq(1).text().replace(/\,|(^\s*)|(\s*$)/g, ""); str[a] += aa; } //console.log("str[a]="+str[a]); if(str[a] == "undefined" || str[a] == "" || str[a] == null){ for(var b = 0; b < tdLength; b++ ){ oContainer.find("tr>tr").eq(a).find("td").eq(b).find("p").eq(1).css({"display":"none"}); oContainer.find("tr>tr").eq(a).find("td").eq(b).find("p").eq(0).css({"padding":"0"}); oContainer.find("tr>tr").eq(a).find("td").eq(b).find("p").eq(0).find("span").css({"padding":"8px 18px 6px"}); } } } } //Minimum Value Array.prototype.min = function() { var min = this[0]; var len = this.length; for (var i = 1; i < len; i++){ if (this[i] < min){ min = this[i]; } } return min; } //Maximum Value Array.prototype.max = function() { var max = this[0]; var len = this.length; for (var i = 1; i < len; i++){ if (this[i] > max) { max = this[i]; } } return max; } Number.prototype.toFloor = function (num) { return Math.floor(this * Math.pow(10, num)) / Math.pow(10, num); }; // end Product Isoform by WDF 20180203 /* * @page: Kit Details, Lib Details * @Date: 20190619 by wdf * Target&IC50 Table => Comments: * 1. Calculates the width of each grid, and displays one if the total grid width <= iContainerW(fixed line width);Otherwise multi-line display * 2. Multi-row case: colNum = iContainerW/ cellMaxWidth (integer); colWidth = iContainerW/colNum * 3. If all the IC50 values in a row are empty, the row is hidden and the Isoform is vertically centered */ function scrollTabPanel(infoName){ var sTop = $("#"+infoName).offset().top - 86; $("body,html").animate({scrollTop: sTop+"px"}, 1000); } $(function () { $('.ss-vivo-oprate').click(function () { var childN = $(this).find('i'), opNode = $(this).parent('.invivo-step').siblings(); if(childN.attr('class') === "icon-minus") { opNode.slideUp(); childN.addClass('icon-plus').removeClass('icon-minus'); } else if(childN.attr('class') === "icon-plus"){ $.when(opNode.slideDown()).then(function(){ childN.addClass('icon-minus').removeClass('icon-plus'); normalSalineDisplacement(); }); } }); fnTooltip('.normal-saline-1','.tooltip-panel'); fnTooltip('.normal-saline-2','.tooltip-panel'); //fnTooltip('.normal-saline-5','.tooltip-panel'); }); function normalSaline5Show() { $('.normal-saline-div-5').show(); hoverBox5(); } function normalSaline5Hide() { $('.normal-saline-div-5').hide(); hoverBox5(); } function normalSaline6Show() { $('.normal-saline-div-6').show(); hoverBox(); } function normalSaline6Hide() { $('.normal-saline-div-6').hide(); hoverBox(); } function hoverBox() { $('.normal-saline-div-6').on({ mouseover : function(){ $('.normal-saline-div-6').show(); } , mouseout : function(){ $('.normal-saline-div-6').hide(); } }) } function hoverBox5() { $('.normal-saline-div-5').on({ mouseover : function(){ $('.normal-saline-div-5').show(); } , mouseout : function(){ $('.normal-saline-div-5').hide(); } }) } function normalSalineDisplacement() { if ($('.normal-saline-1').length > 0) { $('.normal-saline-1').each(function(){ //console.log($(this).html() + '|' + $(this).position().left+ '|' + $(this).position().top); var left_value = $(this).position().left - 16; var top_value = $(this).position().top + 17; var div_obj = $(this).parent().parent().children('.normal-saline-div-1').get(0); $(div_obj).css({position:'absolute',left:left_value + 'px',top:top_value + 'px'}); }); } if ($('.normal-saline-2').length > 0) { $('.normal-saline-2').each(function(){ //console.log($(this).html() + '|' + $(this).position().left+ '|' + $(this).position().top); var left_value = $(this).position().left -15; var top_value = $(this).position().top + 17; var div_obj = $(this).parent().parent().children('.normal-saline-div-2').get(0); $(div_obj).css({position:'absolute',left:left_value + 'px',top:top_value + 'px'}); }); } if ($('.normal-saline-5').length > 0) { $('.normal-saline-5').each(function(){ //console.log($(this).html() + '|' + $(this).position().left+ '|' + $(this).position().top); //console.log($(this).position().left+ '|' + $(this).position().top); var left_value = $(this).position().left -15; var top_value = $(this).position().top + 17; var div_obj = $(this).parent().parent().children('.normal-saline-div-5').get(0); $(div_obj).css({position:'absolute',left:left_value + 'px',top:top_value + 'px'}); }); } if ($('.normal-saline-6').length > 0) { $('.normal-saline-6').each(function(){ //console.log($(this).html() + '|' + $(this).position().left+ '|' + $(this).position().top); //console.log($(this).position().left+ '|' + $(this).position().top); var left_value = $(this).position().left -15; var top_value = $(this).position().top + 17; var div_obj = $(this).parent().parent().children('.normal-saline-div-6').get(0); $(div_obj).css({position:'absolute',left:left_value + 'px',top:top_value + 'px'}); }); } } function normalSalineDisplacement2() { $('.normal-saline-1').each(function(){ //console.log($(this).html() + '|' + $(this).position().left+ '|' + $(this).position().top); var left_value = $(this).position().left - 16; var top_value = $(this).position().top + 25; var div_obj = $(this).parent().parent().children('.normal-saline-div-1').get(0); $(div_obj).css({position:'absolute',left:left_value + 'px',top:top_value + 'px'}); }); $('.normal-saline-2').each(function(){ //console.log($(this).html() + '|' + $(this).position().left+ '|' + $(this).position().top); var left_value = $(this).position().left -15; var top_value = $(this).position().top + 25; var div_obj = $(this).parent().parent().children('.normal-saline-div-2').get(0); $(div_obj).css({position:'absolute',left:left_value + 'px',top:top_value + 'px'}); }); } /* * @page: Product Details * @effect: Solubility */ function fnTooltip(sign, tooltip){ var timerSolubility = 0; $(sign).mouseenter(function() { clearTimeout(timerSolubility); var tooltipIndex = $('span[class^=normal-saline]').index(this); //alert(tooltipIndex); $(tooltip).eq(tooltipIndex).show(); }); $(sign).mouseleave(function() { var tooltipIndex = $('span[class^=normal-saline]').index(this); // alert(tooltipIndex); timerSolubility = setTimeout(function() { $(tooltip).eq(tooltipIndex).hide(); }, 200); }); $(tooltip).mouseenter(function() { clearTimeout(timerSolubility); $(this).show(); }); $(tooltip).mouseleave(function() { timerSolubility = setTimeout(function() { // console.log($('.ss-vivo-list').find('.tooltip-panel').index(this)); $('.tooltip-panel').hide(); }, 120); }); } function getElementLeft(element){ var actualLeft = element.offsetLeft; var current = element.offsetParent; while (current !== null){ actualLeft += current.offsetLeft; current = current.offsetParent; } return actualLeft; } function getElementTop(element){ var actualTop = element.offsetTop; var current = element.offsetParent; while (current !== null){ actualTop += current.offsetTop; current = current.offsetParent; } return actualTop; } function isNumber(val){ var regPos = /^\d+(\.\d+)?$/; //非负浮点数 var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数 if(regPos.test(val) || regNeg.test(val)){ return true; }else{ return false; } } function checkLibraryQuantity() { var unit = $('#amountUnit option:selected').text(); var optionValue = $('#sel-container option:selected').val(); var options = $('#sel-container').find('option'); removeAttrContainer(options); $("#sel-container option[value='" + optionValue + "']").attr("selected", "selected"); if (unit == 'mg') { //options[1].setAttribute("disabled", "disabled"); if (optionValue == '384-well Plate Microplate with Peelable Foil Seal') { $("#sel-container").get(0).selectedIndex=0; } $("#sel-container option[value='384-well Plate Microplate with Peelable Foil Seal']").remove(); } else { var count = $("#iqDetail_productCount").val(); if (isNumber(count)) { if (count > 100) { //options[0].setAttribute("disabled", "disabled"); //options[1].setAttribute("disabled", "disabled"); $("#sel-container").get(0).selectedIndex=2; $("#sel-container option[value='96-well Plate with Peelable Foil Seal']").remove(); $("#sel-container option[value='384-well Plate Microplate with Peelable Foil Seal']").remove(); } else if (count > 50) { //options[1].setAttribute("disabled", "disabled"); if (optionValue == '384-well Plate Microplate with Peelable Foil Seal') { $("#sel-container").get(0).selectedIndex=0; } $("#sel-container option[value='384-well Plate Microplate with Peelable Foil Seal']").remove(); } } } } function removeAttrContainer(options){ // for(var i = 0; i