jquery - Safari input='file' doesn't work -
I have a div that is on click trigger input-file in other browsers (Chrome, Firefox, IE) But in Safari (5.1.7) it is not so. Any ideas why? Click (function () {$ ("# mask-load-file") trigger ('click') ($ (function () {$ ("# mask-button-file"). ');});}); & Lt; Div id = "mask-button-file" class = "hover active" & gt; . . . & Lt; / Div & gt; & Lt; Input type = "file" id = "mask load file" name = "file1" & gt; # Mask load file {display: none; Opacity: 0; } #mask-button-file {width: 81px; Height: 40px; Background color: # f70808; Swim left; Text align: center; Vertical-row: middle; Line-height: 40px; Margin-left: 1px; Cursor: indicator; } #mask-button-file: active {background color: # DF0005; }
This is because the input is being set to the display : None
and there is a problem in its Safari, instead of hiding it, set it to height
, width
to zero.
& lt; Div & gt; & Lt; Input type = "file" id = "myfile" name = "upload" / & gt; & Lt; / Div & gt;
CSS:
div {width: 0px; Height: 0 pixels; Hidden flurry; }
Another option would be to position the output with a viewport so that it is not visible.
You can refer to this post: More options for this.
Comments
Post a Comment