jQuery click anywhere in the page except on 1 div

You can apply click on body of document and cancel click processing if the click event is generated by div with id menu_content, This will bind event to single element and saving binding of click with every element except menu_content $(‘body’).click(function(evt){ if(evt.target.id == “menu_content”) return; //For descendants of menu_content being clicked, remove this check if … Read more

$(document).on(“click”… not working?

You are using the correct syntax for binding to the document to listen for a click event for an element with id=”test-element”. It’s probably not working due to one of: Not using recent version of jQuery Not wrapping your code inside of DOM ready or you are doing something which causes the event not to … Read more

$(document).click() not working correctly on iPhone. jquery [duplicate]

Short answer: <style> .clickable-div { cursor: pointer; } </style> Longer answer: It’s important to realize that if you’re just using <a> tags everything will work as expected. You can click or drag by mistake on a regular <a> link on an iPhone and everything behaves as the user would expect. I imagine that you have … Read more

Is there an equivalent to e.PageX position for ‘touchstart’ event as there is for click event?

Kinda late, but you need to access the original event, not the jQuery massaged one. Also, since these are multi-touch events, other changes need to be made: $(‘#box’).live(‘touchstart’, function(e) { var xPos = e.originalEvent.touches[0].pageX; }); If you want other fingers, you can find them in other indices of the touches list. UPDATE FOR NEWER JQUERY: … Read more

Why is this jQuery click function not working?

You are supposed to add the javascript code in a $(document).ready(function() {}); block. i.e. $(document).ready(function() { $(“#clicker”).click(function () { alert(“Hello!”); $(“.hide_div”).hide(); }); }); As jQuery documentation states: “A page can’t be manipulated safely until the document is “ready.” jQuery detects this state of readiness for you. Code included inside $( document ).ready() will only run … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)