成人精品一区二区三区中文字幕-成人精品一区二区三区-成人精品一级毛片-成人精品亚洲-日本在线视频一区二区-日本在线视频免费

導航首頁 ? 技術教程 ? jQuery Mobile彈出窗、彈出層知識匯總
全站頭部文字 我要出現在這里
jQuery Mobile彈出窗、彈出層知識匯總 640 2024-03-15   

先創建一個窗體

<div data-role="popup" id="popupView" class="ui-content" data-overlay-theme="b" data-position-to="window" data-dismissible="false">
  <a href='javascript:void(0)' data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-a ui-icon-delete ui-btn-icon-notext ui-btn-right">Close</a>
  <div>彈出窗內容<div>
</div>

1)點擊后彈出

<a  data-rel="popup" data-transition="flip" class="ui-btn ui-corner-all">按鈕</a> 

2)頁面加載后彈出

//頁面延時加載<script>
setTimeout(function () {
  $("#popupView").popup('open');
}, 1000);//1秒</script> 

關鍵字說明:

data-overlay-theme: 背景色透明灰 data-position-to: 彈窗在窗口居中顯示 data-dismissible: 是否允許單擊窗口外任一位置關閉窗口(默認true為允許) data-transition: 彈出方式

下面通過代碼實例詳解jquery mobile 彈出層使用

引入文件

<head> 
<link rel="stylesheet" > <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script> <script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script> 
</head>

彈出層基礎

創建一個彈出層,要在div標簽中添加一個 data-role="popup" 屬性,然后在添加一個a標簽,并在a標簽href屬性中設置彈出div層的id,在a標簽中添加屬性

data-rel="popup"
To create a popup, add the data-role="popup" attribute to a div with the popup contents. Then create a link with the href set to the id of the popup div, and add the attribute data-rel="popup" to tell the framework to open the popup when the link is tapped. A popup div has to be nested inside the same page as the link.
<a  data-rel="popup" class="ui-btn ui-corner-all ui-shadow ui-btn-inline" data-transition="pop">Basic Popup</a>
<div data-role="popup" id="popupBasic">
<p>This is a completely basic popup, no options set.</p>
</div>

簡單實例

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" >
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
</head>
<body>
<div data-role="page" id="pageone">
<a  data-rel="popup" class="ui-btn ui-corner-all ui-shadow ui-btn-inline" data-transition="pop">點擊我彈出層</a>
<div data-role="popup" id="popupBasic">
<p>彈出層測試</p>
</div>
</div> 
</body>
</html>

工具提示可以通過添加一個主題創建樣本基本通過ui-content彈出并添加填充

A tooltip can be created by adding a theme swatch to a basic popup and adding padding via the ui-content class. 
<p>A paragraph with a tooltip. <a  data-rel="popup" data-transition="pop" class="my-tooltip-btn ui-btn ui-alt-icon ui-nodisc-icon ui-btn-inline ui-icon-info ui-btn-icon-notext" title="Learn more">Learn more</a></p>
<div data-role="popup" id="popupInfo" class="ui-content" data-theme="a" style="max-width:350px;">
<p>Here is a <strong>tiny popup</strong> being used like a tooltip. The text will wrap to multiple lines as needed.</p>
</div>

提示信息實例

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" >
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
</head>
<body>
<div data-role="page" id="pageone">
<p>A paragraph with a tooltip. <a  data-rel="popup" data-transition="pop" class="my-tooltip-btn ui-btn ui-alt-icon ui-nodisc-icon ui-btn-inline ui-icon-info ui-btn-icon-notext" title="Learn more">Learn more</a></p>
<div data-role="popup" id="popupInfo" class="ui-content" data-theme="a" style="max-width:350px;">
<p>Here is a <strong>tiny popup</strong> being used like a tooltip. The text will wrap to multiple lines as needed.</p>
</div>
</div> 
</body>
</html>

彈出圖片

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" >
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
</head>
<body>
<div data-role="page" id="pageone">
<a  data-rel="popup" data-position-to="window" data-transition="fade"><img class="popphoto" src="http://demos.jquerymobile.com/1.4.3/_assets/img/paris.jpg" alt="Paris, France" style="width:30%"></a>
<a  data-rel="popup" data-position-to="window" data-transition="fade"><img class="popphoto" src="http://demos.jquerymobile.com/1.4.3/_assets/img/sydney.jpg" alt="Sydney, Australia" style="width:30%"></a>
<a  data-rel="popup" data-position-to="window" data-transition="fade"><img class="popphoto" src="http://demos.jquerymobile.com/1.4.3/_assets/img/newyork.jpg" alt="New York, USA" style="width:30%"></a>
<div data-role="popup" id="popupParis" data-overlay-theme="b" data-theme="b" data-corners="false">
<a  data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-a ui-icon-delete ui-btn-icon-notext ui-btn-right">Close</a><img class="popphoto" src="http://demos.jquerymobile.com/1.4.3/_assets/img/paris.jpg" style="max-height:512px;" alt="Paris, France">
</div>
<div data-role="popup" id="popupSydney" data-overlay-theme="b" data-theme="b" data-corners="false">
<a  data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-a ui-icon-delete ui-btn-icon-notext ui-btn-right">Close</a><img class="popphoto" src="http://demos.jquerymobile.com/1.4.3/_assets/img/sydney.jpg" style="max-height:512px;" alt="Sydney, Australia">
</div>
<div data-role="popup" id="popupNYC" data-overlay-theme="b" data-theme="b" data-corners="false">
<a  data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-a ui-icon-delete ui-btn-icon-notext ui-btn-right">Close</a><img class="popphoto" src="http://demos.jquerymobile.com/1.4.3/_assets/img/newyork.jpg" style="max-height:512px;" alt="New York, USA">
</div>
</div> 
</body>
</html>


主站蜘蛛池模板: 李欣聪个人资料| 《x教程》韩剧免费观看| 零食店加盟免费品牌| 饶俊| 小淘气尼古拉| 87电影| 亲密 电影| 光遇安卓官服下载| 王韧| 谢容儿| 萱草花二声部合唱谱| 大石桥联盟| 钢琴键盘示意图| 舞法天女第三季| 李乃文宋丹丹朱媛媛演的电视剧| 熊出没之过年大电影| 红色诗集诗配画竖版| 爱奴 电影| 第一财经公司与行业回放| 《魔鬼天使》电影| free gay movies| amari| 婚前协议电视剧演员表| 永濑佳子| 男娘曦曦呀曦曦最新| 翟潇闻个人介绍| 邓稼先教案设计一等奖优秀教案| 斯维特拜克之歌电影| 免费观看片| 木乃伊5| 男女瑟瑟视频| 小镇姑娘电影| 一年又一年电视剧演员表| 陈诗雅韩国演员| 羽毛球壁纸| 金璐莹| 梦想建筑师泰国百合剧| 麻辣烫热量| 延边卫视节目表| 混沌行走| 色戒在线完整版|

?。?!站長長期在線接?。?!

網站、小程序:定制開發/二次開發/仿制開發等

各種疑難雜癥解決/定制接口/定制采集等

站長微信:lxwl520520

站長QQ:1737366103