global.js 493 B

12345678910111213141516171819
  1. window.onload = function () {
  2. let $article = $('.theme-default-content > h1');
  3. if ($article.length <= 0) return null;
  4. let clientWidth = $article[0].clientWidth;
  5. // 根据ID获取iframe对象
  6. var ifr = document.getElementById('B-Video');
  7. if (ifr) {
  8. ifr.style.width = clientWidth + 'px';
  9. if (clientWidth < 450) {
  10. ifr.style.height = (523 * clientWidth) / 700 + 'px'
  11. } else {
  12. ifr.style.height = '450px'
  13. }
  14. }
  15. };