Height/Width of embed inside of tab containers
-
I’ve got PDFs embedded in tabs (Kadence Blocks tab element). Some of the PDFs don’t work with the auto width/height when you switch to their associated tab.
I did notice that if you resize the browser window, the PDF would adjust and properly fit to the container. I added a script to send a resize event after a tab is clicked, but it hasn’t worked. Is there some other function I can use to force the plugin to refresh the PDF or recalculate the size?
<script>
const tabTitles = document.querySelectorAll('.kt-tab-title');
for (const tabTitle of tabTitles) {
? tabTitle.addEventListener('click', function() {
? ? setTimeout(() => {
? ? ? window.dispatchEvent(new Event('resize'));
? ? ? console.log("resize event");
? ? }, 300);
? });
}
</script>The page I need help with: [log in to see the link]
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- You must be logged in to reply to this topic.