質問するログイン新規登録

質問編集履歴

2

呼び出し箇所の追加

2018/09/11 07:14

投稿

nohohon
nohohon

スコア11

title CHANGED
File without changes
body CHANGED
@@ -65,6 +65,16 @@
65
65
  function init_post_list(e,i,t,a){var n=jQuery("#js-infinitescroll");n.imagesLoaded(function(){jQuery(e,"#js-infinitescroll").each(function(e){jQuery(this).delay(150*e).queue(function(){jQuery(this).addClass("is-active").dequeue()})}),n.infinitescroll({navSelector:"#js-load-post",nextSelector:"#js-load-post a",itemSelector:e,animate:!0,extraScrollPx:150,maxPage:i,loading:{msgText:"LOADING...",finishedMsg:t,img:a}},function(e,i){var t=jQuery(e);t.imagesLoaded(function(){t.each(function(e){jQuery(this).delay(150*e).queue(function(){jQuery(this).fadeTo("slow",1).dequeue()})})}),i.maxPage&&i.maxPage<=i.state.currPage&&(jQuery(window).off(".infscr"),jQuery("#js-load-post").remove())})})}
66
66
  ```
67
67
 
68
+ (補足:関数の呼び出し/(index))
69
+ 呼び出しているのはここでしょうか…
70
+ この一文がうまく機能していないようです。
71
+ エラーメッセージにあった
72
+ at HTMLDocument.<anonymous> ((index):330)
73
+ の(index)の箇所をクリックすると、以下の一文がマークされたソースコードが出てきます。
74
+ ```
75
+ init_post_list('.p-blog-list__item', 1, 'これ以上記事はございません', 'http://略');
76
+ ```
77
+
68
78
  ### 試したこと
69
79
 
70
80
  TDCテーマのほうに問い合わせ、原因の可能性となっている

1

関数定義箇所の追加

2018/09/11 07:14

投稿

nohohon
nohohon

スコア11

title CHANGED
File without changes
body CHANGED
@@ -18,7 +18,53 @@
18
18
 
19
19
  ```
20
20
 
21
+ (補足:関数の定義箇所/infinitescroll.js)
22
+ ```
23
+ function init_post_list(target, maxPage, finishedMsg, imgPath) {
24
+ var $container = jQuery('#js-infinitescroll');
25
+ $container.imagesLoaded(function(){
26
+ jQuery(target, '#js-infinitescroll').each(function(i){
27
+ jQuery(this).delay(i*150).queue(function(){
28
+ jQuery(this).addClass('is-active').dequeue();
29
+ });
30
+ });
31
+ $container.infinitescroll({
32
+ navSelector : '#js-load-post',
33
+ nextSelector : '#js-load-post a',
34
+ itemSelector : target,
35
+ animate : true,
36
+ extraScrollPx: 150,
37
+ maxPage: maxPage,
38
+ loading: {
39
+ msgText : 'LOADING...',
40
+ finishedMsg : finishedMsg,
41
+ img: imgPath
42
+ }
43
+ },
44
+ // callback
45
+ function(newElements, opts) {
46
+ var $newElems = jQuery(newElements);
47
+ $newElems.imagesLoaded(function(){
48
+ $newElems.each(function(i){
49
+ jQuery(this).delay(i*150).queue(function(){
50
+ jQuery(this).fadeTo('slow', 1).dequeue();
51
+ });
52
+ });
53
+ });
54
+ if (opts.maxPage && opts.maxPage <= opts.state.currPage) {
55
+ jQuery(window).off('.infscr');
56
+ jQuery('#js-load-post').remove();
57
+ }
58
+ });
59
+ });
60
+ }
21
61
 
62
+ ```
63
+ (補足:関数の定義箇所/infinitescroll.min.js)
64
+ ```
65
+ function init_post_list(e,i,t,a){var n=jQuery("#js-infinitescroll");n.imagesLoaded(function(){jQuery(e,"#js-infinitescroll").each(function(e){jQuery(this).delay(150*e).queue(function(){jQuery(this).addClass("is-active").dequeue()})}),n.infinitescroll({navSelector:"#js-load-post",nextSelector:"#js-load-post a",itemSelector:e,animate:!0,extraScrollPx:150,maxPage:i,loading:{msgText:"LOADING...",finishedMsg:t,img:a}},function(e,i){var t=jQuery(e);t.imagesLoaded(function(){t.each(function(e){jQuery(this).delay(150*e).queue(function(){jQuery(this).fadeTo("slow",1).dequeue()})})}),i.maxPage&&i.maxPage<=i.state.currPage&&(jQuery(window).off(".infscr"),jQuery("#js-load-post").remove())})})}
66
+ ```
67
+
22
68
  ### 試したこと
23
69
 
24
70
  TDCテーマのほうに問い合わせ、原因の可能性となっている