I have been attempting to create a function where different divs fade in and out when clicking on an image with an <a href>
. Unfortunately, I have not been successful in getting it to work despite several attempts. Here is the code that I am using:
$(document).ready(function () {
$("input[type='checkbox']").change(function () {
var state = $(this).val();
$("#" + state).toggleClass("overlay");
});
$('#triggerButton').click(function (e) {
e.preventDefault();
$('#firstscreen').fadeOut('fast', function () {
$('#casualshirt').fadeIn('fast');
});
});
});
//CSS code here...
//HTML code here...
I have thoroughly researched this issue but have not been able to find a solution.
UPDATE: I did include a Fiddle link but it seems to have been removed. You can access the fiddle here.
UPDATE: Updated Fiddle with fixes for the id.