Presentation is loading. Please wait.

Presentation is loading. Please wait.

Method, Event, Layout API. $.mobile.changePage //transition to the "confirm" page with a "pop" transition without tracking it in history $.mobile.changePage(

Similar presentations


Presentation on theme: "Method, Event, Layout API. $.mobile.changePage //transition to the "confirm" page with a "pop" transition without tracking it in history $.mobile.changePage("— Presentation transcript:

1 Method, Event, Layout API

2 $.mobile.changePage //transition to the "confirm" page with a "pop" transition without tracking it in history $.mobile.changePage( "../alerts/confirm.html", { transition: "pop", reverse: false, changeHash: false });

3 $.mobile.loadPage //load a "search results" page, using data from a form with an ID of "search" $.mobile.loadPage( "searchresults.php", { type: "post", data: $("form#search").serialize() });

4 $.mobile.showPageLoadingMsg //use theme swatch "b", a custom message, and no spinner $.mobile.showPageLoadingMsg("b", "This is only a test", true);

5 $.mobile.hidePageLoadingMsg //hide the page loader $.mobile.hidePageLoadingMsg();

6 $.mobile.silentScroll //scroll to Y 100px $.mobile.silentScroll(100);

7 Event  tap  taphold  swip  swipleft  swipright

8 swipe 이벤트 페이지 전환 $(":jqmData(role='page')").live("swipeleft",function(){ // 현재 페이지의 id 에서 페이지 번호를 알아낸 다음 1 을 더합니다. var nextPage = parseInt($(this).attr("id").split("page")[1])+1; if(nextPage===4) nextPage=1; // 페이지를 전환합니다. $.mobile.changePage("#page"+nextPage,"slide"); }); $(":jqmData(role='page')").live("swiperight",function(){ // 현재 페이지의 id 에서 페이지 번호를 알아낸 다음 1 을 뺍니다. var nextPage = parseInt($(this).attr("id").split("page")[1])-1; if(nextPage===0)nextPage=3; // 페이지를 전환합니다. $.mobile.changePage("#page"+nextPage,{transition:"slide",reverse :true}); })

9 초기화 이벤트  pagebeforecreate  pagecreate 페이지 보이기 숨기기 이벤트  pagebeforehide  pagebeforeshow  pagehide  pageshow

10 방향 전환 Event $(window).bind('orientationchange',function(event) { if (event.orientation == "portrait") { // 세로 } else if (event.orientation == "landscape") { // 가로 } });

11 가상 마우스 Event  vmouseover == touch  vmousedown == touchstart  vmousemove == touchmove  vmouseup == touchend  vclick == touchend  vmousecancel == touchcancel

12 반응형 Layout Event  css 선택자 (.portrait,.landscape )  방향 전환 이벤트 (orientationchange)

13 화면크기 중단점 클래스  320px, 480px, 768px, 1024px  중단점 추가 $.mobile.addResolutionBreakpoints(400);

14 미디어 쿼리  장치의 특정 상세를 파악하는데 유용  $.mobile.media(“-webkit-min-device- pixel-ratio: 2”);

15 4. jQuery Mobile 설정  When jQuery Mobile starts, it triggers a mobileinit event on the document object.  몇가지 설정 옵션을 바꿔서 모든 페이지의 동작방 식을 변경  $(window).bind(‘mobileinit', function() { //apply overrides here });

16 ns string, default: ""  커스텀데이터 속성에 적용할 네임스페이스.ui-mobile [data-mynamespace-role=page],.ui-mobile [data-mynamespace-role=dialog],

17 autoInitializePage boolean, default: true  When the DOM is ready, the framework should automatically call $.mobile.initializePage.  $(window).bind(‘mobileinit', function() { $.extend( $.mobile, { initializePage : “false” });

18 subPageUrlKey string, default: "ui-page"  서브페이지를 참조할 때 URL 에 쓸 문자열  $(window).bind(‘mobileinit', function() { $.extend( $.mobile, { subPageUrlKey : “http://spaceii.com/index.html&ui-page= #page1” });

19 activePageClass string, default: "ui-page-active"  현재 보이는 페이지에 적용될 CSS 스타일  $(window).bind(‘mobileinit', function() { $.extend( $.mobile, { activePageClass : “screen” });

20 activeBtnClass string, default: "ui-btn-active"  활성화된 상태의 버튼에 적용될 CSS 스타일  $(window).bind(‘mobileinit', function() { $.extend( $.mobile, { activePageClass : “button” });

21 ajaxEnabled boolean, default: true  비동기적 기능인 Ajax 폼처리, Ajax 링크처리, URL 해시관리를 켜거나 끔  $(window).bind(‘mobileinit', function() { $.extend( $.mobile, { ajaxEnabled : “false” });

22 linkBindingEnabled boolean, default: true  비동기적 기능인 Ajax 폼처리, Ajax 링크처리, URL 해시관리를 켜거나 끔  $(window).bind(‘mobileinit', function() { $.extend( $.mobile, { linkBindingEnabled : “false” });

23 hashListeningEnabled boolean, default: true  해시관리를 켜거나 끔  $(window).bind(‘mobileinit', function() { $.extend( $.mobile, { linkBindingEnabled : “false” });

24 pushStateEnabled boolean, default: true  Enhancement to use history.replaceState in supported browsers, to convert the hash-based Ajax URL into the full document path.  $(window).bind(‘mobileinit', function() { $.extend( $.mobile, { linkBindingEnabled : “false” });

25 defaultDialogTransition string, default: 'pop'  Set the default transition for page changes that use Ajax  $(window).bind(‘mobileinit', function() { $.extend( $.mobile, { linkBindingEnabled : “none” });

26 defaultPageTransition string, default: 'fade'  Set the default transition for page changes that use Ajax  $(window).bind(‘mobileinit', function() { $.extend( $.mobile, { linkBindingEnabled : “slide” });

27 touchOverflowEnabled boolean, default: false  Enable smoother page transitions and true fixed toolbars in devices that support both the overflow  $(window).bind(‘mobileinit', function() { $.extend( $.mobile, { linkBindingEnabled : “slide” });

28 minScrollBack string, default: 250  Minimum scroll distance that will be remembered when returning to a page.  $(window).bind(‘mobileinit', function() { $.extend( $.mobile, { linkBindingEnabled : “slide” });

29 loadingMessage string, default: "loading"  Set the text that appears when a page is loading. If set to false, the message will not appear at all.  $(window).bind(‘mobileinit', function() { $.extend( $.mobile, { linkBindingEnabled : “slide” });

30 pageLoadErrorMessage string, default: "Error Loading Page"  Set the text that appears when a page fails to load through Ajax.  $(window).bind(‘mobileinit', function() { $.extend( $.mobile, { linkBindingEnabled : “slide” });


Download ppt "Method, Event, Layout API. $.mobile.changePage //transition to the "confirm" page with a "pop" transition without tracking it in history $.mobile.changePage("

Similar presentations


Ads by Google