Skip to content

Commit

Permalink
fix w setinterval
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesSand committed Dec 6, 2023
1 parent 7e097c5 commit a656eff
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ <h2 class="title is-3">
<span class="big_text">&nbsp;</span>
<br><br>
<div id="resize_image1">
<img src="static/jaxtapose_imgs/cake_kayboard_117/rec_img.png">
<img id="jaxtapose_img_1" src="static/jaxtapose_imgs/cake_kayboard_117/rec_img.png">
</div>
<!-- <img src="static/jaxtapose_imgs/cake_kayboard_117/rec_img.png"> -->
</div>
Expand Down
26 changes: 21 additions & 5 deletions static/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,26 @@ changeSize()
// }
}, false);

// $(window).resize(function() {
// //resize just happened, pixels changed
// console.log("window resize")
// location.reload();
// });


function set_jaxtapose_img_size(){
const height= $('#jaxtapose_img_1').height()
const width= $('#jaxtapose_img_1').width()
$('#row_1_cake').height(height)
$('#row_1_cake').width(width)
$('#row_1_keyboard').height(height)
$('#row_1_keyboard').width(width)
}

const size_timeout = setInterval(
function(){
// console.log("size timeout")
set_jaxtapose_img_size()
}, 100
)






0 comments on commit a656eff

Please sign in to comment.