반응형

jQuery 15

jQuery <select>의 <option>변경하기 + 멀티 콤보박스(Multi-Select Combo box)

보통 웹에서 2개 이상의 (드롭다운 박스)을 사용해서, 다른 하나의 의 에 대해서 변경이 필요한 경우가 생깁니다. 해당 부분의 방법을 처리를 위해서 jQuery에서 다음과 같이 사용하면 됩니다. SYNTAX $('#아이디').html('New'); // 다름과 같이 사용하면, 새로운 값으로 replace됩니다. 여러개의 을 넣는 예제 O1 O1 $newoptions = "NewO1 NewO1"; $('select#needSelect').html($newoptions); 여기서 셀럭터를 아이디값만 사용해서 $('#needSelect').html($newoptions); 이렇게 해도 됩니다. 참고: Jquery Replace Select Options 또다른 방법은 (추천하는 방법은 아님) 참고: How t..

Web/jQuery 2019.09.26

jQuery Mobile 의 <textarea> 높이 (height) rows 값 적용되게 설정하기

jQuery Mobile에서 태그를 사용해서 rows="2"등을 줬을때, 제대로 높이 (height)가 적용되지 않습니다. rows값의 높이 (height)를 적용하기 위해서는 setTime Javascript로 딜레이를 줘서, jQuery Mobile에서 가지고 있는 의 css 높이값을 수정해준다. HTML 예제 5 rows: 10 rows: 15 rows: Javascritp + jQuery setTimeout(function () { //$('.foo').addClass('bar'); $('.foo').css({ 'height': 'auto' }); }, 100); Demo 사이트: http://jsfiddle.net/Palestinian/XXEfV/ 출처: https://stackoverflow...

Web/jQuery 2019.06.12

jQuery 특정 id 객체로 화면 스크롤링 해서 이동하기

jQuery 특정 id 객체로 화면 스크롤링 해서 이동하고 싶을때가 있습니다. 예전에는 #Name 태그를 사용했는데. jQuery에서 Id 값을 줘서, 해당 위치로 애니메이션 스크롤링을 할 수가 있습니다. $("#button").click(function() { $('html, body').animate({ scrollTop: $("#elementtoScrollToID").offset().top }, 2000); }); 자연스럽게 (smooth하게) 이동하기 $("#button").click(function() { $('html, body').animate({ scrollTop: $("#myDiv").offset().top }, 2000); }); Scrolling되면서, 투명도 변화시키기 01 $(wi..

Web/jQuery 2018.06.02

jQuery Mobile 버튼 색상변경과 + 상단 Title의 길이 늘리기

== 버튼 색상 바꾸기 == jQuery Mobile 에서 버튼의 색상을 바꾸고 싶을때가 있습니다. 상단의 Bar의 같은 경우 class="ui-header ui-bar-b" (ui-bar-a) / data-theme="b"와 같이 테마가 변경이 가능합니다. 버튼은 해당 테마를 주는 방법을 찾지 못해서, 변경하는 방법을 찾아보니. style을 이용해서 수정하라고 하네요. color와 background-color를 이용해서 변견한 부분 Search [그림1. background-color: darkorchid; color:white; 효과] 참고: https://stackoverflow.com/questions/9748337/jquery-mobile-button-background-color == 상단 ..

Web/jQuery 2018.05.25

jQuery Mobile의 뒤로 가기 오류가 생긴다면.

jQuery Mobile에서 이전 페이지(previous page)로 가는 Back 버튼을 넣을 때, 여러가지 방법이 있는데요. 종종, Back 이렇게 할 경우가 있는데요. 해당방법을 이용하면, 종종 Mobile에서 오작동이 일어날때가 있곤한다. Javascript로 하는 또다른 방법은 $.mobile.back() 을 사용하는 것입니다.Back jQuery Mobile에서 Back버튼에 대해서,추천해주는 방법 data-rel="back"를 이용하길 권해 준다. Back개인적으로 항상 history.back를 썼는데, 다 변경해야 할 것 같다. ㅠ_ㅠ 참조: https://stackoverflow.com/questions/5740934/jquery-mobile-back-button참조속의 링크: Anato..

Web/jQuery 2018.05.25

[jQuery] .hide(), .show()처럼, visibility:hidden으로 설정하기

jQuery에서 .hide(), .show()은 display:noe으로 셋팅한다. 해당 셋팅을 visibility:hidden와 같은 설정하기 You could make your own plugins.jQuery.fn.visible = function() { return this.css('visibility', 'visible'); }; jQuery.fn.invisible = function() { return this.css('visibility', 'hidden'); }; jQuery.fn.visibilityToggle = function() { return this.css('visibility', function(i, visibility) { return (visibility == 'visible..

Web/jQuery 2014.01.14

[jQuery] Element Properties Modify 명령

each() 집합 elements를 수정each(iterator)$('img').each(function(n){this.alt='ID가 '+this.id+'인 image['+n+']이다';});또 다른 예제var allAlts = new Array();$('img').each(function(){allAlts.push(this.alt);}); 단일 properties값 받기var altValue = s('#myImage')[0]; Attribute값 get, set attr(name) : name attribute의 value 가져오기attr(name, value) : name attribute에 value값 set하기attr(attributes)매개변수: attributes (Object) 확장 집합의..

Web/jQuery 2013.10.08

jquery 의 innerHeight()함수 높이 HTML document 부분만

현재 $(window).innerHeight()를 사용하면, 사이즈가 틀리게 나온다. 그건 bookmark등의 높이가 height값에 제외해서 그렇다고 한다. $(window).height(); // returns height of browser viewport $(document).height(); // returns height of HTML document 다음과 같이 height값은 document를 사용하면 된다. 참고: http://stackoverflow.com/questions/3791049/javascript-jquery-how-do-i-get-the-inner-window-height

Web/Javascript 2013.10.01

[jquery] $(this) selector and child element?

현재 $(this)의 자식 객체 선택하기일 때에, div태그를 클릭 할 때,img 객체를 seletor하고 싶을 때, 방법 1)jQuery("img", this);방법 2)jQuery(this).find("img");방법 3)jQuery(this).children("img"); 가장 좋은 방법으로는 "방법 1)"이 맘에 든다. jQuery(자식객체, 부모객체) 방법 1 예제 > div을 클릭하면, img의 src값이 alert 창으로 뜬다. 참조: http://stackoverflow.com/questions/306583/this-selector-and-children

Web/Javascript 2013.06.12

jquery 를 이용한, onload 처리효과

일단 jQuery의 기본 셀렉트 개념을 이해하시고 시작하면 아래 예제를 이해하는데 많은 도움이 됩니다. 아래주소는 TAEYO.NET 의 태요님의 기본 셀렉트 강좌입니다. http://www.taeyo.pe.kr/Columns/View.aspx?SEQ=354&PSEQ=29&IDX=1 주소출처 : http://www.taeyo.pe.kr/ 아래는 jQuery를 이용한 onload 효과를 주는 방법입니다. jQuery를 이용해 아래와 같이 onload 효과를 줄수 있습니다. 기본적인 구조는 다음과 같습니다. $(document).ready(function(){ alert('테스트'); }); 위와 같은 코드는 아래와 같이 간소화가 가능합니다. $(function(){ alert(테스트); }); 위의 코드는 ..

Web/Javascript 2010.12.08

[오픈소스][펌]20 Amazing jQuery Plugins and 65 Excellent jQuery Resources

출처 http://sosfarm.blogspot.com/2008/07/20-amazing-jquery-plugins-and-65.html taken from speckyboy 1. jSocialize - jQuery version of mooSocialize! Description: This is the jQuery version of the phenomenal mooSocialize (which was, obviously, built on the mooTools framework). jSocialize allows you to integrate your bookmarks for every post on your blog, website etc. By clicking the jSocialize butto..

IT공부방 2008.11.27
1
반응형