Re: dmglab's topic "[bug] parseFloat on jQuery Version with jQ1.10"
-
I wanted to share that I’ve come across the same problem as dmglab’s topic here. However, the topic has been closed for inactivity.
So here is a brand-new topic with the fix to this problem. Hopefully the plugin author can incorporate this into the next version.
All you have to do is edit /wp-content/plugins/wp-lightbox-2/wp-lightbox-2.min.js, starting on line 46, you can see the code:
if(parseFloat($().jquery) >= 1.7){ return $(this).on("click", onClick); }else{ return $(this).live("click", onClick); //deprecated since 1.7 }
Simply replace that code with this code:
var jQuerySubVersionNo = Math.floor((parseFloat($().jquery)-1)*100); if(jQuerySubVersionNo >= 7){ return $(this).on("click", onClick); }else{ return $(this).live("click", onClick); //deprecated since 1.7 }
This will fix the semantic version problem where “version 1.10” or “version 1.11” is less than “version 1.7” because mathematically 1.7 > 1.11.
Note that this will only work for jQuery versions less than 2. You could add some logic to see if the inital version is above 2 before doing the rest of the math, but eh.
- The topic ‘Re: dmglab's topic "[bug] parseFloat on jQuery Version with jQ1.10"’ is closed to new replies.