mirror of
https://github.com/kevinveenbirkenbach/homepage.veen.world.git
synced 2026-02-23 03:02:44 +00:00
Added onclick functionality for menu items
This commit is contained in:
@@ -139,5 +139,20 @@ window.addEventListener('popstate', function(event) {
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Opens the current iframe URL in a new browser tab.
|
||||
*/
|
||||
function openIframeInNewTab() {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const iframeUrl = params.get('iframe');
|
||||
if (iframeUrl) {
|
||||
window.open(iframeUrl, '_blank');
|
||||
} else {
|
||||
alert('No iframe is currently open.');
|
||||
}
|
||||
}
|
||||
// expose globally so your template’s onclick can find it
|
||||
window.openIframeInNewTab = openIframeInNewTab;
|
||||
|
||||
// Adjust iframe height on window resize
|
||||
window.addEventListener('resize', syncIframeHeight);
|
||||
|
||||
Reference in New Issue
Block a user