Title: Gallery plugin patch for jQuery 1.9 : )
Last modified: August 20, 2016

---

# Gallery plugin patch for jQuery 1.9 : )

 *  [Ryan Urban](https://wordpress.org/support/users/ryancurban/)
 * (@ryancurban)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/gallery-plugin-patch-for-jquery-19/)
 * Hello guys, first off, great work on this. Love it and so happy to not have to
   use the full Jetpack : )
 * So just wanted to give you a heads up and others a quick patch. The site I’m 
   using this plugin on uses jQuery 1.9, which resulted in the plugin not working
   as the plugin currently uses the now deprecated `$.browser` object for jQuery
   < 1.9 (lines 137-140):
 *     ```
       if ( $.browser.mozilla )
            leftWidth -= 55;
       else if ( $.browser.msie )
            leftWidth -= 20;
       ```
   
 * Not quite sure where WordPress core is in terms of adopting the use of jQuery
   1.9, but wanted to throw out how I patched this up. I basically tested for whether`
   $.browser` is a valid function (aka if jQuery is < 1.9) and then setup the relevant
   code to handle both situations so we are gracefully handling both situations:
 *     ```
       if( ! $.isFunction( $.browser ) ) {
            var isMozilla = navigator.userAgent.match(/Firefox/i) != null;
            var isMSIE = navigator.userAgent.match(/MSIE/i) != null;
   
            if ( isMozilla )
                 leftWidth -= 55;
            else if ( isMSIE )
                 leftWidth -= 20;
            leftWidth += 'px';
       } else {
            if ( $.browser.mozilla )
                 leftWidth -= 55;
            else if ( $.browser.msie )
                 leftWidth -= 20;
            leftWidth += 'px';
       }
       ```
   
 * It’s obviously not ideal to alter plugin code, which I realize, I just really
   wanted to use this and couldn’t find a Github repo for this : ) So by all means,
   use this as you see fit or when / if it makes sense. Thanks!
 * [http://wordpress.org/extend/plugins/carousel-without-jetpack/](http://wordpress.org/extend/plugins/carousel-without-jetpack/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Syed Balkhi](https://wordpress.org/support/users/smub/)
 * (@smub)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/gallery-plugin-patch-for-jquery-19/#post-3619452)
 * Hey Ryan,
 * Thanks a lot for writing this patch. I try to keep this plugin up to date with
   the official Jetpack plugin. Any bug that is in the Jetpack Carousel plugin will
   be found in this plugin as well.
 * As much as I would like to fix all the bugs before they do, I don’t want to. 
   Because then it would make the updating process much harder. Currently all I 
   do is copy/paste the Jetpack carousel module (change class name) and here is 
   the new update.
 * Fixing bugs, adding functionality, etc to this plugin would then essentially 
   start a separate plugin dev. process.
 * WordPress 3.6 should have jQuery 1.9, so I’m certain that an update of Jetpack
   and this plugin will follow right along with it 🙂
 *  Thread Starter [Ryan Urban](https://wordpress.org/support/users/ryancurban/)
 * (@ryancurban)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/gallery-plugin-patch-for-jquery-19/#post-3619453)
 * Hey Syed!
 * You’re very welcome and that makes total sense. Figured as much : ) Just wanted
   to throw the patch out there for anyone already using jQuery 1.9.
 * Cool, thanks for the response and again for doing the hard work for us of making
   this a separate plugin ; )
 *  [zaGerald](https://wordpress.org/support/users/zagerald/)
 * (@zagerald)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/gallery-plugin-patch-for-jquery-19/#post-3619456)
 * Hi Ryan – Thanks for the fix, it is much appreciated… I almost abandoned the 
   plugin and luckily found your post just in time!
 *  Thread Starter [Ryan Urban](https://wordpress.org/support/users/ryancurban/)
 * (@ryancurban)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/gallery-plugin-patch-for-jquery-19/#post-3619460)
 * My pleasure : )
 *  [Samuel](https://wordpress.org/support/users/samuel1376/)
 * (@samuel1376)
 * [13 years ago](https://wordpress.org/support/topic/gallery-plugin-patch-for-jquery-19/#post-3619503)
 * Thanks Ryan! Perfect fix.
 *  [lornix](https://wordpress.org/support/users/lornix/)
 * (@lornix)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/gallery-plugin-patch-for-jquery-19/#post-3619531)
 * Thanks for this fix! Very helpful!
 *  [bjornst](https://wordpress.org/support/users/bjornst/)
 * (@bjornst)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/gallery-plugin-patch-for-jquery-19/#post-3619535)
 * Tried using this plugin with WordPress 3.6 and it doesnt seem to work. Would 
   it work if i apply the patch suggested by the op of this thread?

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Gallery plugin patch for jQuery 1.9 : )’ is closed to new replies.

 * ![](https://ps.w.org/carousel-without-jetpack/assets/icon-256x256.png?rev=974591)
 * [Gallery Carousel Without JetPack](https://wordpress.org/plugins/carousel-without-jetpack/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/carousel-without-jetpack/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/carousel-without-jetpack/)
 * [Active Topics](https://wordpress.org/support/plugin/carousel-without-jetpack/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/carousel-without-jetpack/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/carousel-without-jetpack/reviews/)

## Tags

 * [jquery](https://wordpress.org/support/topic-tag/jquery/)

 * 7 replies
 * 6 participants
 * Last reply from: [bjornst](https://wordpress.org/support/users/bjornst/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/gallery-plugin-patch-for-jquery-19/#post-3619535)
 * Status: not a support question