MeteorJS外部文件:css和js [英] MeteorJS external files: css and js
问题描述
我试图将这个引导主题添加到我的项目中 http://ironsummitmedia.github.io/ startbootstrap-creative / 这个主题在jquery和bootstrap旁边有4个js文件。
我在我的项目中添加了jquery和bootstrap,这4个文件是兼容的正如Metereor doc所说的那样,但它没有起作用。当向下滚动页面时导航栏效果不起作用,并且我有时(如果我不改变.js文件名称)出现了关于fitText.js文件的错误。
PD1 :兼容性文件夹按字母顺序加载.js文件。
PD2:我尝试了很多我发现的建议,这里是堆栈和流星论坛,但没有任何发生。 / p>
我将css和less文件放在client / lib / stylesheet中,它们可以正常运行。
我确实要让这个主题在流星中起作用。
谢谢。
注意:
JS文件
- 1.jquery.easing.min.js
- 2.jquery.fittext.js
- 3.wow.min.js
-
4.creative.js
我将它们放在创意主题加载顺序中
我找到了一个完美的解决方案。我希望它可以帮助其他人,
我使用jquery和.render在页面完全呈现后加载脚本以及我想要使用的所有效果
Template.layout.rendered = function(){
$('head')。append('< script type =text / javascript SRC = / JavaScript的/ jquery.easing.min.js >< /脚本>');
$('head')。append('< script type =text / javascriptsrc =/ javascript / jquery.fittext.js>< / script>');
$('head')。append('< script type =text / javascriptsrc =/ javascript / wow.min.js>< / script>');
$('head')。append('< script type =text / javascriptsrc =/ javascript / creative.js>< / script>');
}
I am trying to add this bootstrap theme to my project http://ironsummitmedia.github.io/startbootstrap-creative/ this theme have 4 js files beside jquery and bootstrap.
I added jquery and bootstrap to my project, This 4 files are in the compatibility folder, as Metereor doc said, but It did not work. The navbar effect when scroll down the page is not working and I sometimes(If I leave the .js files name untouched) got an error about fitText.js file.
PD1: Compatibility folder loads the .js files in alphabetical order.
PD2: I tried a lot of suggestions that I found, here in stack and meteor forums but nothing happen.
I put css and less files in client/lib/stylesheet and they seens to be ok.
What can I do to make this theme to work in meteor.?
Thanks.
NOTE: JS Files
- 1.jquery.easing.min.js
- 2.jquery.fittext.js
3.wow.min.js
4.creative.js
I place them with creative theme load order
I found a solution that works perfect. I hope it could help other people, I use jquery and .rendered to load the scrips after the page is fully rendered and all the effects I wanted to use where available
Template.layout.rendered = function() {
$('head').append('<script type="text/javascript" src="/javascript/jquery.easing.min.js"></script>');
$('head').append('<script type="text/javascript" src="/javascript/jquery.fittext.js"></script>');
$('head').append('<script type="text/javascript" src="/javascript/wow.min.js"></script>');
$('head').append('<script type="text/javascript" src="/javascript/creative.js"></script>');
}
这篇关于MeteorJS外部文件:css和js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!