この要素は、この要素の視差を石積みにします。masonryの新しい要素が表示されたとき、無限のスクロールにjQueryまたはJavaScriptの効果がありません
ページに無限スクロールJSを追加しましたが、新しい要素が表示されても元の要素には移行しません。私はそれがクリックで文書準備機能と関係していると思うが、私はそれを実装する方法を知らない。
$.fn.moveIt = function(){
var $window = $(window);
var instances = [];
$(this).each(function(){
instances.push(new moveItItem($(this)));
});
window.onscroll = function(){
var scrollTop = $window.scrollTop();
instances.forEach(function(inst){
inst.update(scrollTop);
});
}
}
var moveItItem = function(el){
this.el = $(el);
this.speed = parseInt(this.el.attr('data-scroll-speed'));
};
moveItItem.prototype.update = function(scrollTop){
this.el.css('transform', 'translateY(' + -(scrollTop/this.speed) + 'px)');
};
// Initialization
$(function(){
$('[data-scroll-speed]').moveIt();
});
</script>
<script type="text/javascript">
$(".card").css({ translate: [60,30] });
and this is for the infinite scroll
<script type="text/javascript">
$('.grid').infiniteScroll({
// options
path: '.next',
append: '.grid-item',
history: false,
});
</script>
はまた、新しいコンテンツのロードは、彼らが彼らの石工効果を持っていない:ここではこれはパララックス
<div>
要素のあるコード
です。
確かに...そして、このために、ウェブ上のチュートリアルがたくさんあります。 Stackoverflowは* "方法" *チュートリアルサービスではありません – charlietfl
スタックオーバーフローは、この種の質問に最適な場所ではありません。そのようなサイトをコード化しようとした場合は、コードを投稿してください。トラブルシューティングや最適化をお手伝いします。 – freginold
ありがとうございました。このウェブサイトはあなたが言ったような方法ではありません。投稿を投票するよりも、これらのチュートリアルへのリンクを付けるほうがよかったと思います。私を信じて、私がここに来た理由はどこでも調べています。 –