javascript - Why is my div not resizing in jQuery? -
i'm trying resize div when click on it, yet it's not resizing. can tell me why?
css
#navigation{ position: absolute; display: block; float: right; margin: 0; top: 0; right: 0; width: 25px; height: 100%; z-index: 1; background-color: green; }
js
$("#navigation").on("click", function(){ $("#navigation").css("width", "100px"); })
doing way not work either.
$("#navigation").on("click", function(){ $("#navigation").width(100); })
html
<div id="navigation"> <ul></ul> </div>
the console not showing errors.
try instead:
$('#navigation').click(function () { $(this).css("width", "100px"); });
Comments
Post a Comment