I have div which is cloned on clicking image next to And.
Right click event listeners are working in jsfiddle but not actually working in my page. :(
Do i need to do something extra. I tried adding different jquery links , but to no avail.
Related
I am trying to programmatically trigger a click on a wordpress page on a <a href="#"... tag which after clicked shows a div with all categories... (the div is not hidden it gets created after clicking the button)
When trying to find the click event behind this element on chrome debugger DOM in event listeners the only event attached
to this element is flatsome.js?ver=3.12.1:109
the handler is f(t) ............
using jQuery Audit, I can see the handler definition, then there are many functions like !function(t)... because it is minified.
I tried to use jQuery click, mouseup, mousedown events (also with trigger('click...') ) with no success, it gets the object, doesn't show an error, but never shows the filter menu.
Is there a way to just emulate the physical click as if it was done with the mouse? then I wouldn't need to call the function, I can't seem to find what function is behind the click event...
Thank you in advance
Dario
Have you tried the following code?
Using jQuery:
$('your-query-selector').trigger('click');
Using JavaScript:
document.querySelector('your-query-selector').click();
I am using the autocomplete js from here:
https://goodies.pixabay.com/javascript/auto-complete/demo.html
It all works fine but when I click one of the suggestions
A click event fires on the body element which then shuts down the whole drop down menu.
(this is by design as in every other case where there body is genuinely clicked I want the drop down menu to disappear)
When I check the event that is firing on the body the path is showing that it is starting at the body element. I have put event stop propogation functions on all of the divs created in the drop down menue including the ones created by the autocomplete. It doesn't seem to be coming from them - it is if it the click is firing the click event of the suggestions divs but additionally of body underneath as an entirely separate click event.
How can I stop this from happening?
Many thanks.
SOLUTION:
The autocomplete javascript code from pixabay was capturing the mousedown event - and then setting the display of the suggestions to none. This meant that when the click event fired the suggestion div was no longer there causing it to fire a click on whatever was underneath the click. So I changed the mousedown event in the autocomplete code to click and this has fixed the problem.
This seems like a bug in their code? I can't see a reason why you'd ever want the click event to be fired on what happens to be underneath a suggestion?
I'm using jQuery Mobile to develop one single page to use in Android Webview.
There is an button which I need put some pressed effect, and then I use vmousedown to add press style class and vmouseup to remove the class added before. However, there are something interrupt the vmouseup process.
Reproduce:
First, press one button, and it trigger the vmousedown event.
Then, keep hold your finger and move outside the trigger area.
Finally, loosen your finger and you will see it keeps the state that you hold it.
I have done a demo to test, and find that it even won't trigger vmouseout or vmousecancel, the last event have been triggered is vmousedown.
Is there anyone know why this happen and how to solve this?
This is code : Fiddle
When I written an example to test gesture event, I noticed that, the taphold event will be triggered and then I put it in on method and this problem fixed.
The click event should work fine:
subMenu = $(".sub-menu")
//....
subMenu.show()
$("a.mobile").click (e) ->
menuContainer.toggle()
e.preventDefault()
This should toggle the menu on click/tap. The weird thing is that it does it just fine for the first open and close.
Starting with the second time, to open, I have to click "a.mobile" twice.
I've tried bind, and a bunch of other options. The CSS is actually displaying the link as it were hovered when it's not double-tapped.
I'm not 100% sure about .click() function, however i use .on('click') for handle events on my application and it works everywhere (including IPads). Nevertheless as suggested by the comments, perhaps there is something elsewhere preventing the click to work as you expect.
I am trying to customize jwysiwyg jquery RTE. I would like to build an image attributes editor so that once an image is inserted into the editable region, the user would select it and then a modal window or properties panel would appear allowing the user to edit the width/height etc. Analogous to gmails image insert UI.
The problem is I am having trouble finding out how to handle the necessary image click event. Anyone know some example code or some info for where I can start?
I am just starting on something similar. Using jQuery's delegate() method, I got it to work like this:
$("#bodyoftheeditordocument").delegate("img", "click", function (evt) {
// handle click event here...
});
The cool thing about the delegate method is that it will attach this event handler to any img tag in the body, present or future. So even images inserted as part of the editing process with get wired up.
Good luck.
Mark
My solution on iOS 10 is to add a contenteditable="false" attribute to the img element which needs to be clickable.
Otherwise safari will think that your intention is to just move the caret before/after the image if it's inside an contenteditable element.