Hello, everyone! I am working on a platform where I do not have access to the javascript files but I can add my own. I have the jQuery working in CodePen but when I upload it to the platform it is not working.
I know it doesn’t have anything to do with the upload itself because I have uploaded other files (created by other people) and they are working fine. So it must be something that I am missing in my code.
The file that works has the code surrounded by the following
(function($){
$.fn.twentytwenty = function(options) {
var options = $.extend({default_offset_pct: 0.5, orientation: 'horizontal'}, options);
return this.each(function() {
//a bunch of code here //
};
})(jQuery);
I don’t have my code wrapped in anything, so I am assuming it is because of this. However, I don’t know what any of this code means and when I try to add it in CodePen, it stops all my other code from working.
Any help would be greatly appreciated, I am a complete beginner when it comes to Javascript.