简体   繁体   English

当我放入图库时,幻灯片放映停止了

[英]Slideshow stopped working when I put a gallery in

So I had a page, working perfectly fine with a nice little slider, but then... I put a gallery in which is working fine BUT the slider stopped working. 因此,我有了一个页面,可以使用一个不错的小滑块完美地工作,但是然后...我放了一个画廊,在其中工作正常,但是滑块停止了工作。 I'm thinking the JS on the gallery is somehow stopping the JS from the slider from working but I have no JS knowledge so I don't know, I deal with HTML and CSS, I will learn JS at some point but for now I am using codrops. 我认为图库中的JS会以某种方式阻止滑块上的JS正常工作,但是我没有JS知识,所以我不知道,我处理HTML和CSS,我会在某个时候学习JS,但是现在我在使用codrops。

The website is: http://www.maintenancebirmingham.co.uk/ here you can see the slider working fine, if you go to the gallery page: http://www.maintenancebirmingham.co.uk/gallery.html (or just click gallery) then you can see the problem. 网站是: http : //www.maintenancebirmingham.co.uk/ ,如果您转到图库页面,则可以在此处看到滑块的正常工作: http : //www.maintenancebirmingham.co.uk/gallery.html (或只需单击图库),就可以看到问题。

If you need any html/css/JS or anything else from the site please let me know, I'm not going to put it all up not because there is just too much and if anyone figures it out without needing it, life is good :) 如果您需要网站上的任何html / css / JS或其他任何内容,请告诉我,我不会把它全部摆上,不是因为有太多东西,如果有人能在不需要的地方弄清楚它,那么生活就是美好的:)

Thanks in advance guys. 在此先感谢大家。

Sounds like Culyx says, coin-slider-min.js is injecting code in jquery 1.4.2 then below your page jquery 1.7.1 is being loaded, so you override the code injected from coin-slider; 听起来像Culyx所说,coin-slider-min.js在jquery 1.4.2中注入代码,然后在页面1.jquery 1.7.1下面被加载,因此您覆盖了从coin-slider注入的代码;

You can try to remove jquery 1.4.2 (if it's possible) and put jquery on the header 您可以尝试删除jquery 1.4.2(如果可能)并将jquery放在标题上

or put coin-slider-min.js after jquery 1.7.1 或在jquery 1.7.1之后放置coin-slider-min.js

at least seems to be running fine here. 至少在这里似乎运行良好。

I just reloaded the coin-slider-min.js from your page (with broken code), then I initialize the element with coin slider. 我只是从您的页面重新加载了coin-slider-min.js(代码已损坏),然后使用硬币滑块初始化了元素。 This is how I discovered, but don't use it in your current code! 这就是我发现的方式,但是不要在当前代码中使用它!

function load_js()
{
   var head= document.getElementsByTagName('head')[0];
   var script= document.createElement('script');
   script.type= 'text/javascript';
   script.src= 'coin-slider.min.js';
   head.appendChild(script);
}
load_js();
//after load
$('#coin-slider').coinslider({ effect: 'rain', delay: 4000, width: 1040, height:435, hoverPause: false });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM