WordPress.org

Ready to get started?Download WordPress

Forums

Lightbox Plus Colorbox
Adding button to lightbox interface (3 posts)

  1. yoxalld
    Member
    Posted 1 year ago #

    I am trying to add a print link to the lightbox interface. It just needs to link to the currently displayed image file. I have added the following code to the helper.js file in the lightbox plus theme I am using. It adds the link correctly but I can't get a function to run when the link is clicked. Any help would be much appreciated!

    $(document).bind('cbox_complete', function () {
            // Show close button with a delay.
            $('#cboxClose').css('opacity', 1);
            // Add Print Button
            if ($('#print-one').length ) {
            	// Do Nothing
            }else {
            	$('#cboxNext').after('<a href="javascript:void(0)" id="print-one">Print</a>');
            }
        });
    
        $('#print-one').click(function() {
        	console.log('Works');
        });

    This is all wrapped inside the document.ready function. I just can't get the console log to work when the link is clicked. I have been beating my head against a wall trying to figure it out. Thanks for any help!

    http://wordpress.org/extend/plugins/lightbox-plus/

  2. Dan Zappone
    Member
    Plugin Author

    Posted 1 year ago #

    I'll take a look as time allows. I'm late in completing an update for another plugin whose API is about to disappear.

  3. shainanz
    Member
    Posted 9 months ago #

    Hey, @yoxalld, did you ever figure this one out?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic