我的商店的收藏頁面具有快速瀏覽功能,您可以在產品圖像上懸停以便點擊「快速查看」以打開帶有產品摘要信息的模式對話窗口。這是通過leanModal插件完成的。例如如何加載leanmodal div內容onclick
例如:http://froy.com/collections/beds-mattresses。商店由Shopify提供支持。
問題是,當頁面初始加載時,模態內的所有元素都會被加載,儘管被隱藏。這不必要地降低了網站的速度。我只想在用戶點擊「快速查看」後才加載模式中的內容。
<div class="quick_shop"> <!--This is the modal trigger-->
<div class="quickview-text">Quick View</div>
</div>
<div class="modal">
<!--All contents of the modal dialog window go in this div-->
</div>
腳本:
$('.quick_shop').leanModal(); //Calls the function on the modal trigger
(function($){$.fn.extend({leanModal:function(_1)...});})(jQuery);
//The above line of code is for leanModal. I didn't paste entire thing cause it's long
任何幫助,將不勝感激!我是新的和學習,所以這是非常令人興奮的。