简体   繁体   中英

carouFredSel slider - prev,next and pagination not working

I am using the carouFredSel jquery plugin for a website I'm making. I'm having some issues with the " prev ", " next " and " pagination " containers. The images show up and start sliding but I cant navigate (prev/next) and I cant see the pagination itself..

You can see the page here: http://goo.gl/pJLNN

The slider is on the top. Caroufredsel is initialized in bbody.js upon DOM ready. Does anyone have any ideas?

In order to correct the images positions you need to add or change the absolute position of every image container.

Since the type of animation you chosen is Crossfade then all the images must be in top of each other to make it work, otherwise by default the are next to each other.

So in the css put this:

#rotate > div {
float: left;
display: block;
width: 100%;
height: 650px;
position: absolute;
left: 0;
}

To correct next and prev you need to make a small fix to the js, this is the correct way of calleing the buttons

prev: {
       button  : "#msprev"
},
next: {
       button  : "#msnext"
},

The same happens to pagination, correct it:

pagination: {
    container: '#pager'
}

For anyone else facing this issue, another reason for the prev, next & pagination links not working is that the element IDs may have been duplicated somewhere else on your page. I had

prev: {
       button  : "#prev3"
},
next: {
       button  : "#next3"
},

There two elements with id="prev3 on the page. Same for id="next3" . Once I changed the IDs to make them unique, the navigation started working correctly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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