Jelajahi Sumber

wait until loaded

huai-sian 3 tahun lalu
induk
melakukan
50aef8f440
1 mengubah file dengan 4 tambahan dan 1 penghapusan
  1. 4 1
      hhh-readmore.html

+ 4 - 1
hhh-readmore.html

@@ -238,7 +238,8 @@
       </div>
       <button class="prefer-form__submit">送出</button>
     </div>`
-    $( "<div class='article__readMore article__readMore--gradHight'><a class='article__readMore__text'>閱讀更多</a></div>" ).insertAfter( ".article__contexts>p:nth-of-type(2)" );
+    window.onload = function() {
+      $( "<div class='article__readMore article__readMore--gradHight'><a class='article__readMore__text'>閱讀更多</a></div>" ).insertAfter( ".article__contexts>p:nth-of-type(2)" );
     $(Str).insertAfter( ".article__contexts>p:nth-of-type(2)" );
    
     let height = $('.article__title').height() + 
@@ -291,6 +292,8 @@
             $('.article__contexts>p:nth-of-type(3)').css('padding-top', 0);
           }
         })
+    };
+    
 
   </script>
 </body>