generated from HugoBlox/theme-research-group
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
1 addition
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1 @@ | ||
<style> | ||
/* Container for the horizontal timeline */ | ||
#twitter-timeline-container { | ||
overflow-x: auto; /* Enable horizontal scrolling */ | ||
white-space: nowrap; /* Prevent line breaks */ | ||
} | ||
|
||
/* Style the iframe container */ | ||
.twitter-timeline { | ||
display: inline-block; | ||
vertical-align: top; | ||
white-space: normal; /* Allow wrapping within each tweet */ | ||
width: 300px; /* Adjust width of each tweet */ | ||
margin-right: 10px; /* Space between tweets */ | ||
} | ||
</style> | ||
<div class="twitter-timeline-container"> | ||
<a class="twitter-timeline" href="https://twitter.com/MICCAI_Society?ref_src=twsrc%5Etfw" style="display: none;">Tweets by MICCAI_Society</a> | ||
</div> | ||
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> | ||
<script> | ||
window.addEventListener('load', function() { | ||
const container = document.getElementById('twitter-timeline-container'); | ||
|
||
// Wait until the iframe is loaded and modify its content | ||
const observer = new MutationObserver(() => { | ||
const iframe = container.querySelector('iframe'); | ||
if (iframe) { | ||
iframe.onload = () => { | ||
const iframeDoc = iframe.contentDocument || iframe.contentWindow.document; | ||
iframeDoc.documentElement.style.overflowX = 'auto'; // Enable horizontal scrolling within the iframe | ||
iframeDoc.documentElement.style.whiteSpace = 'nowrap'; // Prevent line breaks inside the iframe | ||
}; | ||
} | ||
}); | ||
|
||
observer.observe(container, { childList: true }); | ||
}); | ||
</script> | ||
<a class="twitter-timeline" href="https://twitter.com/MICCAI_Society?ref_src=twsrc%5Etfw" style="display: none;" data-tweet-limit="5">Tweets by MICCAI_Society</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> |