Response title
This is preview!
(function ($) {
"use strict";
$.fn.myfunction = function (options) {
var settings = $.extend({
//default
isstatic: false
});
var options = $.extend(settings, options);
//Iterate over the current set of matched elements
return this.each(function () {
var obj = $('.mydiv2');
obj.hide();
$(this).show();
$(this).click(function () {
obj.toggle("slow");
if (options.isstatic) {
$(".image-class").attr("src", "/1.png");
options.isstatic = false;
}
else {
$(".image-class").attr("src", "/final-cropped.gif");
options.isstatic = true;
}
});
});
return options.isstatic = false;
}
})(jQuery);
This working locally but when I upload it on my website it cant be called from
another website as I dont really know how to write this in jquery..I mean how to
give my source file url
Basically I want to add my website link to it so It can be accessed through it and
can be added on any other website
I calling it using
$(document).ready(function () { $('.div1').myfunction(); });
© 2013 jQuery Foundation
Sponsored by and others.