본문 바로가기

IT 스터디/HTML,CSS,jQuery4

text area or text의 커서 위치 변경 출처 : http://blog.outsider.ne.kr/556 엘레먼트에 입력된 텍스트에 대해서 커서를 이동시킬 수 있는 소스코드입니다. 이 소스코드를 통해서 커서를 이동시킬 수 있고, 특정 구간의 문자열을 선택(혹은 블록-Block)할 수 있습니다. 아래 소스코드는 jQuery 객체에 selectRange() 라는 메소드를 추가하여 사용하는 방식입니다. $.fn.selectRange = function(start, end) { return this.each(function() { if(this.setSelectionRange) { this.focus(); this.setSelectionRange(start, end); } else if(this.createTextRange) { var range = .. 2016. 3. 11.
부모창의 데이터 업데이트 하기 jQuery 자식 팝업 창에서 부모창 컨트롤1$(opener.document).find("#Form").attr("action","index.do").submit();자식창 -> 부모창으로 값 전달하기1-opener.document.getElementById("id").value="value"; //dom 객체로 제어2$("#id",opener.document).val("value"); // jQuery 방식 13$("input[name=imgFile]", parent.document.body).val() // 방식 24$(opener.document).find("#id").val("value"); //방식 35 6- opener.location.href="javascript:fun();"; //일반적인.. 2016. 3. 11.
jQuery Mobile 스크롤러 이벤트, 마지막에 부분에 닿았을때 서버에서 데이터 가져오기 $(document).on("pagecreate","#page",function(){ $(document).on("scrollstop",function(){ if($(document).height() > $(window).height()) { if($(window).scrollTop() == $(document).height() - $(window).height()){ var param={flag:"bookgrid"}; $.post("/Finder/gridpage/bringgridpage.do",param,getMoreGridContentResult,"json"); } } }); }); function getMoreGridContentResult(jsonInfor){ var gl=jsonInfor.gri.. 2015. 6. 12.
모바일 크기에 맞게 이미지 조정 완벽한 반응형 웹을 위한 시각적 요소의 크기 자동 조절 방법 위에서 언급했듯이 이미지와 동영상은 최대 해상도가 정해져 있습니다. 따라서 반응형 웹에서 이러한 것들을 출력할 때에는 최대 해상도를 미리 정한 후, 정해진 수치 이상으로 해상도가 벗어나지 않도록 해야 합니다. 언뜻 보면 매우 어려운 작업 같지만 의외로 이 작업은 매우 쉽습니다. 여러분은 CSS의 max-width 속성과 max-height 속성에 대해서 알고 있습니까? 이 속성은 최대 넓이와 최대 높이를 정의하는 CSS 속성입니다. 이 속성을 이용하면 이미지와 동영상의 최대 해상도를 미리 정해 놓을 수 있습니다. 그리고 이 속성이 지정된 객체에 width 속성과 height 속성 모두를 100%로 정의하면 해상도에 따라 자동으로 크기가 조절되는.. 2015. 6. 10.