首页  >>  来自播客: The Tim Ferriss Show 更新   反馈

#661: Dr. Peter Attia — The Science and Art of Longevity, Optimizing Protein, Alcohol Rules, Lessons from Glucose Monitoring with CGMs, Boosting Your VO2 Max, Preventing Alzheimer's Disease, Early Cancer Detection, How to Use DEXA Scans, Nature’s Longevity Drug, and More

发布时间 2023-03-15 00:20:16    来源
您需要登陆,系统才能为您提取文字并进行中文翻译 (首页右上角可以用google账户登陆)



function setTranscriptHeight() { const transcriptDiv = document.querySelector('.transcript'); const rect = transcriptDiv.getBoundingClientRect(); const tranHeight = window.innerHeight - rect.top - 10; transcriptDiv.style.height = tranHeight + 'px'; if (false) { console.log('window.innerHeight', window.innerHeight); console.log('rect.top', rect.top); console.log('tranHeight', tranHeight); console.log('.transcript', document.querySelector('.transcript').getBoundingClientRect()) //console.log('.video', document.querySelector('.video').getBoundingClientRect()) console.log('.container', document.querySelector('.container').getBoundingClientRect()) } if (isMobileDevice()) { const videoDiv = document.querySelector('.video'); const videoRect = videoDiv.getBoundingClientRect(); videoDiv.style.position = 'fixed'; transcriptDiv.style.paddingTop = videoRect.bottom+'px'; } const videoDiv = document.querySelector('.video'); videoDiv.style.height = parseInt(videoDiv.getBoundingClientRect().width*390/640)+'px'; console.log('videoDiv', videoDiv.getBoundingClientRect()); console.log('videoDiv.style.height', videoDiv.style.height); } window.onload = function() { setTranscriptHeight(); }; if (!isMobileDevice()){ window.addEventListener('resize', setTranscriptHeight); }