Joomla 3.x:如何添加或链接到外部javascript文件 [英] Joomla 3.x: How to add or Link to a external javascript file
本文介绍了Joomla 3.x:如何添加或链接到外部javascript文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想为Joomla使用视差.
I want to use a parallax for my Joomla.
具体来说,这是一个: https://github.com/IanLunn/jQuery-Parallax
Specifically this one: https://github.com/IanLunn/jQuery-Parallax
如何将它们插入到我的joomla页面中.
How can I insert these to my joomla pages.
<script type="text/javascript" src="scripts/jquery.parallax-1.1.3.js"></script>
<script type="text/javascript" src="scripts/jquery.localscroll-1.2.7-min.js"></script>
<script type="text/javascript" src="scripts/jquery.scrollTo-1.4.2-min.js"></script>
我正在Helix Framework中使用此模板
I am using this template with Helix Framework
http://demo.joomshaper.com/?template=radon#
推荐答案
在Joomla文档中说明了将Java脚本库添加到Joomla安装(模板或组件)中的正确方法:
The proper way to add Java-Script Libraries in to your Joomla Installation (Template or Components) is explained in Joomla Docs:
<?php
$document = JFactory::getDocument();
$document->addScript('/media/system/js/sample.js');
?>
参考:添加JavaScript
这篇关于Joomla 3.x:如何添加或链接到外部javascript文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文