$(".icon-bg").click(function () { $(".btn").toggleClass("active"); $(".icon-bg").toggleClass("active"); $(".container").toggleClass("active"); $(".box-upload").toggleClass("active"); $(".box-caption").toggleClass("active"); $(".box-tags").toggleClass("active"); $(".private").toggleClass("active"); $(".set-time-limit").toggleClass("active"); $(".button").toggleClass("active"); }); $(".button").click(function () { $(".button-overlay").toggleClass("active"); }); $(".iconmelon").click(function () { $(".box-upload-ing").toggleClass("active"); $(".iconmelon-loaded").toggleClass("active"); }); $(".private").click(function () { $(".private-overlay").addClass("active"); $(".private-overlay-wave").addClass("active"); });
Can anyone help? It's for an upload function I found at http://codepen.io/iremlopsum/pen/YPWPap. Trying to get it into my website
There are two ways to include jQuery in a project, which is to download a local copy or link to a file via Content Delivery Network (CDN).
1) Best practice is to make new javascript file like my.js. Make this file into your js folder in root directory -> js/my.js . 2) In my.js file add your code inside of $(document).ready(function(){}) scope.
$(document).ready(function(){ $(".icon-bg").click(function () { $(".btn").toggleClass("active"); $(".icon-bg").toggleClass("active"); $(".container").toggleClass("active"); $(".box-upload").toggleClass("active"); $(".box-caption").toggleClass("active"); $(".box-tags").toggleClass("active"); $(".private").toggleClass("active"); $(".set-time-limit").toggleClass("active"); $(".button").toggleClass("active"); }); $(".button").click(function () { $(".button-overlay").toggleClass("active"); }); $(".iconmelon").click(function () { $(".box-upload-ing").toggleClass("active"); $(".iconmelon-loaded").toggleClass("active"); }); $(".private").click(function () { $(".private-overlay").addClass("active"); $(".private-overlay-wave").addClass("active"); }); });
3) add your new js file into your html
<head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script src="/js/my.js"></script> </head>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With