1
2
3
4
5
6
7
jQuery(document).bind("mobileinit", function(){
    // 페이지 이동 시 back 버튼 표시 유무(1.7 버전부터는 default 값이 false 인듯)
    jQuery.mobile.page.prototype.options.addBackBtn = true;
     
    // 페이지 이동시 이동효과(기본값 fade | fade, pop, flip, turn, low, slidefade, slid, slideup, sliddown, none)
    jQuery.mobile.defaultPageTransition = "slide";
});
$.mobile.changePage(to, options)
to (string or object, required)
options (object, optional)

ex) (string, options)
$.mobile.changePage( "../alerts/confirm.html", {
transition: "pop", // 이동효과(fade, pop, flip, turn, low, slidefade, slid, slideup, sliddown, none)
reverse: false, // back button 클릭시 이전 페이지 이동 여부(default:false)
changeHash: false // hash 데이터 업데이트 여부
});



jQuery ui.sortable 기본 plugin 을 이용한 영역 드래그 앤 드롭 예제


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
32
33
34
35
36
37
38
39
40
41
<script>
function remove(index){
    var btr = $("#tb > tbody > tr");
    $(btr[index]).remove();
}
function append(){
    $("#tb > tbody").append("<tr><td>a</td><td>b</td><td>c</td></tr>");
}
function getRowCount(){
    alert( $("#tb tr").length );
}
function getCellCount(rowIndex){
    alert( $($("#tb tr")[rowIndex]).children("td, th").length );
}
</script>
 
<button onclick="append()">추가</button>
<button onclick="remove(0)">삭제</button>
<button onclick="getRowCount()">rowCount</button>
<button onclick="getCellCount(2)">cellCount</button>
 
<table id="tb" border="1">
<thead>
<tr bgcolor="#CCCCCC">
    <th width="100" scope="col">a</th>
    <th width="100">b</th>
    <th width="100">c</th>
</tr>
</thead>
<tbody>
<tr>
    <td>1</td>
    <td>2</td>
    <td>3</td>
</tr>
<tr>
    <td>4</td>
    <td colspan="2">5</td>
</tr>
</tbody>
</table>
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
32
33
34
35
36
37
38
39
<select id="s">
    <option value="1">a</option>
    <option value="2" selected="">b</option>
</select>
<button onclick="setSelected()">setSelected</button>
 
 
 
 
 
 
<input type="checkbox" name="c" value="1">a
<input type="checkbox" name="c" value="2" checked="">b
<button onclick="setChecked()">setChecked</button>
 
<script>
    function setSelected(){
        $("#s > option[value=1]").attr("selected", "true");
    }
    function setChecked(){
        $("input[name=c]").filter('input[value=1]').attr("checked", "checked");
    }
</script>
 
 
 
 
 
 
<form>
    <input type="radio" name="r" value="1">
    <input type="radio" name="r" value="2">
    <button onclick="setChecked()">getRadio</button>
</form>
<script>
    function getRadio(){
            alert( jQuery("form input:radio[name='r']:checked").val() );
    }
</script>
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
<script>
$(document).ready(function(){
    $("#send").click(function(){
        $("div div").each(function(index, element){
            alert(index + "\n\n" + element.innerHTML + "\n\n" + $(this).html());
        });
    });
 
});
</script>
<div>
    <table>
    <tbody><tr>
        <td><div id="td1">td1 index0</div></td>
    </tr>
    <tr>
        <td><div id="td1">td1 index1</div></td>
    </tr>
    <tr>
        <td><div id="td1">td1 index2</div></td>
    </tr>
    </tbody></table>
</div>
 
<input type="button" id="send" value="확인">

+ Recent posts