I have a Jquery
code append both Css
and Js
file to create a banner-slider with Owlcarousel.
The jquery code had appended both into html
. The function .owlCarousel()
work fine but the css don't. In console, it only GET
the owl.carousel.js
file.
The one I found most like is this I already tried but count not get it working.
Jquery
$(document).ready(function(){
var u = document.createElement("link");
u.type = "text/css";
u.href = "https://myurl/OwlCarousel/dist/assets/owl.carousel.css";
$("#lookbookslider-2").append(u);
var t = document.createElement("script");
t.type = "text/javascript";
t.src = "https://myurl/OwlCarousel/dist/owl.carousel.js";
$("#lookbookslider-2").append(t);
$.getScript("https://myurl/OwlCarousel/dist/owl.carousel.js");
$("#lookbookslider-2").append("html here");
});
I dont have access to html
file. I can only work with my js file. How can I make the css file working? Or I have to append all the style directly?