I am trying to add a swiper to the official rss news module, but I am having some problems. Whenever i open the page, the slider only works, the first time the getDom function is called. Once the rss feed is fetched and ready, the getDom function is called again, but this time the swiper doesnt work.
I am using this swiper http://idangero.us/swiper/demos/
and i am initating the swiper by creating a swiper object and passing it the class for the swiper div.
// Override dom generator.
getDom: function() {
if (this.newsItems.length > 0){
var swiper = new Swiper('.swiper-container');
var container = document.createElement("div");
container.className = "swiper-container";
var wrapper = document.createElement("div");
wrapper.className = "swiper-wrapper";
...... (more code ......
return container;
I cant figure out why the swiper only works the first time the getDom function is called. Any suggestions?