 
	
		Tagged: Lightbox
- 
		AuthorPosts
- 
		
			
				
December 1, 2014 at 2:43 pm #360767Thanks for the awesome support! I’m using the most recent version of the Enfold theme (3.0.4) and WordPress 4.0.1. I’m looking for a way to add a small question mark icon (essentially, an image) at different locations throughout a web page. When the user clicks on one of these icons, a lightbox would open that would display a photo and some text. The trick is I don’t want the small question mark icon to display in the lightbox and I don’t want the content inside the lightbox to display on the page (until the lightbox is opened, of course). How would I go about doing this? Thanks! DB December 1, 2014 at 10:17 pm #361096Hey dburton77! Enfold uses magnific popup now. You can add your own content inside the popup by using the “inline” option, http://dimsemenov.com/plugins/magnific-popup/documentation.html#inline_type. You can add your own HTML with a codeblock element and you can add the jQuery necessary to execute the popup in a codeblock element as well but you need to surround it with script tags like so. <script type = "text/javascript"> jQuery('.open-popup-link').magnificPopup({ 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. }); </script>And be sure to change the “$” signs to “jQuery” as seen above. Best regards, 
 ElliottJanuary 6, 2015 at 6:02 am #375473Thanks. I also found this code works: iframe=true&width=700px&height=450px” rel=”prettyPhoto[iframes] Is it OK to use the Pretty Photo code to do the same thing? - 
		This reply was modified 10 years, 10 months ago by dburton77. 
 January 6, 2015 at 9:01 pm #375838Hey! Yes, we have code set which will grab the prettyPhoto tag also. Best regards, 
 ElliottJanuary 6, 2015 at 10:19 pm #375871Great! How would I keep the Admin bar from showing up inside the iframe (when displaying another page through the iframe) when the user is logged in? January 7, 2015 at 7:25 pm #376343Hi! Navigate to Dashboard > Users > Edit and uncheck the Toolbar option. If that’s not working then send us a link to the exact page and we’ll take a look. Regards, 
 Elliott- 
		This reply was modified 10 years, 9 months ago by Elliott. 
 January 8, 2015 at 8:09 am #376657I need subscribers to be able to see the admin bar in full size pages, I just don’t want the admin bar to display in pages that open up in the lightbox. Doug January 9, 2015 at 8:11 am #377240Hi, Try adding this at the very end of your theme / child theme functions.php file: function add_custom_script(){ ?> <script> (function($){ $(window).load(function() { function inIframe () { try { return window.self !== window.top; } catch (e) { return true; } } if(inIframe){ $('html').css('cssText', 'margin-top: 0px !important'); } }); })(jQuery); </script> <?php } add_action('wp_footer', 'add_custom_script');Regards, 
 JosueJanuary 11, 2015 at 6:39 pm #378008Hi, That didn’t seem to work. The admin bar still appears on the lightbox when the subscriber is logged in. Doug January 12, 2015 at 4:03 am #378097Hi Doug, Can you please create us a WordPress administrator account (a subscriber would may be useful too)? post it here as a private reply. Regards, 
 JosueJanuary 22, 2015 at 10:11 am #383570This reply has been marked as private.January 22, 2015 at 8:09 pm #383952Hey! Check it now, i used a different code. (function($){ $(window).load(function() { if(window.top != window.self) { $('html').css('cssText', 'margin-top: 0px !important'); $('#wpadminbar').remove(); } }); })(jQuery);Regards, 
 JosueJanuary 26, 2015 at 12:36 pm #385388Works great! Thanks! 
- 
		This reply was modified 10 years, 10 months ago by 
- 
		AuthorPosts
- The topic ‘How to invoke lightbox from image but show different content in Lightbox?’ is closed to new replies.
