WordPress.org

Forums

Lightbox Plus Colorbox
[resolved] Remove inline JavaScript? (2 posts)

  1. swinggraphics
    Member
    Posted 2 years ago #

    How can I remove this block of inline JavaScript?

    <!-- Lightbox Plus v2.3 - 2011.08.11 - Message: 0-->
    <script type="text/javascript">
    jQuery(document).ready(function($){
    $("a[rel*=lightbox]").colorbox({opacity:0.8});
    });
    </script>

    It is incompatible with minified JS, à la W3 Total Cache.

    I think this line of code should be moved into the main .js file. No reason for it not to be. Failing that, I would like to put it in my own js functions file.

    Love it otherwise, though!

    Cheers.

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

  2. swinggraphics
    Member
    Posted 2 years ago #

    I see; the reason it's inline is so it can initialize with the options set in the preferences pane. I got around this by adding this to my functions.php:

    global $wp_lightboxplus;
    remove_action('wp_footer', array($wp_lightboxplus,'lightboxPlusColorbox'));

    and adding the JS that was being generated to my own .js file.

    Sweet.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Lightbox Plus Colorbox
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.