Is it too much to ask to have an invisible button on jQuery Mobile?

夙愿已清 提交于 2020-01-25 11:51:26

问题


I struggled with this for a while, so figured I'd put the answer on here.

How can I have an invisible button on jQM?


回答1:


Create the button using this tag -

<input type="[yourchoice, mine was submit]" id="[yourchoice]" data-role="none" />

The crucial part is the data-role="none". This means jQM ignores it, so when you use $.hide(), you're not left with a random empty blob of rendering on the screen.




回答2:


In my case I can't receive click event on submit by pressing the "go" button if input is hidden (if it is not hidden - it works). I workaround it using css: "width:1px; height: 1px; background: transparent; border: 0;". May be it helps someone too.



来源:https://stackoverflow.com/questions/11174159/is-it-too-much-to-ask-to-have-an-invisible-button-on-jquery-mobile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!