Recently, I've been attempting to change the CSS properties of a div by triggering a click event. However, no matter what I do, it doesn't seem to be working and it's starting to frustrate me. Can anyone shed some light on why this might be happening?
Here is an example of the click event:
$("#colButton3").on("click", function() {
unCollapse('#CarouselSpace','#CarouselBody');
});
The function unCollapse is defined as follows:
var unCollapse = function(headerElement, bodyElement) {
$(headerElement).css('margin-top', '1500px');
$(bodyElement).css('min-height', '820px');
};
The button itself is created dynamically using jQuery, but the HTML for the button looks like this:
<button class="btn btn-success" href="#" id="colButton3" style="display: inline-block;">Learn More</button>
The divs that are being targeted are these:
<div id="CarouselSpace" class="row"><h1 id="CarouselHeader"></h1></div>
<div id="CarouselBody" class="row"></div>
If anyone can provide any insight into what I might be doing wrong, I would greatly appreciate it.
Thank you in advance!