簡體   English   中英

Magnific-Popup Gallery在一個標簽中包含兩個圖像標簽

[英]Magnific-Popup Gallery with two image tag in a single a tag

我正在使用Magnific-Popup創建一個畫廊,但是為了加快我的網站的速度,我在一個標簽中放置了兩個不同的圖像。 一個用於大屏幕,另一個用於小屏幕。 我用bootstrap類(hidden-lg hidden-md和hidden-sm hidden-xs)隱藏一個或另一個圖像。

問題是,當我單擊一個標簽以打開圖像庫時,Magnific-Popup嘗試打開隱藏的圖像並返回“圖像無法加載”。

 <li> <figure> <div class="gallery-item"> <a href="assets/upload/images/romantic/clem-onojeghuo-193397.jpg" title="" class="gallery-item"> <img src="/assets/image-cache/romantic/clem-onojeghuo-193397.5ddf5942.jpg" alt="" class="hidden-lg hidden-md"> <img src="/assets/image-cache/romantic/clem-onojeghuo-193397.36620614.jpg" alt="" class="hidden-sm hidden-xs"> <div class="gallery-caption"> <div class="centrize"> <div class="v-center"><i class="hc-search"></i></div> </div> </div> </a> </div> </figure> </li> 

 $('.gallery-item').magnificPopup({ type: 'image', gallery:{ enabled:true } }); 

這是我自己的錯誤,因為我有兩次參加“畫廊項目”課程。 一個在div標簽上,另一個在a標簽上。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM