質問編集履歴

1

概要だけでなく、script なども含めて分かりやすく、詳細に記入しました。

2015/05/03 23:31

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -1,9 +1,87 @@
1
- 表題の件で、simple paginationjs というのがgit hubあります。 これを利用して、ページングを各ページに飛ばしたいのですが、国内の一般の例では、同じページ内の飛ばし方です。例:https://codeiq.jp/magazine/2014/02/6155/ などですが・・・
1
+ 表題の件で、[simple paginationjs ](http://flaviusmatis.github.io/simplePagination.js/)というのがあります。 これを利用して、ページングを各ページに飛ばしたいのですが、国内の一般の例では、同じページ内の飛ばし方です。例:[[面倒なページネーション実装よさらば!](https://codeiq.jp/magazine/2014/02/6155/)] などですが・・・このリンク先で動作が確認できます。
2
2
 
3
3
 
4
4
 
5
+ では、具体的に、内容は、・・・
6
+
5
- これを利用して、aaaa.html,bbb.html,ccc.html のページへ、class 指定とid指定でページング出来ないものでしょうか・・・
7
+ <link type="text/css" rel="stylesheet" href="simplePagination.css"/>
6
8
 
7
9
 
8
10
 
11
+ <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
12
+
13
+ <script type="text/javascript" src="jquery.simplePagination.js"></script>
14
+
15
+ というように最初リンクを張ります。
16
+
17
+
18
+
19
+ script 部分は、
20
+
21
+ <script>
22
+
23
+ $(function(){
24
+
25
+ $("#paging").pagination({
26
+
27
+ items: 4,
28
+
29
+ displayedPages: 4,
30
+
31
+ cssStyle: 'light-theme',
32
+
33
+ prevText: '<<前',
34
+
35
+ nextText:'次>>',
36
+
37
+ onPageClick: function(pageNumber){show(pageNumber)}
38
+
39
+ })
40
+
41
+ });
42
+
43
+ function show(pageNumber){
44
+
45
+ var page="#page-"+pageNumber;
46
+
47
+ $('.selection').hide()
48
+
49
+ $(page).show()
50
+
51
+ }
52
+
53
+ </script>
54
+
55
+
56
+
57
+ <style type="text/css">
58
+
59
+ <!--
60
+
61
+ .selection {display: none;}
62
+
63
+ #page-1 { display: block;}
64
+
65
+
66
+
67
+
68
+
69
+ -->
70
+
71
+ </style>
72
+
73
+ これだけで稼動します。
74
+
75
+
76
+
77
+ href="simplePagination.css"/ と src="jquery.simplePagination.js">というファイルが、download されて、これを利用する分けです。
78
+
79
+
80
+
81
+
82
+
83
+ 質問点は、以上の内容を利用して、aaaa.html,bbb.html,ccc.html の各ページへ、class 指定とid指定でページング(一般のページングです)出来ないものでしょうか・・・
84
+
85
+
86
+
9
- よろしく願います。
87
+ 以上です。 よろしく願います。