티스토리 뷰
I want to share with you some important codes that you may need during JQuery Mobile development.These codes has been tested on Alpha 4 version.
Beta 1 has been released before two days, Therefore I will test them in my current project and inform you of any changes :
Also check JQuery Mobile Code Snippets 2.
Show and hide back button in your Application
$(document).bind("mobileinit", function () {
$.mobile.page.prototype.options.addBackBtn = true;
});
Customizing the back button text
$(document).bind("mobileinit", function () {
$.mobile.page.prototype.options.backBtnText = "previous";
});
Hide "Close button" for dialog programatically:
$('[data-role=dialog]div[id="YourDiaogdivID"]').live('pagecreate', function (event) {
$("a[data-icon='delete']").hide();
});
Change Select option element index:
var myselect = $("select#foo");
myselect[0].selectedIndex = 0; //The new index
myselect.selectmenu("refresh"); //uset this line of code after any updating on the select element
Change Select optoin elemetn text value:
$("select#foo").parent().contents().children('.ui-btn-text').text('Your Text Here');
Refreshing a checkbox
$("select#foo").parent().contents().children('.ui-btn-text').text('Your Text Here');
Hide select option element
$('#foo').parent().hide();
Hide and Show Page Loading Message :
Before Beta 2:
$.mobile.pageLoading(); //Show
$.mobile.pageLoading(true); //hide
Beta 2+ :
$.mobile.showPageLoadingMsg();
$.mobile.hidePageLoadingMsg();
overriding $.mobile.loadingMessage
$(document).bind("mobileinit", function () {
$.mobile.loadingMessage = 'My Loading Message';
});
Hide and Show jQuery-Mobile-Themed-DatePicker
$(".ui-datepicker").hide();
$(".ui-datepicker").show();
Build your Custom Loading Message :
$('#CustomeLoadingMessage').hide();//Hide the div
$('# CustomeLoadingMessage').ajaxStart(function () {
$(this).show();
});
$('# CustomeLoadingMessage').ajaxStop(function () {
$(this).hide();
});
I will publish other important codes soon.
Hope that helps.
출처 : http://weblogs.asp.net/yousefjadallah/archive/2011/08/09/jquery-mobile-code-snippets-1.aspx
'프로그래밍 > Jquery Mobile' 카테고리의 다른 글
Jquery Mobile API & Document (0) | 2012.04.18 |
---|---|
JQuery Mobile Code Snippets 2 (0) | 2012.04.09 |
Jquery Mobile Grid layout (제이쿼리 모바일 그리드 레이아웃) (0) | 2012.04.09 |
jquerymobile 에서 페이지 로딩시 자바스크립트 실행 하기 (0) | 2012.04.04 |
Jquery Mobile 페이지 이동방식, swipeleft, swiperight (0) | 2012.03.30 |
- Total
- Today
- Yesterday
- SVG
- jquery chart
- grid
- jQuery
- 제이쿼리
- MSSQL
- 자바스크립트
- Excel
- CSS
- WebApi
- css3
- drag&drop
- rowspan
- JS
- radius
- json
- jQuery Mobile
- IE
- Chart
- WCF
- JavaScript
- 저장프로시저
- html5
- Ajax
- Style
- Mobile
- 셀렉터
- ASP.NET
- 프로시저
- workbook
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |