Levi Villarreal Levi Villarreal - 2 years ago 78
jQuery Question

Jquery .click not working when changing css properties

I have this html,

<h2 class="more-button">Read More</h2>

and am trying to have it change the position of another div when it is clicked. To accomplish this I am using

$(".hidden-block").css("right", "110%");

FIDDLE : https://jsfiddle.net/wfxxkk3x/

But the code does absolutely nothing. I have tried many different approaches with this problem and nothing seems to work. Any help would be appreciated.

Answer Source

Change the selector of the hidden-block from a class to an id

$("#hidden-block").css("right", "110%");});


or use animate to animate the div


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download