代碼是這樣的:<script> $("#modal2Button").click(function() { $("#modal1").fadeOut(); setTimeout(function() { $("#modal2").fadeIn(); }, 400) }); $("#close-button").click(function() { setTimeout(function() { $("#modal1").fadeIn(); $("#modal2").fadeOut(); }, 1000) });</script>當我將 jQuery 粘貼為單獨的文件并將其鏈接到 <head><head><script src="sample_code.js"></script></head>出于某種原因,這不起作用?任何幫助將不勝感激!
當您將 JavaScript (jQuery) 作為單獨的文件鏈接時,它有時不起作用
喵喔喔
2021-06-07 13:47:10