1
나는이 grid을 구현하려고 시도하고 있습니다. 그러나 Masonry 플러그인을 사용하고 싶지는 않습니다. 따라서이 기사에서 초기화를 제거해야한다고 나와 있지만 어떻게 해야할지 모르겠습니다. . 이 기능은 다음과 같다자바 스크립트 파일에서 스크립트 초기화를 제거하는 방법
...
_init : function() {
this.items = Array.prototype.slice.call(document.querySelectorAll('#' + this.el.id + ' > div'));
this.itemsCount = this.items.length;
this.itemsRenderedCount = 0;
this.didScroll = false;
var self = this;
imagesLoaded(this.el, function() {
// initialize masonry
new Masonry(self.el, {
itemSelector: 'div',
transitionDuration : 0
});
if(Modernizr.cssanimations) {
// the items already shown...
self.items.forEach(function(el, i) {
if(inViewport(el)) {
self._checkTotalRendered();
classie.add(el, 'shown');
}
});
// animate on scroll the items inside the viewport
window.addEventListener('scroll', function() {
self._onScrollFn();
}, false);
window.addEventListener('resize', function() {
self._resizeHandler();
}, false);
}
});
},
가 어떻게 성공적으로 벽돌 스크립트의 초기화를 제거 할 수 있습니까?
예 실제 석조 스크립트 파일을 페이지에서 삭제해도 오류가 발생하므로 다른 것이 있는지 확인하고 싶습니다 – Adam
@Adam "오류가 발생했습니다"<< 그 오류를 공유하고 싶을 수도 있습니다. ;-) – nietonfir
죄송 합니다만, 오류는 발생하지 않으며 스크립트는 실행되지 않습니다. 이 파일 masonry.pkgd.min.js - https://github.com/codrops/GridLoadingEffects/tree/master/js – Adam