You know what, I was almost there but your way is perfect. Thank you.
You know what, I was almost there but your way is perfect. Thank you.
A problem I have with applying ZM to popups is getting it to automatically adjust its height to popups of varying sizes.
As I see it the global height of popups is determined by padding-top of .mfp-iframe-scaler class.
I've seen elsewhere online mention of specifying height in the autoload functions and using a different function for each popup, although I haven't worked out how to do this yet.
Perhaps there's an easier way?
1.) You can create separate functions for each iframe and apply a wrapper
Example
$('.pop1').magnificPopup({
type: 'iframe',
iframe: {
markup: '<div style="width:500px; height:200px;">'+
'<div class="mfp-iframe-scaler" >'+
'<div class="mfp-close"></div>'+
'<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>'+
'</div></div>'
}
});
2.) You could use CSS to apply the height (same height applies to all iframes on page)
body#shoppingcartBody .mfp-iframe-scaler iframe.mfp-iframe {height:260px;}
3.) You could wait till I document and package!
Thanks for your reply.
I'm also experimenting with using css to display the popup information, rather than having the delay of loading a new page.
I'll check out your upcoming mod release and compare the two.
Cheers
Simon
The downside to this is you will literally have to copy the popup windows tpl file contents to the same page displaying the popup link along with moving all the language files. These are very doable just a pain in the a** when it comes to changing templates or doing future upgrades to zen-cart.
An iframe popup takes no longer than a popup window and on some phones and tablets the popup windows are displayed as new pages all together.
Again just my 2 cents and something to think about.
I'm not sure I'm thinking of this the same way as you.
The css popup I'm considering, using 'hover,' would involve just putting a call to the popup_search_help language file, for example, in tpl_advanced_search_default.php and CSS appropriately. This would give an instant popup on hover over the Search Help [?] link, whereas a Zen Magnific popup would always involve a page load.
My main thinking is to use popups more extensively to convey information on mobile devices. Hover seems to work in Android touch environment ok but I've still to test on IOS.
Has anyone tested this mod with events calendar which displays as an iframe in a sidebox with its own dimensional settings?
PS RBarbour wishing you well.
Looking for code to apply to the various popup pages eg info_shopping_cart. Struggling to work out which files to edit with what. Thanks