I’ve been working on this issue for several days and could really use some guidance since I’m still learning web development.
I’m attempting to integrate an ImageSlider jQuery plugin into my Shopify store but can’t get it to display properly. I’ve tried adapting the documentation examples to work with Shopify’s liquid templating but the carousel isn’t appearing on my pages.
Here’s my header configuration:
{{ 'main-styles.css' | asset_url | stylesheet_tag }}
{{ 'carousel-theme.css' | asset_url | stylesheet_tag }}
{{ 'image-slider-v2.min.css' | asset_url | stylesheet_tag }}
{{ 'https://code.jquery.com/jquery-1.6.4.min.js' | script_tag }}
{{ 'jquery-2.1.1.min.js' | asset_url | script_tag }}
{{ 'jquery.transitions.1.2.min.js' | asset_url | script_tag }}
{{ 'image-slider-v2.min.js' | asset_url | script_tag }}
My page template includes this JavaScript:
<script>
$(document).ready(function() {
var mainCarousel = new ImageSlider("#photo-carousel", {
animationEffects: ["slideright", "fadeIn"]
});
});
</script>
{{ page.content }}
<script>
imageSlider.initializeTheme('{{ 'image-slider-v2.min.js' | asset_url }}');
$('#photo-carousel').imageSlider({
centerImages: true,
disableNavOnEnd: true,
autoPlay: true,
autoPlayInterval: 4000,
pauseOnMouseOver: true,
startAutoPlay: true,
transitionDuration: 600,
imageGap: 0
});
</script>
The HTML markup I’m using:
<div id="photo-carousel">
<a href="/collections/featured">
<img src="{{ 'hero-image.jpg' | asset_url }}" alt="{{ collection.title }}" />
</a>
</div>
Any suggestions would be greatly appreciated!