簡體   English   中英

定義 smoothScroll.init(); 在單獨的文件中

[英]Defining smoothScroll.init(); in separate file

我正在使用 smooth-scroll.js 並調用smoothScroll.init(); 在我的腳注中腳本標簽之間。 一切都很好,但我想移動smoothScroll.init(); 到我的“site.js”文件。 但是,當我這樣做時,它不起作用,並且出現了smoothScroll.init();錯誤smoothScroll.init(); 沒有定義。 我需要做什么來定義它並使其在 site.js 中工作。 非常感謝你花時間陪伴!

確保您的site.js腳本標簽在smooth-scroll.js標簽之后。
如果是之前,將在定義之前調用smoothScroll.init()

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM