You have to give 2 different id/class to your image and Main menu1 text. When the image is click set "display" property for submenu, when mainmenu1 is click then jump to new url. I have create jquery for more understanding.
$(document).ready(function () {
$("#img").click(function () {
$("#submenu").css({ "display": "block" });
});
$("#mainmenu1").click(function () {
location.href = "//localhost:1787/Table/Index/";
});
});