cancel
Showing results for 
Search instead for 
Did you mean: 

Requirejs not working consistently on fotorama

Requirejs not working consistently on fotorama

The theme that I use (porto) uses Fotorama for the image gallery. Most of the time it doesn't load, and I get the console error ```Uncaught TypeError: $fotoramaElement.fotorama is not a function```

 

I shimed it in requirejs like this and removed jquery from default_head_blocks.xml but I keep getting that error 

 

var config = {
paths: {
'parallax': 'js/jquery.parallax.min',
'sfowlcarousel': 'owl.carousel/owl.carousel.min',
'owl.carousel_thumbs': 'owl.carousel/owl.carousel2.thumbs',
'floatelement': 'js/jquery.floatelement',
'sfs/stellar': 'js/jquery.stellar.min',
'jquery/lazyload': 'js/jquery.lazyload',
'fotorama/fotorama': 'fotorama/fotorama'
},
shim: {
'fotorama/fotorama': {
deps: ['jquery']
},
'parallax': {
deps: ['jquery']
},
'sfowlcarousel': {
deps: ['jquery']
},
'owlcarousel_thumbs': {
deps: ['jquery', 'owlcarousel']
},
'floatelement': {
deps: ['jquery']
},
'sfs/stellar': {
deps: ['jquery']
},
'jquery/lazyload': {
deps: ['jquery']
}
},

};