Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
397 views
in Technique[技术] by (71.8m points)

intersection observer - I can't change Value of Variable using match media in Javascript

I just defined a variable called "option" for my Intersection Observer Threshold but it's not changing when I'm using match media.

here's the code :

{
let option = {threshold:0.8};
let mediaQuery1 = window.matchMedia('(min-width:1250px)');
if(mediaQuery1.matches){
       option.threshold= 1;
}
question from:https://stackoverflow.com/questions/65889586/i-cant-change-value-of-variable-using-match-media-in-javascript

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...