Mysql,phpで作った動画サムネイルの一覧ページを3列、5行毎に表示したいですが最初の画像しか表示されませんでした。原因が#page-の数字が取れてないかと思って色々試してみましたがダメでした。
Jquery得意な誰かが教えていただけませんか?。宜しくお願いします。
ソースコードは下記:
<?php require_once("../includes/db.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="stylesheet" href="pagination/css/style.css" media="all"> <style type="text/css"> .selection { display: none; } #page-1 { display: block;} </style> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script src="js/jquery.simplePagination.js"></script> <script type="text/javascript"> <?php $query_count = "SELECT * FROM movie"; $find_count = mysqli_query($connection, $query_count); $count = mysqli_num_rows($find_count); ?> $(function(){ $(".pager").pagination({ items: <?php echo $count; ?>, displayedPages: 9, cssStyle: 'light-theme', prevText: '前', nextText: '次', onPageClick: function(pageNumber){show(pageNumber)} }) }); function show(pageNumber){ var page="#page-"+pageNumber; $('.selection').hide(); $(page).show(); } </script> </head> <body> <?php $query = "SELECT * FROM movie ORDER BY movie_id DESC"; $select_all_movie_query = mysqli_query($connection, $query); while($row = mysqli_fetch_assoc($select_all_movie_query)){ $movie_id = $row['movie_id']; $movie_title = $row['movie_title']; $movie_thumb = $row['movie_thumb']; ?> <div class="selection" id="page-1"><b> <div><a class="youtube fancybox.iframe" href="<?php echo $movie_url; ?>?autoplay=1"; style="text-color:#000"><img width="100%" height="auto" src="../thumb/<?php echo $movie_thumb; ?>" /></a></div> <div class="movie" > <h1><?php echo $movie_title; ?></h1> </div><?php } ?><div class="clear"></div> <div class="pagination text-center"><div class="pager"></div></div> </body> </html>
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/07/27 09:43
2016/07/27 09:56
2016/07/27 09:58
2016/07/27 10:00