From 9960d8f885edb36275eb926e7baa13b8214534c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=86=E7=93=9C=E4=BA=91?= Date: Mon, 31 Jul 2023 15:49:27 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E8=BF=87=E5=88=A4=E6=96=ADheight?= =?UTF-8?q?=E6=9D=A5=E5=88=A4=E6=96=AD=E8=AF=84=E8=AE=BA=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- post_example.html | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/post_example.html b/post_example.html index 431be3b..f8e8d65 100644 --- a/post_example.html +++ b/post_example.html @@ -150,24 +150,18 @@ function openComments(){ } function iFrameLoading(){ - utterancesFrame=document.getElementsByClassName("utterances-frame")[0]; - if(utterancesFrame!=null){ - if (utterancesFrame.attachEvent){ - utterancesFrame.attachEvent("onload", function(){iFrameOK();}); - } - else { - utterancesFrame.onload = function(){iFrameOK();}; + var utterances=document.getElementsByClassName('utterances'); + if(utterances.length==1){ + if(utterances.style.height!=""){ + utterancesLoad=1; + int=window.clearInterval(int); + document.getElementById("comments").setAttribute("style","border-top: 1px solid var(--color-border-default);margin-top:64px;"); + document.getElementById("cmButton").style.display="none"; + console.log("utterances Load OK"); } + } } -function iFrameOK(){ - utterancesLoad=1; - int=window.clearInterval(int); - document.getElementById("comments").setAttribute("style","border-top: 2px solid var(--color-border-default);margin-top:64px;"); - document.getElementById("cmButton").style.display="none"; - console.log("utterances Load OK"); -} -