Anyone can help me out how to use owl carousel using a custom theme by using require js I have downloaded owl carousel zip file from an official website. I want to use this owl carousel in my block in admin I have created a custom theme and apply it in all stores using admin.make an owl carousel using custom theme
-
You can use any of the slider modules available in marketManish Joy– Manish Joy2019年03月07日 11:33:18 +00:00Commented Mar 7, 2019 at 11:33
-
1See this: magento.stackexchange.com/questions/259904/…Shoaib Munir– Shoaib Munir2019年03月07日 11:34:53 +00:00Commented Mar 7, 2019 at 11:34
-
@ManishJoy I dont know which css and js files should be there in custom theme and call them in my block using require jsHarsh Jayswal– Harsh Jayswal2019年03月07日 11:41:36 +00:00Commented Mar 7, 2019 at 11:41
-
just 'jquery' & 'owlcarousel'Manish Joy– Manish Joy2019年03月12日 12:40:08 +00:00Commented Mar 12, 2019 at 12:40
1 Answer 1
file : - requirejs-config.js
var config = {
paths: {
owlcarousel: 'Vendorname_Modulename/js/owl/owl.carousel',
},
shim: {
owlcarousel: {
deps: ['jquery']
}
}
};
.Phtml File need to define class name
<ol class="products list classname owl-carousel">
<script type="text/javascript">
require(['owlcarousel'], function () {
jQuery(document).ready(function(){
jQuery('.classname').owlCarousel({
items:5,
loop:true,
dots:true,
margin: 10,
nav:true,
autoplay:true,
callbacks:false,
responsive:{
0:{
items:2,
},
480:{
items:2,
},
768:{
items:3,
},
1366:{
items:5,
}
}
})
});
});
</script>
-
Where to put require js file ?Harsh Jayswal– Harsh Jayswal2019年03月07日 12:25:54 +00:00Commented Mar 7, 2019 at 12:25
-
In
vendor/module/view/frontenduser68317– user683172019年03月07日 12:26:52 +00:00Commented Mar 7, 2019 at 12:26 -
i want to do it using custom themeHarsh Jayswal– Harsh Jayswal2019年03月07日 12:31:47 +00:00Commented Mar 7, 2019 at 12:31
-
You can have a module along with the themeManish Joy– Manish Joy2019年03月07日 12:59:41 +00:00Commented Mar 7, 2019 at 12:59
Explore related questions
See similar questions with these tags.