[jQuery Mobile] mobileinit 정리
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>모바일 연습</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css"/>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script>
$(document).on('mobileinit',function(){
alert('good');
})
</script>
// mobileinit 의 위치가 중요.
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
<body>
<div data-role="page" id="page1">
<div data-role="header" data-position="fixed" id="header">
<h3>moblileinit</h3>
</div><!-- header -->
<div role="main" class="ui-content">
메인 페이지
<a href="#sub" data-role="button">go to subpage</a>
</div><!-- main -->
<div data-role="footer" data-position="fixed">
<h3>footer</h3>
</div><!-- footer -->
</div><!-- page1 -->
<div data-role="page" id="sub">
<div data-role="header" data-position="fixed">
<h3>sub</h3>
</div>
<div role="main" class="ui-content">
서브페이지입니다..
</div>
</div>
</body>
</html>