This is the first time I try to apply a media queries rule in java script, and since I am a beginner, I believe something in this syntax is wrong, since the only function that is working is the second one (visible: 3) and in all viewports.
var mq = window.matchMedia('@media all and (max-width: 768px)');
if (mq.matches) {
$("#carrossel").jCarouselLite({
btnPrev: ".anterior"
, btnNext: ".proximo"
, visible: 1
, auto: 2000
, speed: 1000
});
} else {
$("#carrossel").jCarouselLite({
btnPrev: ".anterior"
, btnNext: ".proximo"
, visible: 3
, auto: 2000
, speed: 1000
});
}