日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

jQuery Mobile动态刷新页面样式

發布時間:2025/3/11 17 豆豆
生活随笔 收集整理的這篇文章主要介紹了 jQuery Mobile动态刷新页面样式 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

見 百度經驗

http://jingyan.baidu.com/article/7f766dafbc18f24101e1d014.html



JQM里面當我們更新了某些頁面標簽(如:?listview,?radiobuttons,?checkboxes,?select?menus)里的數據時,必須做refresh操作.

為什么必須做refresh操作操作呢?因為JQM在做頁面渲染的時候,為了使樣式跟客戶端程序相似,?隱藏了原始的標簽然后用一些新的標簽和自定義的樣式來表現原標簽,其實新樣式的標簽已經不是原來的標簽,所以更新了數據必須做refresh操作.?

各類標簽的刷新

1.Textarea?fields

$('body').prepend('<textarea id="myTextArea"></textarea>'); $('#myTextArea').textinput(); 2.Text input fields $('body').prepend('<input type="text" id="myTextField" />'); $('#myTextField').textinput();

3.Buttons

$('body').append('<a href="" data-theme="e" id="myNewButton">testing</a>'); $('#myNewButton').button();

4.Combobox?or?select?dropdowns

<label for="sCountry">Country:</label> <select name="sCountry" id="sCountry"> <option value="">Where You Live:</option> <option value="ad">Andorra</option> <option value="ae">United Arab Emirates</option> </select>var myselect = $("#sCountry"); myselect[0].selectedIndex = 3; myselect.selectmenu('refresh');

5.Listviews

<ul id="myList" data-role="listview" data-inset="true"> <li>Acura</li> <li>Audi</li> <li>BMW</li> </ul>$('#mylist').listview('refresh');

6.Slider?control

<div data-role="fieldcontain"> <label for="slider-2">Input slider:</label> <input type="range" id="slider-2" value="25" min="0" max="100" /> </div>$('#slider-2').val(80).slider('refresh');

7.Toggle?switch

<div data-role="fieldcontain"> <label for="toggle">Flip switch:</label> <select name="toggle" id="toggle" data-role="slider"> <option value="off">Off</option> <option value="on">On</option> </select> </div>var myswitch = $("#toggle"); myswitch[0].selectedIndex = 1; myswitch .slider("refresh");

8.Radio?buttons

<div data-role="fieldcontain"><fieldset data-role="controlgroup" data-type="horizontal"><legend>Layout view:</legend><input type="radio" name="radio-view" value="list" /><label for="radio-view-a">List</label><input type="radio" name="radio-view" value="grid" /><label for="radio-view-b">Grid</label><input type="radio" name="radio-view" value="gallery" /><label for="radio-view-c">Gallery</label></fieldset> </div>$("input[value=grid]").attr('checked',true).checkboxradio('refresh');

9.Checkboxes

<div data-role="fieldcontain"> <fieldset data-role="controlgroup"> <legend>Agree to the terms:</legend> <input type="checkbox" name="checkbox-1" id="checkbox-1" class="custom" /> <label for="checkbox-1">I agree</label> </fieldset> </div>$('#checkbox-1').attr('checked',true).checkboxradio('refresh');

創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎

總結

以上是生活随笔為你收集整理的jQuery Mobile动态刷新页面样式的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。