【问题标题】:Uncaught TypeError: $(...).ThreeSixty is not a function未捕获的 TypeError: $(...).ThreeSixty 不是函数
【发布时间】:2020-04-15 04:10:36
【问题描述】:

我有一个 wordpress 网站,在主页上我有一个 Elementor 中的标题和一个 360 度图像插件,没有活动标题可以完美地工作而没有错误,但是当我在 Elementor 中制作的标题处于活动状态时,360 度图像确实不起作用并在控制台Uncaught TypeError: $ (...). ThreeSixty is not a function 中显示此错误,我该如何解决?网址是Iwo 12

<!--SPV--><script type="text/javascript">//SPV
(function($) {
		var product_192346_houzH5 = $('#threesixty-slider-192346_houzH5').ThreeSixty({
		totalFrames: 50,
		endFrame: 0,
		currentFrame: 50,
		imgList: '.threesixty-images-192346_houzH5',
		progress: '.threesixty-spinner-192346_houzH5',
		preview: '.threesixty-preview-192346_houzH5',
		images: ['https://iwo12.com.br/wp-content/uploads/2019/12/1.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/2.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/3.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/4.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/5.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/6.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/7.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/8.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/9.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/10.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/12.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/13.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/14.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/15.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/16.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/17.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/18.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/19.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/20.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/21.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/23.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/24.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/25.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/26.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/27.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/28.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/29.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/30.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/31.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/32.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/34.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/35.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/36.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/37.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/38.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/39.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/40.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/41.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/42.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/43.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/44.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/45.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/46.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/47.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/48.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/49.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/50.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/51.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/52.jpg','https://iwo12.com.br/wp-content/uploads/2019/12/53.jpg'],
		height: 0,
		width: 1280,
		navigation: false,
		drag: true,
		showCursor: true,
		interval: 40,
		speedMultiplier: 7,
		monitorInt: 10,
				onReady: function() {
			$("#threesixty-slider-192346_houzH5").removeClass('threesixty-loading');
								}
			});
			}(jQuery));
</script>

【问题讨论】:

  • 你加载了 ThreeSixty 插件吗?
  • 我猜 ThreeSixty 脚本在您尝试运行时尚未加载。你能把它放入一个 jQuery 文档就绪处理程序,或者一个 elementor/frontend/init_complete 或类似的,如果存在的话?
  • 您能否使用可工作的 ThreeSixty 插件发布指向页面(在您的站点中)的链接?
  • 您究竟使用哪个插件来实现 360 度效果?
  • 我按照您的步骤添加了插件并在 wordpress header.php 中插入了&lt;script src="https://iwo12.com.br/wp-content/plugins/smart-product-viewer/includes/js/threesixty.min.js"&gt;&lt;/script&gt;,但现在它给出了错误“未捕获的 ReferenceError:jQuery 未定义”。 https://iwo12.com.br/

标签: javascript jquery html wordpress elementor


【解决方案1】:

我刚刚访问了您的网站,并查看了发生的情况。您的 jQuery 对象没有 ThreeSixty 方法,因为您从未加载过threesixty.js 插件。您的网页中没有&lt;script src="https://*somethingsomething*/jquery.threesixty.js"&gt;&lt;/script&gt;。下载插件,并将其添加为依赖项。

另外,另一个重要的事情是it's $(...).threeSixty 而不是it's $(...).ThreeSixty。第一个字母是小写

【讨论】:

  • 我按照您的步骤,添加了插件并在 wordpress header.php 中插入了
猜你喜欢
  • 1970-01-01
  • 2017-05-15
  • 1970-01-01
  • 1970-01-01
  • 2020-10-05
  • 2019-09-15
  • 2018-12-21
  • 2018-11-12
  • 2022-01-18
相关资源
最近更新 更多