Tagged: 

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #360767

    Thanks 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

    #361096

    Hey 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,
    Elliott

    #375473

    Thanks. 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 9 years, 11 months ago by dburton77.
    #375838

    Hey!

    Yes, we have code set which will grab the prettyPhoto tag also.

    Best regards,
    Elliott

    #375871

    Great! 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?

    #376343

    Hi!

    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 9 years, 11 months ago by Elliott.
    #376657

    I 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

    #377240

    Hi,

    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,
    Josue

    #378008

    Hi,

    That didn’t seem to work. The admin bar still appears on the lightbox when the subscriber is logged in.

    Doug

    #378097

    Hi 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,
    Josue

    #383570
    This reply has been marked as private.
    #383952

    Hey!

    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,
    Josue

    #385388

    Works great! Thanks!

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘How to invoke lightbox from image but show different content in Lightbox?’ is closed to new replies.