home controllers refactoring
This commit is contained in:
1 parent
8b053dc083
commit
c7cf73a6d1
3 files changed
+40
-42
No files matched your search
@@ -0,0 +1,29 @@
|
||||
export default function (app) {
|
||||
app.controller('HomeController', () => {
|
||||
let $tape = $('.tape-block');
|
||||
let $fotorama = $tape.find('.tape-block__content');
|
||||
|
||||
$tape.addClass('simplified');
|
||||
$fotorama.on('fotorama:ready', () => {
|
||||
$tape.removeClass('simplified');
|
||||
fotorama.setOptions({
|
||||
nav: 'dots',
|
||||
transition: 'crossfade',
|
||||
autoplay: '6000',
|
||||
arrows: 'false',
|
||||
width: '100%',
|
||||
fit: 'cover',
|
||||
loop: 'true'
|
||||
});
|
||||
});
|
||||
|
||||
let fotorama = $fotorama.fotorama().data('fotorama');
|
||||
setTimeout(() => {
|
||||
fotorama.load([
|
||||
{img: 'https://static.shburg.org/art/img/cat1.jpg'},
|
||||
{img: 'https://static.shburg.org/art/img/cat2.jpg'},
|
||||
{img: 'https://static.shburg.org/art/img/cat3.jpg'}
|
||||
]);
|
||||
}, 100);
|
||||
});
|
||||
};
|
||||
Reference in new issue
Block a user