小强的HTML5移动开发之路(38)——jqMobi插件ActionSheet
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了小强的HTML5移动开发之路(38)——jqMobi插件ActionSheet,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2093字,纯文字阅读大概需要3分钟。
内容图文
![小强的HTML5移动开发之路(38)——jqMobi插件ActionSheet](/upload/InfoBanner/zyjiaocheng/389/75af3001d54549d192d11d41c0796154.jpg)
首先右击上面的按钮选择审查元素(我用的是Chrome浏览器,先按F12)
<a class="button" onclick="showCustomHtmlSheet()">Show Custom Html Sheet</a>
然后Ctrl + F查找 showCustomHtmlSheet()方法
代码贴出如下:
function showCustomHtmlSheet() { $("#afui").actionsheet('<a >Back</a><a onclick="alert(\'hi\');" >Show Alert 3</a><a onclick="alert(\'goodbye\');">Show Alert 4</a>'); }
我们可以看到上面的函数中有三个按钮链接,上图中最后一个Cancel是系统默认的取消按钮。
再Ctrl + F查找一个 plugins,可以看到如下一行
<link rel="stylesheet" type="text/css" href="plugins/css/af.actionsheet.css">
好吧我们下面开始在我们的工程中实现如上效果:
首先引入af.actionsheet.css文件
将上面的代码放入content中
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>jqMobi</title> <link href="css/af.ui.css" rel="stylesheet" type="text/css"/> <link href="css/icons.css" rel="stylesheet" type="text/css"/> <link rel="stylesheet" type="text/css" href="plugins/css/af.actionsheet.css"> <script src="appframework.js" type="text/javascript"></script> <script src="ui/appframework.ui.js" type="text/javascript"></script> </head> <body> <p id="afui"> <p id="header"> <!-- any additional HTML you want can go here --> <a onclick="$.ui.toggleSideMenu();" class="button">Toggle Side Menu</a> </p> <p id="content"> <!-- this is where your panels will go --> <p id="main" title="Welcome" class="panel" selected="true"> <a class="button" onclick="showCustomHtmlSheet()">Show Custom Html Sheet</a> </p> <p id="about" title="About" class="panel" data-nav="second_nav"> <!-- by setting data-nav the "second_nav" will be shown on this panel --> </p> </p> //底部 <p id="navbar"> <a target="#welcome" class="icon home">Home</a> </p> </p> <script> function showCustomHtmlSheet() { $("#afui").actionsheet('<a >Back</a><a onclick="alert(\'hi\');" >Show Alert 3</a><a onclick="alert(\'goodbye\');">Show Alert 4</a>'); } </script> </body> </html>
运行结果:
以上就是小强的HTML5移动开发之路(38)——jqMobi插件ActionSheet的内容,更多相关内容请关注PHP中文网(www.gxlcms.com)!
内容总结
以上是互联网集市为您收集整理的小强的HTML5移动开发之路(38)——jqMobi插件ActionSheet全部内容,希望文章能够帮你解决小强的HTML5移动开发之路(38)——jqMobi插件ActionSheet所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。