向Shopify添加自定义CSS和JS [英] Adding custom CSS and JS to Shopify
问题描述
我正在使用大西洋主题,在Shopify上获取页面的垂直标签。
由于这个主题在默认情况下没有垂直选项卡,我使用外部JS和CSSjquery-jvert-tabs。
I am working on getting vertical tabs for a page on Shopify, using the 'Atlantic' theme. As this theme does not have vertical tabs by default, I have used the external JS and CSS "jquery-jvert-tabs".
我的问题是,如果我将JS和CSS文件作为资产上传,我如何将它们链接到我想使用它们的页面以及如何使用
My question is, if I upload the JS and CSS files as assets, how do I link them to the page on which I want to use these and how to make use of these on the page after that, if I have certain style elements available there too?
推荐答案
只需上传您的<$ c $
Simply upload your filename.js
file in the assets folder.
将 assets 文件夹中的
then drop the following in your theme.liquid
head section:
{{ 'filename.js' | asset_url | script_tag }}
顺便说一句,你应该重命名你的文件并添加.liquid扩展
filename.js.liquid
祝你好运!
这篇关于向Shopify添加自定义CSS和JS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!