I am currently working on a project that involves allowing users to modify or move an image in the browser by clicking on buttons located on the side of the page. However, I am facing issues with the script in my if/else statement. Here is a snippet of what I have implemented in jQuery so far:
<meta charset="utf-8">
<title>Image Modification</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="js/main.js">
var menu = $('ul li').click(function() {
console.log($(this).index());
if (menu = 0) {
$('this').css('width', '80%')
}
else if (menu = 1) {
$('this').css('height', '80%')
}
else if (menu = 2) {
$('this').css('height', '80%')
}
else if (menu = 3) {
$('this').css('top', '30')
}
else if (menu = 4) {
$('this').css('left', '50')
}
else if (menu = 5) {
$('this').css('left', -50')
}
else {
}
});
</script>
</head>
<body>
<nav id="sidebar">
<ul>
<li>Edit 1</li>
<li>Edit 2</li>
<li>Edit 3</li>
<li>Edit 4</li>
<li>Edit 5</li>
<li>Edit 6</li>
</ul>
</nav>
<img class="active" src="images/picture.jpg" />
</body>