You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Documentation needed: this requires jQuery 1.4.x #38
After debugging some weird glitches for awhile, I found that this plugin uses a function argument to .html() which was added in jQuery 1.4 (line 188). It should be documented that this plugin requires jQuery 1.4.x.
Thanks for the quick reply! That'd be great if you want to change the code. I think this would be all that's needed for jQuery 1.3.2 compatibility, or at least all that I've found so far. I changed the line to this and it works:
var oldHtml = $(this).html();
var newHtml = oldHtml.replace(/<a/gi, '<span').replace(//a>/gi, '/span>');
$(this).html(newHtml);
I'll let you know if I find any other jQuery 1.3.2 incompatibilities. Unfortunately I can't upgrade jQuery for the site I'm working on.
After messing around with the code I found a few other bits that need modified and a small bit of code that needs to be added. I thought about it and I don't think I want to add more code to the core just to make it compatible with an older jQuery version. But, I will show you here how to do it - basically it won't be released officially - I may change this in the future if more people want the change to be made permanent or I get some other feedback or opinions on this matter.
All changes are to the jquery.anythingslider.js file:
Because $(null).length == 1 is true in jQuery 1.3.2 this line needs to be modified from this (line 47 in v1.5.6.2)
Lastly, because delay() doesn't exist in jQuery 1.3.2, I figured it would be easiest to just copy the function. This was the bit of code that ultimately made me decide to not make anythingSlider backward compatible only because of the added length. Maybe it isn't enough to make it a big deal and I'll include it in the next version, we'll see:
Add this to the end of the jquery.anythingslider.js file (outside of the enclosure)
// Copied from jQuery 1.4.4 to make AnythingSlider backwards compatible to jQuery 1.3.2
if (typeof jQuery.fn.delay === 'undefined') {
jQuery.fn.extend({
delay: function( time, type ) {
time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; type = type || "fx";
return this.queue( type, function() { var elem = this; setTimeout(function() { jQuery.dequeue( elem, type ); }, time ); });
}
});
}
This is awesome, thanks so much. I may not get back to working on this until next week, but when I do I'll be sure to let you know how these changes work!
Just as an update, I pushed version 1.5.7 which in the non-minified version has the "delay" code commented out at the end. If you un-comment out that code, AnythingSlider will be compatible with jQuery version 1.3.2. If you are using the minified version, just copy that code to the end of the minified code.
Activity
Mottie commentedon Dec 23, 2010
Ok, I added a Note in the Wiki... I could potentially change line 188 to be compatible with 1.3+ if you need.
benshell commentedon Dec 23, 2010
Thanks for the quick reply! That'd be great if you want to change the code. I think this would be all that's needed for jQuery 1.3.2 compatibility, or at least all that I've found so far. I changed the line to this and it works:
var oldHtml = $(this).html();
var newHtml = oldHtml.replace(/<a/gi, '<span').replace(//a>/gi, '/span>');
$(this).html(newHtml);
I'll let you know if I find any other jQuery 1.3.2 incompatibilities. Unfortunately I can't upgrade jQuery for the site I'm working on.
Thanks.
Mottie commentedon Dec 28, 2010
Hi Benshell!
After messing around with the code I found a few other bits that need modified and a small bit of code that needs to be added. I thought about it and I don't think I want to add more code to the core just to make it compatible with an older jQuery version. But, I will show you here how to do it - basically it won't be released officially - I may change this in the future if more people want the change to be made permanent or I get some other feedback or opinions on this matter.
All changes are to the jquery.anythingslider.js file:
Because
$(null).length == 1is true in jQuery 1.3.2 this line needs to be modified from this (line 47 in v1.5.6.2)to this:
Because e.type for hovered doesn't match correctly, change this (line 99, v1.5.6.2)
to this:
HTML functions do not work as you pointed out above, so change line 188 to this:
Lastly, because
delay()doesn't exist in jQuery 1.3.2, I figured it would be easiest to just copy the function. This was the bit of code that ultimately made me decide to not make anythingSlider backward compatible only because of the added length. Maybe it isn't enough to make it a big deal and I'll include it in the next version, we'll see:Add this to the end of the jquery.anythingslider.js file (outside of the enclosure)
If you are having trouble making the changes, here is the file with those changes: https://dl.dropbox.com/u/1510510/misc/jquery.anythingslider.for.jQuery1.3.2.js
benshell commentedon Dec 29, 2010
This is awesome, thanks so much. I may not get back to working on this until next week, but when I do I'll be sure to let you know how these changes work!
Mottie commentedon Jan 29, 2011
Closing this issue
dessol commentedon Feb 14, 2011
Getting the following error using jQuery 1.3.2
Uncaught TypeError: Object # has no method 'swing'
b.fx.stepu.js:19
Fu.js:19
b.fx.customu.js:19
b.fn.extend.animateu.js:19
b.extend.eachu.js:12
b.fn.extend.animateu.js:19
b.extend.eachu.js:12
b.fn.b.eachu.js:12
b.fn.extend.animateu.js:19
$.anythingSlider.base.gotoPagejquery.anythingslider.1.3.2.js:390
$.anythingSlider.base.buildNavigationjquery.anythingslider.1.3.2.js:255
b.event.handleu.js:19
b.event.add.E
Mottie commentedon Feb 14, 2011
Hi Dessol!
I updated the version I had above (https://dl.dropbox.com/u/1510510/misc/jquery.anythingslider.for.jQuery1.3.2.js), just use it in place of the jquery.anythingslider.js file you have
Mottie commentedon Feb 21, 2011
Just as an update, I pushed version 1.5.7 which in the non-minified version has the "delay" code commented out at the end. If you un-comment out that code, AnythingSlider will be compatible with jQuery version 1.3.2. If you are using the minified version, just copy that code to the end of the minified code.