Small Pop Up window





CODE


<button onclick="openPopup()">Open Popup</button>


<script>
function openPopup() {
// URL of the website you want to open in the popup window
var websiteURL = "https://www.example.com";


// Define the width and height of the popup window
var popupWidth = 400;
var popupHeight = 300;


// Calculate the position of the popup window to center it on the screen
var left = (screen.width - popupWidth) / 2;
var top = (screen.height - popupHeight) / 2;


// Open the popup window with the specified URL, width, height, and position
window.open(websiteURL, "PopupWindow", "width=" + popupWidth + ", height=" + popupHeight + ", left=" + left + ", top=" + top);
}
</script>

Post a Comment

Previous Post Next Post