我想添加 lightbox
以在我的一个特定 CMS 页面上播放视频。我将 CSS 文件放在 JS/MY THEME/JQUERY/PLUGIN/VENOBOX/CSS/myfile.css
中,将 JS 文件放在 JS/MY THEME/jquery/plugins/venobox/js/myfile .js
,但它没有用。我什么都做,但不工作。
我在 CMS 页面的布局更新 XML 中使用以下代码:
<reference name="head">
<action method="addItem">
<type>js_css</type>
<name>smartwave/jquery/plugins/venobox/css/html5boxplayer.css</name>
</action>
<action method="addJs">
<script>
smartwave/jquery/plugins/venobox/js/html5lightbox.js
</script>
</action>
<action method="addJs">
<script>
smartwave/jquery/plugins/venobox/js/jquery.js
</script>
</action>
</reference>
如果有人实现了此功能,请提供帮助。提前致谢。
最佳答案
对于 css,您需要将文件包含在 xml 文件中,如下所示:
<action method="addItem">
<type>skin_css</type>
<name>css/html5boxplayer.css</name>
</action>
对于js你需要做同样的操作如下:
<action method="addItem">
<type>skin_js</type>
<name>js/html5lightbox.js</name>
</action>
注意类型声明。当然,所有文件都应放在主题下的特定文件夹中。
关于javascript - 如何应用自定义 CSS 和 Javascript 特定的 CMS 页面 Magento,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30476255/