From 69d589f6691157baf71bc043853514516c331939 Mon Sep 17 00:00:00 2001 From: JamesSand Date: Wed, 6 Dec 2023 18:00:34 +0800 Subject: [PATCH] fix size of img1 --- index.html | 5 +++-- static/js/index.js | 32 +++++++++++++++++++------------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/index.html b/index.html index ea157bd..20f78e4 100644 --- a/index.html +++ b/index.html @@ -41,7 +41,7 @@ - + @@ -404,7 +404,7 @@


 

-
+
@@ -1159,4 +1159,5 @@

+ diff --git a/static/js/index.js b/static/js/index.js index 0cc2df7..d5425d3 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -174,20 +174,26 @@ $(document).ready(function() { bulmaSlider.attach(); }) +function changeSize(){ + const height= $('#resize_image1').height() + const width= $('#resize_image1').width() + $('#row_1_cake').height(height) + $('#row_1_cake').width(width) + $('#row_1_keyboard').height(height) + $('#row_1_keyboard').width(width) +} +changeSize() + window.addEventListener('resize', function(event) { + changeSize() + if(height/width>1.5){ + window.location.reload() + } +}, false); - -// window.addEventListener('resize', function(event) { -// // ... +// $(window).resize(function() { +// //resize just happened, pixels changed // console.log("window resize") - -// // location.reload(); - -// }, true); - -$(window).resize(function() { - //resize just happened, pixels changed - console.log("window resize") - location.reload(); -}); +// location.reload(); +// });