Latest web development tutorials

jQuery Mobile Events

Incident response action = all visitors to the different pages.


jQuery Mobile Events

In jQuery Mobile you can use any standard jQuery event .

In addition, jQuery Mobile also provides an event browser for mobile terminals:

  • Touch event - triggered when the user touches the screen
  • Slip event - triggered when the user up and down the slide
  • Location event - triggered when the device is flipped horizontally or vertically
  • Fires when the page display, hide, create, load or not loading - Page Events

Initialize jQuery Mobile Event

When we learned by studying jQuery $ (document) .ready () to make your jQuery code in the script begins execution after loading is complete DOM element:

jQuery document ready event

<script>
$(document).ready(function(){

// 编写jQuery方法...

});
</script>

try it"

However, jQuery Mobile, use pageinit event to set the code in the script executed after the DOM element is loaded, it is to load and execute the script to create, you need to bind in any event pageinit new page.

The second parameter ( "#pageone") for the specified event page id:

jQuery Mobile pagecreate event

<script>
$(document).on("pagecreate","#pageone",function(){

// jQuery 事件...

});
</script>

try it"

lamp Note: jQuery on () method is used to bind events to the selected element.

The next section we will be more details jQuery Mobile event.