Adding a slide toggle on WordPress
WordPress has default jQuery. So, no need to load this file explicitly. JS Code: jQuery(‘#toggle-onoff-network’).on({ ‘click’: function () { var origsrc = jQuery(this).attr(‘src’); var src=””; if (origsrc == “https://wordpress.stackexchange.com/questions/166823/img1_on.png”) src=”img2_on.png”; if (origsrc == ‘img2_on.png’) src=”https://wordpress.stackexchange.com/questions/166823/img1_on.png”; jQuery(this).attr(‘src’, src); } }); // The script jQuery( “#netywork-toggle” ).click(function() { jQuery( “#share-stuff” ).slideToggle( “slow”, function() { // Animation complete. … Read more