I got a button to click to show a map(slideDown). After showing, if the user click again the button, the map will hide(slideUp). I don't know how to remove the click event in the function, cause i want to detect the second click. This is my function code now:
function subangMap() {
$("#mapInfo").unbind();
$("#info").css("height", "760px");
$("#mapInfo").text("Click here to hide map");
$("#subangMapSlide").slideDown();
$("mapInfo").click($("#subangMapSlide").slideUp());
}
This is my edit code with off(). But still not working..
function subangMap()
{
$("mapInfo").off('click');
$("#info").css("height","760px");
$("#mapInfo").text("Click here to hide map");
$("#subangMapSlide").slideDown();
$("mapInfo").click($("#subangMapSlide").slideUp());
}