I am pretty new with jQuery and I am trying to achieve a simple interaction.
Scenario I have a circle and a square on my page. The square is hidden (display:none) by default. When I hover my mouse on the circle, it will reveal a link in it. When you click on it, the circle will fade away and the square will fade in.
Problem The circle fades away and the square fades in but the square gets hidden after it fades in. The display:block property doesn't seem to work?
Code http://codepen.io/vennsoh/pen/urFid
I have edited the code, it works now.
$(function(){ $("#click").on("click", function(){ $(".circle").addClass("fade-out"); $(".square").addClass("fade-in"); }); });