gpt4 book ai didi

ios - ngf-select 不适用于 iphone5

转载 作者:行者123 更新时间:2023-11-29 00:12:30 25 4
gpt4 key购买 nike

这是我的html

<input id="fileUploaderInput" ng-model="$ctrl.files" ng-change="$ctrl.onSelectFiles()" style="display: none" type="file"
ngf-select multiple>

<button type="button" class="button shed-btn button-energized" ng-click="$ctrl.onClickBrowse()">Browse</button>

我的 js 代码在单击按钮时触发输入元素的单击事件。

vm.onClickBrowse = function () {
document.getElementById('fileUploaderInput').click();

}

它在 android 和 iphone6 上运行良好,但在 iphone5 上运行不正常。任何帮助将不胜感激

最佳答案

请尝试此解决方案。

a) 将您的输入包裹在您的按钮中

<button 
type="button"
class="button shed-btn button-energized upload-inp-wrapper"
ng-click="$ctrl.onClickBrowse()">
Browse

<input
type="file"
id="fileUploaderInput"
ng-model="$ctrl.files"
ng-change="$ctrl.onSelectFiles()"
ngf-select multiple>
</button>

b) 相应地设置元素的样式

.upload-inp-wrapper{
position: relative;
}

.upload-inp-wrapper input{
position: absolute;
top:0;
left:0;
width: 100%;
height: 100%;
opacity: 0; /* so it doesn't show */
z-index: 2; /* or whatever keeps the input above button */
}

关于ios - ngf-select 不适用于 iphone5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46052812/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com