You should make use of the onLeave
callback or if you prefer, the afterLoad
callback.
This way you can fire something when you are moving from one to another slide.
jQuery:
$.fn.fullpage({
afterLoad: function (anchor, index) {
$('#cog').toggleClass('active');
}
});
CSS
#cog {
background: white;
border-radius: 10px;
width: 40px;
height: 40px;
position: fixed;
top: 20px;
left: 20px;
}
#cog.active {
transform: rotate(180deg);
-webkit-transform: rotate(180deg);
-moz-transform: rotate(180deg);
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}