은 (http://dimsemenov.com/plugins/magnific-popup/documentation.html#initializing_popup)Magnific 팝업 인라인 갤러리
내가 먼저 여기에 내 코드를 넣을 수 있습니다 :
$(document).ready(function() {
$('.open-popup-link').magnificPopup({
// Delay in milliseconds before popup is removed
removalDelay: 600,
// Class that is added to popup wrapper and background
// make it unique to apply your CSS animations just to this exact popup
mainClass: 'mfp-fade',
type:'inline',
midClick: true, // Allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source in href.,
callbacks: {
beforeOpen: function() {
if($(".image-container img").attr("title") != "" && $('.image-container img').length > 0){
if ($('.imagetitle').length > 0) {
// it exists
}else{
$(".image-container").append("<span class='imagetitle'>"+$(".image-container img").attr("title")+"</span>");
$(".image-container span.imagetitle").css({
"left": $(".image-container img").position().left+"px",
"margin-top":10+"px",
"margin-bottom":10+"px"
});
}
}
//Make it a Gallery! - Whoop Whoop
if($("div.white-popup").length > 1){
$("div.white-popup").append("<div class='popupgalleryarrowleft'> </div>");
$("div.white-popup").append("<div class='popupgalleryarrowright'> </div>");
}
},
open: function(){
// Klick Function für die Gallery einbauen!
$(".popupgalleryarrowleft").click(function(){
$.magnificPopup.instance.prev();
});
$(".popupgalleryarrowright").click(function(){
$.magnificPopup.instance.next();
});
}
}
});
});
그래서 인라인 갤러리가 필요합니다. 괜찮 았지만이 부분은 작동하지 않습니다.
// Klick Function für die Gallery einbauen!
$(".popupgalleryarrowleft").click(function(){
$.magnificPopup.instance.prev();
});
$(".popupgalleryarrowright").click(function(){
$.magnificPopup.instance.next();
});
나는 다음 인스턴스를 얻으려고하고 있습니다. 런타임시 firebug를 통해이 코드를 실행하면 작동합니다!
아무도 도와 줄 수 있습니까? 희망을 갖고.
인사말 David
[Magnific-Popup에서 사용하기 위해 HTML에서 인라인 컨텐츠의 갤러리를 정의하는 방법은 무엇입니까?] (http://stackoverflow.com/questions/18067062/how-do-i-define-a-gallery - in-content-in-html-for-magnific-popup) –