Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function($) {
- $.fn.addimate = function(noOfImages, prefix, x, extension, interval) {
- if (x > noOfImages) {
- x = 1;
- }
- console.log($(this).attr("id") + "n" + prefix + x + extension + "n" + interval);
- $(this).attr("src", prefix + x + extension);
- x ++;
- setTimeout(function() {
- $(this).addimate(noOfImages, prefix, x, extension, interval);
- }, interval);
- }
- }) (jQuery);
- (function($) {
- $.fn.addimate = function(noOfImages, prefix, x, extension, interval) {
- //Intentionally deleted content.
- }; //AND you're missing a semicolon here
- }) (jQuery);
- (function($) {
- $.fn.addimate = function(noOfImages, prefix, x, extension, interval) {
- var $this = this; //This will maintain the context of the jQuery object.
- if (x > noOfImages) {
- x = 1;
- }
- console.log(this.attr("id") + "n" + prefix + x + extension + "n" + interval);
- this.attr("src", prefix + x + extension);
- x++;
- setTimeout(function() {
- $this.addimate(noOfImages, prefix, x, extension, interval);
- }, interval);
- };
- }(jQuery));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement