我想使用Flexslider显示库,如教程中所示:
https://www.advancedcustomfields.com/resources/gallery/
因此,我访问了Flexslider站点并遵循以下步骤:
https://woocommerce.com/flexslider/
我应该把这个代码放在哪里?
<!-- Place somewhere in the <head> of your document -->
<link rel="stylesheet" href="flexslider.css" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="jquery.flexslider.js"></script>
我试着上传flexslider。css文件和和jquery。flexslider。js通过FTP连接到我网站的根文件夹,然后我转到标题。我的主题(Divi)的php文件,我这样调用它们:
<?php wp_head(); ?>
<!-- Place somewhere in the <head> of your document -->
<link rel="stylesheet" href="http://electives-abroad.org/flexslider.css" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="http://electives-abroad.org/jquery.flexslider.js"></script>
</head>
结果是,我没有得到滑块,我的网站的所有图片都消失了。如何才能正确执行?
更新
这就是我将代码放在标题上时发生的情况。php,我网站上的大多数图片都不可见,控制台会抛出以下内容:
Uncaught TypeError: n(...).on is not a function
at Object.<anonymous> (n2.min.js?1552618971:1)
at n2.min.js?1552618971:1
at N2Deferred._doCallbacks (n2.min.js?1552618971:1)
at N2Deferred.resolve (n2.min.js?1552618971:1)
at s (n2.min.js?1552618971:1)
at N2Deferred._doCallbacks (n2.min.js?1552618971:1)
at N2Deferred.resolve (n2.min.js?1552618971:1)
at n2.min.js?1552618971:1
at N2Deferred._doCallbacks (n2.min.js?1552618971:1)
at N2Deferred.then (n2.min.js?1552618971:1)
custom.js?ver=5.1.1:162 Uncaught TypeError: SFSI(...).on is not a function
at custom.js?ver=5.1.1:162
custom.js?ver=3.0.65:1318 Uncaught TypeError: $(...).on is not a function
at custom.js?ver=3.0.65:1318
at custom.js?ver=3.0.65:1418
smartslider-frontend.min.js?1552619634:1 Uncaught TypeError: this.sliderElement.on is not a function
at t.SmartSliderAbstract.onSliderHasDimension (smartslider-frontend.min.js?1552619634:1)
at Object.g (jquery.min.js:16)
at Object.resolveWith (jquery.min.js:16)
at Object.done (jquery.min.js:16)
at t.SmartSliderAbstract.waitForDimension (smartslider-frontend.min.js?1552619634:1)
at t.SmartSliderAbstract.onSliderExists (smartslider-frontend.min.js?1552619634:1)
at Object.g (jquery.min.js:16)
at Object.resolveWith (jquery.min.js:16)
at Object.resolve (jquery.min.js:16)
at s (smartslider-frontend.min.js?1552619634:1)
VM212:1 Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.