작성일 : 16-08-31 02:29
|
[JQuery] lightbox slider
|
|
|
글쓴이 :
조형래
 조회 : 4,909
|
<script>
$(document).ready(function () {
$.lightbox_button = function(board_table,mb_id) {
$("#light_box").load('/light.php',{board_table: board_table, mb_id: mb_id });
document.location.hash = "#lg=1&slide=0";
};
});
</script>
onclick="javascript:$.lightbox_button('d1','<?php echo $mb_id;?>')"
<div id="light_box" style="display:none;"></div>
/////////////////////////////////////////////////////////////////////////////
<?php
include_once('./_common.php');
?>
<!-- jquery 가 include 시키는 파일에 이미 있기 때문에 여기는 필요 없음-->
<link href="/dist/css/lightgallery.css" rel="stylesheet">
<ul id="lightgallery" class="list-unstyled row">
<?php
$sql_file = " select * from {$g5['board_file_table']} where bo_table like '$board_table' and wr_id = '$mb_id' order by 1 asc ";
$sql_file_one = sql_query($sql_file);
while ($row_file_one = sql_fetch_array($sql_file_one)){
if($row_file_one["bf_file"]){
?>
<li class="col-xs-6 col-sm-4 col-md-3" data-src="/data/member/<?php echo substr($mb_id,0,2);?>/<?php echo $row_file_one["bf_file"];?>" data-sub-html="">
<a href="">
<img class="img-responsive" src="/data/member/<?php echo substr($mb_id,0,2);?>/<?php echo $row_file_one["bf_file"];?>">
</a>
</li>
<?php
}
}
?>
</ul>
<script src="https://cdn.jsdelivr.net/picturefill/2.3.1/picturefill.min.js"></script>
<script src="/dist/js/lightgallery.js"></script>
<script src="/dist/js/lg-fullscreen.js"></script>
<script src="/dist/js/lg-thumbnail.js"></script>
<script src="/dist/js/lg-video.js"></script>
<script src="/dist/js/lg-autoplay.js"></script>
<script src="/dist/js/lg-zoom.js"></script>
<script src="/dist/js/lg-hash.js"></script>
<script src="/dist/js/lg-pager.js"></script>
<!-- load 시에는 해당 함수가 lightgallery.js 아래쪽에 위치해야 함 -->
<script type="text/javascript">
$(document).ready(function(){
$('#lightgallery').lightGallery();
});
</script>
|
|