Parcourir la source

wait until loaded

huai-sian il y a 3 ans
Parent
commit
50aef8f440
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 4 1
      hhh-readmore.html

+ 4 - 1
hhh-readmore.html

@@ -238,7 +238,8 @@
       </div>
       </div>
       <button class="prefer-form__submit">送出</button>
       <button class="prefer-form__submit">送出</button>
     </div>`
     </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)" );
     $(Str).insertAfter( ".article__contexts>p:nth-of-type(2)" );
    
    
     let height = $('.article__title').height() + 
     let height = $('.article__title').height() + 
@@ -291,6 +292,8 @@
             $('.article__contexts>p:nth-of-type(3)').css('padding-top', 0);
             $('.article__contexts>p:nth-of-type(3)').css('padding-top', 0);
           }
           }
         })
         })
+    };
+    
 
 
   </script>
   </script>
 </body>
 </body>