Jquery Submit 하기

JAVA/Jquery 2015. 9. 22. 17:40

            {

$('form').attr({

action : '../../../../ex/index.jsp',

method : 'post'

}).submit();

}

'JAVA > Jquery' 카테고리의 다른 글

Jquery Ajax 데이터 전송하기(한글깨짐방지)  (0) 2015.10.07
Jquery addClass  (0) 2015.10.02
Jquery select 제어  (0) 2015.08.25
Jquery 새창 화면중앙에 띄우기  (0) 2015.08.19
Jquery onload 사용법  (0) 2015.08.13
블로그 이미지

왕왕왕왕

,

Jquery select 제어

JAVA/Jquery 2015. 8. 25. 16:04

1. jQuery로 선택된 값 읽기

 

$("#selectBox option:selected").val();

$("select[name=name]").val();

 

2. jQuery로 선택된 내용 읽기

 

$("#selectBox option:selected").text();

 

3. 선택된 위치

 

var index = $("#test option").index($("#test option:selected"));

 

4. Add options to the end of a select

 

$("#selectBox").append("<option value='1'>Apples</option>");

$("#selectBox").append("<option value='2'>After Apples</option>");

 

5. Add options to the start of a select

 

$("#selectBox").prepend("<option value='0'>Before Apples</option>");

 

6. Replace all the options with new options

 

$("#selectBox").html("<option value='1'>Some oranges</option><option value='2'>MoreOranges</option>");

 

7. Replace items at a certain index

 

$("#selectBox option:eq(1)").replaceWith("<option value='2'>Someapples</option>");

$("#selectBox option:eq(2)").replaceWith("<option value='3'>Somebananas</option>");

 

8. 지정된 index값으로 select 하기

 

$("#selectBox option:eq(2)").attr("selected", "selected");

 

9. text 값으로 select 하기

 

$("#selectBox").val("Someoranges").attr("selected", "selected");

 

10. value값으로 select 하기

 

$("#selectBox").val("2");

 

11. 지정된 인덱스값의 item 삭제

 

$("#selectBox option:eq(0)").remove();

 

12. 첫번째 item 삭제

 

$("#selectBox option:first").remove();

 

13. 마지막 item 삭제

 

$("#selectBox option:last").remove();

 

14. 선택된 옵션의 text 구하기

 

alert(!$("#selectBox option:selected").text());

 

15. 선택된 옵션의 value 구하기

 

alert(!$("#selectBox option:selected").val());

 

16. 선택된 옵션 index 구하기

 

alert(!$("#selectBox option").index($("#selectBox option:selected")));

 

17. SelecBox 아이템 갯수 구하기

 

alert(!$("#selectBox option").size());

 

18. 선택된 옵션 앞의 아이템 갯수

 

alert(!$("#selectBox option:selected").prevAl!l().size());

 

19. 선택된 옵션 후의 아이템 갯수

 

alert(!$("#selectBox option:selected").nextAll().size());

 

20. Insert an item in after a particular position

 

$("#selectBox option:eq(0)").after("<option value='4'>Somepears</option>");

 

21. Insert an item in before a particular position

 

$("#selectBox option:eq(3)").before("<option value='5'>Someapricots</option>");

 

22. Getting values when item is selected

 

$("#selectBox").change(function(){

           alert(!$(this).val());

           alert(!$(this).children("option:selected").text());

});



출처 : http://blog.daum.net/twinsnow/124

'JAVA > Jquery' 카테고리의 다른 글

Jquery addClass  (0) 2015.10.02
Jquery Submit 하기  (0) 2015.09.22
Jquery 새창 화면중앙에 띄우기  (0) 2015.08.19
Jquery onload 사용법  (0) 2015.08.13
Jquery 텍스트필드 2개 유효성검사  (0) 2015.08.12
블로그 이미지

왕왕왕왕

,

cw=screen.availWidth;     //화면 넓이
ch=screen.availHeight;    //화면 높이

sw=640;    //띄울 창의 넓이
sh=480;    //띄울 창의 높이

ml=(cw-sw)/2;        //가운데 띄우기위한 창의 x위치
mt=(ch-sh)/2;         //가운데 띄우기위한 창의 y위치


test=window.open('http://kr.yahoo.com','tst','width='+sw+',height='+sh+',top='+mt+',left='+ml+',resizable=no,scrollbars=yes');

'JAVA > Jquery' 카테고리의 다른 글

Jquery Submit 하기  (0) 2015.09.22
Jquery select 제어  (0) 2015.08.25
Jquery onload 사용법  (0) 2015.08.13
Jquery 텍스트필드 2개 유효성검사  (0) 2015.08.12
jquery 사용해본 플러그인  (0) 2015.08.09
블로그 이미지

왕왕왕왕

,

jQuery Onload 사용법

페이지가 전부 다운로드 된다음에 실행

$(window).load(function() {

     해당 기능

});

HTML이 준비가 되면 실행

$(document).ready(function() {

     해당 기능

});



'JAVA > Jquery' 카테고리의 다른 글

Jquery select 제어  (0) 2015.08.25
Jquery 새창 화면중앙에 띄우기  (0) 2015.08.19
Jquery 텍스트필드 2개 유효성검사  (0) 2015.08.12
jquery 사용해본 플러그인  (0) 2015.08.09
Juery side메뉴  (0) 2015.08.06
블로그 이미지

왕왕왕왕

,

<!DOCTYPE html>

<html>

<head>

<script

src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

<script>

$(document).ready(function() {

$("#text2,#text1").keyup(function() {

var a = $("[id=text2]").val();

var b = $("[id=text1]").val();


if (a == b) {

$("#a").text("true!");

} else {

$("#a").text("false!");

}

});


});

</script>

</head>

<body>

<input id="text1" type="text">

<input id="text2" type="text">

<p id="a"></p>

</body>

</html>


text1,text2 필드에 텍스트를 쓰기위해 키보드를 눌렀다 땔때마다 실시같으로 유효성검사 함.

'JAVA > Jquery' 카테고리의 다른 글

Jquery 새창 화면중앙에 띄우기  (0) 2015.08.19
Jquery onload 사용법  (0) 2015.08.13
jquery 사용해본 플러그인  (0) 2015.08.09
Juery side메뉴  (0) 2015.08.06
Jqeury 메뉴만들기  (0) 2015.08.05
블로그 이미지

왕왕왕왕

,

이미지 슬라이드

http://workshop.rs/projects/jqfancytransitions/




<script src="./img/jqFancyTransitions.1.8.min.js" type="text/javascript"></script>

<script type="text/javascript">

$(document).ready(function() {

$('#slideshowHolder').jqFancyTransitions({

width : 800,

height : 400,

effect : 'curtain', // wave, zipper, curtain

strips : 7, // number of strips

delay : 5000, // delay between images in ms

stripDelay : 50, // delay beetwen strips in ms

titleOpacity : 0.7, // opacity of title

titleSpeed : 1000, // speed of title appereance in ms

position : 'top', // top, bottom, alternate, curtain

direction : 'fountainAlternate', // left, right, alternate, random, fountain, fountainAlternate

navigation : false, // prev and next navigation buttons

links : false

// show images as links

});

});



<div id='slideshowHolder' style="margin: 0 auto;">

<img src='./img/1.jpg' /> <img src='./img/2.jpg' /> <img

src='./img/3.jpg' /> <img src='./img/4.jpg' /> <img

src='./img/5.jpg' />

</div>


텍스트 변환

http://alvarotrigo.com/funnyText/




<link rel="stylesheet" type="text/css" href="./img/jquery.funnyText.css" />

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>

<script type="text/javascript" src="./img/jquery.funnyText.js"></script>


<script type="text/javascript">

$(document).ready(function() {

$('.mySelector').funnyText({

speed : 1000,

borderColor : 'white',

activeColor : 'black',

color : 'orange',

fontSize : '5em',

direction : 'both'

});

});

</script>


<div class="mySelector" style="margin: 100px auto;" align="center">

Orange Page </div>



'JAVA > Jquery' 카테고리의 다른 글

Jquery onload 사용법  (0) 2015.08.13
Jquery 텍스트필드 2개 유효성검사  (0) 2015.08.12
Juery side메뉴  (0) 2015.08.06
Jqeury 메뉴만들기  (0) 2015.08.05
jqeury plugin 50개  (0) 2015.08.05
블로그 이미지

왕왕왕왕

,

Juery side메뉴

JAVA/Jquery 2015. 8. 6. 10:22

//CDN

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>


//STYLE

#div_side {

position: absolute;

left: -90px;

width: 120px;

height: 400px;

float: left;

}



//JQUERY

<script type="text/javascript">

$(document).ready(function() {

$("#div_side").mouseover(function() {

$(this).stop().animate({

left : "0px"

}, 500);

}).mouseout(function() {

$(this).stop().animate({

left : "-90px"

}, 500);

});

});

</script>




//MENUIMG

<div id="div_side">

<img class="menuicon" src="menuimg/menuicon.png"> <img

class="menuicon" src="menuimg/menuicon.png"> <img

class="menuicon" src="menuimg/menuicon.png"><img

class="menuicon" src="menuimg/menuicon.png"><img

class="menuicon" src="menuimg/menuicon.png"><img

class="menuicon" src="menuimg/menuicon.png"> <img

class="menuicon" src="menuimg/menuicon.png"> <img

class="menuicon" src="menuimg/menuicon.png"> <img

class="menuicon" src="menuimg/menuicon.png"> <img

class="menuicon" src="menuimg/menuicon.png">


</div>

'JAVA > Jquery' 카테고리의 다른 글

Jquery 텍스트필드 2개 유효성검사  (0) 2015.08.12
jquery 사용해본 플러그인  (0) 2015.08.09
Jqeury 메뉴만들기  (0) 2015.08.05
jqeury plugin 50개  (0) 2015.08.05
Jqeury innerfade 슬라이드  (0) 2015.08.05
블로그 이미지

왕왕왕왕

,


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta charset="UTF-8">

<title>Insert title here</title>

<style type="text/css">

.menu {

width: 150px;

height: 50px;

text-align: center;

float: left;

cursor: pointer;

background-color: #74D19D;

}


.menu_on {

background-color: #288C28;

font-weight: bold;

}

</style>

</head>

<body>

<script

src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>


<script type="text/javascript">

$(document).ready(function() {

$(".menu").mouseover(function() {

$(this).addClass("menu_on");

});


$(".menu").mouseout(function() {

$(this).removeClass("menu_on");

});

});

</script>



<div class="menu">메뉴1</div>

<div class="menu">메뉴2</div>

<div class="menu">메뉴3</div>

<div class="menu">메뉴4</div>

<div class="menu">메뉴5</div>



</body>

</html>

'JAVA > Jquery' 카테고리의 다른 글

jquery 사용해본 플러그인  (0) 2015.08.09
Juery side메뉴  (0) 2015.08.06
jqeury plugin 50개  (0) 2015.08.05
Jqeury innerfade 슬라이드  (0) 2015.08.05
Jquery div안에 페이지 불러오기  (2) 2015.08.05
블로그 이미지

왕왕왕왕

,