WordPress.org

Ready to get started?Download WordPress

Forums

Meteor Slides
use smaller javascript (cycle lite) (4 posts)

  1. Paul de Wouters
    Human Made
    Posted 3 years ago #

    Hi,

    it would be great to add an option to select another jquery plugin, as for my use, the jquery cycle is too large.
    I'd like to use jquery cycle lite which has a smaller file size if I don't need lots of settings, just a plain slideshow.

  2. Josh Leuze
    Member
    Plugin Author

    Posted 3 years ago #

    That's a good idea Paul, I would like to do more to reduce the footprint of my plugin. Right now the uncompressed version of jQuery Cycle is included, I should switch to the minimized version. And I'm still working on getting the scripts to load only on pages with a slideshow.

  3. Paul de Wouters
    Human Made
    Posted 3 years ago #

    this is what I did to replace the script in my theme functions.php:

    //replace meteor slides cycle plugin with more lightweight
    add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );
    
    function my_deregister_javascript() {
    	wp_deregister_script( 'jquery-cycle' );
    	wp_register_script('jquery-cycle', get_stylesheet_directory_uri() . '/js/jquery.cycle.lite.min.js', 'jquery');
    	wp_enqueue_script('jquery-cycle');
    }
  4. Josh Leuze
    Member
    Plugin Author

    Posted 3 years ago #

    That's a pretty slick way to do it Paul without hacking the plugin itself!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic