Currently working on my final project for my webpage development course, I am focusing on creating a blog-themed website. My goal is to implement a feature where clicking on a profile picture expands it into a box displaying a bio and additional information. I have successfully completed this functionality, but now I am facing a challenge. I want the ability to click on the profile picture again to revert back to its original state, hiding the box and info. Despite trying various methods, such as .toggle, I have not been able to achieve the desired result. Any guidance or advice on how to accomplish this would be greatly appreciated. Thank you.
(JSfiddle wasn't functioning properly for me, apologies) >
CodePen
JavaScript:
$(document).ready(function() {
$('#picback').click(function() {
$('#picback').animate({
borderTopLeftRadius: 100,
borderTopRightRadius: 100,
borderBottomLeftRadius: 2,
borderBottomRightRadius: 2,
height: 460
}, 'slow');
$('#info').fadeIn('slow');
});
});