Skip to content

Commit

Permalink
Create responseive.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Inglan authored Apr 7, 2024
1 parent bb81c72 commit b672842
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions responseive.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<script>
// Function to check window width
function checkWindowWidth() {
// Get the width of the window
var windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;

// Check if the window width is less than 768px
if (windowWidth < 768) {
// Do something if window width is under 768px
window.close()
// You can perform any action here, such as showing/hiding elements, etc.
} else {
// Do something else if window width is greater than or equal to 768px

}
}

// Call the function when the page loads
checkWindowWidth();

// Listen for window resize events
window.addEventListener('resize', function() {
// Call the function when the window is resized
checkWindowWidth();
});
</script>
<h1>This window is reponsive and responds when it is on a phone</h1

0 comments on commit b672842

Please sign in to comment.