(() => {
const data = [{
'class': 'news-box',
'title': 'Title 1',
'content': 'Lorem inpsum'
}, {
'class': 'news-box',
'title': 'Title 2',
'content': 'Lorem inpsum'
}, {
'class': 'news-box',
'title': 'Title 3',
'content': 'Lorem inpsum'
},];
const tmpl = (data) => {
return `<div class="${data.class}"><h2>${data.title}</h2><p>${data.content}</p></div>`
};
const rootApp = document.querySelector('#rootApp');
const htmlContent = data.map(el => tmpl(el)).join('');
rootApp.innerHTML = htmlContent;
})();
(function() {
'use strict';
(function () {
var ul = document.querySelector('#test');
var li = [].slice.call(ul.querySelectorAll('li'));
var span = document.querySelector('#span');
span.style.display = 'none';
li.forEach(function (item, i) {
if (i > 4) {
item.style.display = 'none';
}
});
if (li.length > 4) {
span.style.display = 'block';
span.addEventListener('click', function (e) {
li.forEach(function (item) {
item.style.display = 'list-item';
});
span.style.display = 'none';
});
}
})();
$(".ca-container").mousewheel();//прокрутка колесом мыши
Uncaught TypeError: $(...).mousewheel is not a function(…)