i don't know what to do... i want the output to display the function with the width that is greater than 970 but it doesn't show up.... and same goes with the other width declared i want to set a function inside them and show the function please help me![]()
Code:function myFunction() { var w=window.outerWidth; var h=window.outerHeight; var txt="Window size: width=" + w + ", height=" + h; if(w>970){ function highest() { //higher document.getElementById("demo2").innerHTML="10 sec interval //highest"; setTimeout("lower1()", 10000); } function lower1() { //lower1 document.getElementById("demo2").innerHTML="10 sec interval //lower1"; setTimeout("lower2()", 10000); } function lower2() { //lower2 document.getElementById("demo2").innerHTML="10 sec interval //lower2"; setTimeout("highest()", 10000); } } else if(w>768){ //function 768 lower1 } else if(w>640){ //function 640 lower2 } document.getElementById("demo").innerHTML=txt; }


Reply With Quote
Bookmarks