vlio20 vlio20 - 1 year ago 74
Javascript Question

jQuery 'trigger('click')` not working on opera if the element is not displayed

I have some element which click on it event triggers click on

<input style="display:none" type="file"/>
this element is hidden (
On this browser: Chrome, IE, FireFox it is working (the trigger executes) but on Opera and Safari it doesn't. Is there any special thing I need to do for the problematic browsers (Opera and Safari)? Is there any walk around?

Many thanks!

here is the code of the event


Answer Source

Ok I found this workaround, I have set the element's css to:

visibility: hidden;
position: absolute;

it is working on every browser above. I will be more then glad to hear any other solutions.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download