그누보드 Magnific Popup사용
링크
https://dimsemenov.com/plugins/magnific-popup/ (329) https://github.com/dimsemenov/Magnific-Popup (667)1. Magnific Popup 다운로드
https://github.com/dimsemenov/Magnific-Popup
2. 그누보드 업로드
업로드 위치 : /js/Magnific-Popup-master
3. Magnific-Popup 스크립트 로드
[code]
// Load Magnific Popup
add_javascript('<script src="'.G5_JS_URL.'/Magnific-Popup-master/dist/jquery.magnific-popup.min.js"></script>', 10);
add_stylesheet('<link rel="stylesheet" href="'.G5_JS_URL.'/Magnific-Popup-master/dist/magnific-popup.css">', 10);
[/code]
4. 스크립트 함수 추가 및 로드
- 스크립트 함수 파일 형태로 추가 - 위치 /js//Magnific-Popup-master/dist/load.magnific.popup.js
[code]
/** LightBox
**************************************************************** **/
function lightbox() {
var _el = jQuery(".lightbox");
if(_el.length > 0) {
if(typeof(jQuery.magnificPopup) == "undefined") {
return false;
}
jQuery.extend(true, jQuery.magnificPopup.defaults, {
tClose: 'Close',
tLoading: 'Loading...',
gallery: {
tPrev: 'Previous',
tNext: 'Next',
tCounter: '%curr% / %total%'
},
image: {
tError: 'Image not loaded!'
},
ajax: {
tError: 'Content not loaded!'
}
});
_el.each(function() {
var _t = jQuery(this),
options = _t.attr('data-plugin-options'),
config = {},
defaults = {
type: 'image',
fixedContentPos: false,
fixedBgPos: false,
mainClass: 'mfp-no-margins mfp-with-zoom',
closeOnContentClick: true,
closeOnBgClick: true,
image: {
verticalFit: true
},
zoom: {
enabled: false,
duration: 300
},
gallery: {
enabled: false,
navigateByImgClick: true,
preload: [0,1],
arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
tPrev: 'Previous',
tNext: 'Next',
tCounter: '<span class="mfp-counter">%curr% / %total%</span>'
},
};
if(_t.data("plugin-options")) {
config = jQuery.extend({}, defaults, options, _t.data("plugin-options"));
}
jQuery(this).magnificPopup(config);
});
}
}
jQuery(window).ready(function () {
lightbox();
});
[/code]
[code]
add_javascript('<script src="'.G5_JS_URL.'/Magnific-Popup-master/dist/load.magnific.popup.js"></script>', 10);
[/code]
5. Magnific Popup 사용
- Gallery Lightbox Group
- 사용형식 : <div class="lightbox" data-img-big="1" data-plugin-options='{"delegate": "a", "gallery": {"enabled": true}}'> ... </div>
[code]
<div class="lightbox" data-img-big="1" data-plugin-options='{"delegate": "a", "gallery": {"enabled": true}}'>
<a class="image-hover" href="http://farm9.staticflickr.com/8241/8589392310_7b6127e243_b.jpg">
<img src="http://farm9.staticflickr.com/8241/8589392310_7b6127e243_s.jpg" alt="...">
</a>
<a class="image-hover" href="http://farm9.staticflickr.com/8379/8588290361_ecf8c27021_b.jpg">
<img src="http://farm9.staticflickr.com/8379/8588290361_ecf8c27021_s.jpg" alt="...">
</a>
<a class="image-hover" href="http://farm4.staticflickr.com/3721/9207329484_ba28755ec4_o.jpg">
<img src="http://farm4.staticflickr.com/3721/9207329484_ba28755ec4_o.jpg" alt="...">
</a>
</div>
[/code]
- Gallery Lightbox Single Image
- 사용형식 : <a class="image-hover lightbox" href="test-images.jpg" data-plugin-options='{"type":"image"}'> ... </div>
[code]
<div class="masonry-gallery columns-5 clearfix">
<a class="image-hover lightbox" href="http://farm9.staticflickr.com/8241/8589392310_7b6127e243_b.jpg" data-plugin-options='{"type":"image"}'>
<span class="image-hover-icon image-hover-dark">
<i class="fa fa-search-plus"></i>
</span>
<img src="http://farm9.staticflickr.com/8241/8589392310_7b6127e243_s.jpg" alt="...">
</a>
<a class="image-hover lightbox" href="http://farm9.staticflickr.com/8379/8588290361_ecf8c27021_b.jpg" data-plugin-options='{"type":"image"}'>
<span class="image-hover-icon image-hover-dark">
<i class="fa fa-search-plus"></i>
</span>
<img src="http://farm9.staticflickr.com/8379/8588290361_ecf8c27021_s.jpg" alt="...">
</a>
<a class="image-hover lightbox" href="http://farm4.staticflickr.com/3721/9207329484_ba28755ec4_o.jpg" data-plugin-options='{"type":"image"}'>
<span class="image-hover-icon image-hover-dark">
<i class="fa fa-search-plus"></i>
</span>
<img src="http://farm4.staticflickr.com/3721/9207329484_ba28755ec4_o.jpg" alt="...">
</a>
</div>
[/code]
댓글 7개
Vimeo video
Vimeo 도 되니 유용할 것 같습니다
감사합니다
감사합니다.
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 3년 전 | 4402 | ||
| 2634 | 6개월 전 | 608 | ||
| 2633 | 6개월 전 | 598 | ||
| 2632 |
|
6개월 전 | 508 | |
| 2631 | 6개월 전 | 569 | ||
| 2630 |
세르반데스
|
6개월 전 | 538 | |
| 2629 | 6개월 전 | 727 | ||
| 2628 | 6개월 전 | 412 | ||
| 2627 | 6개월 전 | 416 | ||
| 2626 |
이슈DEV
|
7개월 전 | 636 | |
| 2625 |
welcome
|
7개월 전 | 645 | |
| 2624 |
이슈DEV
|
7개월 전 | 449 | |
| 2623 | 7개월 전 | 407 | ||
| 2622 | 7개월 전 | 496 | ||
| 2621 | 7개월 전 | 350 | ||
| 2620 |
|
7개월 전 | 369 | |
| 2619 | 7개월 전 | 478 | ||
| 2618 | 7개월 전 | 465 | ||
| 2617 | 7개월 전 | 554 | ||
| 2616 | 7개월 전 | 678 | ||
| 2615 | 7개월 전 | 581 | ||
| 2614 | 7개월 전 | 410 | ||
| 2613 |
바닐라코드
|
7개월 전 | 730 | |
| 2612 | 7개월 전 | 594 | ||
| 2611 | 7개월 전 | 731 | ||
| 2610 | 8개월 전 | 966 | ||
| 2609 | 8개월 전 | 508 | ||
| 2608 | 8개월 전 | 653 | ||
| 2607 | 8개월 전 | 630 | ||
| 2606 | 8개월 전 | 576 | ||
| 2605 | 8개월 전 | 602 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기