0
jQuery 및 Magnificient Popup을 처음 사용하는 경우 - 이미지 격자가 있습니다. 이미지를 클릭하면 특정 이미지와 관련된 정보가 포함 된 div가 표시됩니다.Magnificent Popup 첫 번째 항목 만 표시
<div class="grid">
<div class="grid-item">
<a href="#test-popup" class="open-popup-link"><img class="object open-popup-link" src="i/objects/8/a.jpg" alt="3D Printed Object"></a>
<div id="test-popup" class="popup mfp-hide">
<div class="maker-profile">
<img class="headshot" src="i/maker.jpg" alt="Designer of 3D printed object">
<h2>A, aged 8</h2>
<h3>Who are you?</h3>
<h3>What inspires you?</h3>
<h3>What do you like most about design?</h3>
</div>
</div>
</div>
<div class="grid-item">
<a href="#test-popup" class="open-popup-link"><img class="object open-popup-link" src="i/objects/8/ab.jpg" alt="3D Printed Object"></a>
<div id="test-popup" class="popup mfp-hide">
<div class="maker-profile">
<img class="headshot" src="i/maker.jpg" alt="Designer of 3D printed object">
<h2>Ab, aged 8</h2>
<h3>Who are you?</h3>
<h3>What inspires you?</h3>
<h3>What do you like most about design?</h3>
</div>
</div>
</div>
<div class="grid-item">
<a href="#test-popup" class="open-popup-link"><img class="object open-popup-link" src="i/objects/8/f.jpg" alt="3D Printed Object"></a>
<div id="test-popup" class="popup mfp-hide">
<div class="maker-profile">
<img class="headshot" src="i/maker.jpg" alt="Designer of 3D printed object">
<h2>F, aged 8</h2>
<h3>Who are you?</h3>
<h3>What inspires you?</h3>
<h3>What do you like most about design?</h3>
</div>
</div>
</div>
그리고 여기가 jQuery의 -
$(function() {
$('.open-popup-link').magnificPopup({
type:'inline',
midClick: true
})
});
당신이 그리드에 내 이미지의 하나를 클릭하면 어떻게 일어나는 것은이 (img.object가) Magnific 팝업 만 DIV 표시 (.test-팝업) 첫 번째 그리드 항목에서.
오 완벽한! 고맙습니다. 나는 또한 콘솔에서이 오류를 발견했다는 것을 알았습니다. "uncaught typeerror undefined는 함수가 아닙니다." – hannahcreative
@hannahcreative는 오류와 관련된 JS 코드를 보지 않고는 도울 수 없습니다. 당신이 행동에서 그것을 볼 수있는 링크가 있다면 .. –