본문 바로가기

반응형

Story/Jquery

javascript 줄바꿈 처리 nl2br javascript 를 사용하다가 줄바꿈에 대한처리가 필요할때가 있다. php 의 nl2br 과 같은 함수의 기능이 필요할때는 다음과같이 사용할수있다. String.prototype.nl2br = function() { return this.replace(/\n/g, " "); } 또는 jQuery.nl2br = function(varTest){ return varTest.replace(/(\r\n|\n\r|\r|\n)/g, " "); }; 출처 http://stackoverflow.com/questions/2919337/jquery-convert-line-breaks-to-br-nl2br-equivalent 더보기
jQuery Selectbox plugin 출처 : http://www.bulgaria-web-developers.com/projects/javascript/selectbox/ 소스 : 더보기
반응형 또는 모바일 페이지에 이미지맵(image map) 사용하기 이미지맵을 사용하여 홈페이지를 제작하는대 반응형으로 coding 하는경우 문제가 생깁니다. 원하는 영역의 크기가 변하기때문이죠. 이럴때 jquery 를 이용해서 해결 할 수 있습니다. jQuery RWD Image Maps Allows image maps to be used in a responsive design by recalculating the area coordinates to match the actual image size on load and window.resize Usage:•If possible, add correct, unitless width and height attributes to your image map images. You can override these in CSS .. 더보기
Cross Domain XML using JQuery 크로스도메인에서 jquey 로 xml 사용하기 jquery 로 xml rss 등을 파싱해서 사용하는건 많이 있지만 외부사이트에 xml 이나 rss 사용시 문제가 발생한다. 이 문제에 대해 검색하던 중 좋은 자료가 있어 남겨놓는다. http://www.isgoodstuff.com/2012/07/22/cross-domain-xml-using-jquery/ “How do you parse a cross domain xml, using jquery ajax?” Many would have answered try “jsonp”, which is a json like cross domain solution then, later you tried it and the xml returned is giving you an error of illegal token. .. 더보기
jquery json 사용시 공백문제 jquery json 사용시 공백이 "+" 로 나오는 문제가 발생한다. json data 생성시 urlencode 대신에 rawurlencode 을 사용하면 된다. 더보기
Jquery fancybox 사용시 iframe type 에서 post 로 값 넘기기 fancybox 사용시 iframe type 으로 사용하면 해당 href 에 있는 주소로 get 방식으로 페이지를 불러온다. 하지만 post 방식으로 값을 넘겨서 페이지를 불러와야할 경우가 발생했는대 구글링을 통해서 방법을 찾을수있었다. 출처는 http://stackoverflow.com/questions/14316054/post-preview-passing-data-with-ajax-and-fancybox 방법은 POST preview with ajax API option REF: http://stackoverflow.com/q/14316054/1055987picssel.com /> Name: Password: Preview NOTE: This DEMO is for Fancybox v2.1.3+ 데모 .. 더보기
jQuery Timer jQuery Timer jQuery Timer adds the class $.timer(). $.timer() $.timer( [ action ] , [ time ], [ autostart ] ) action A Function to be called by the timer. time A Number determining how long between actions in milliseconds. autostart A Boolean indicating whether to start the timer. Defaults to false. Usage var timer = $.timer(function() { alert('This message was sent by a timer.'); }); timer.set(.. 더보기
글쓸때 tag 입력받기 게시판이나 블로그 등에 글을쓸때 tag 들을 입력하는대 임의로 , 같은 구분자를 넣기도 하지만 공백등으로 자동으로 나누기도 한다. 이럴때 사용하면 유용한 사이트가 있어서 주소를 남겨둔다. jQuery Tagit Documentation Page http://webspirited.com/tagit/ 더보기
Top 10 JQuery Tooltip Plugins! 1. Tooltipster This jQuery plugin can be used to create semantic and modern tooltips using CSS. 2. Toolbar.js This one has the capability to produce tooltip styled toolbards quickly. It can be used for websites and web applications. 3. Grumble js This plugin gives you special tooltips without the regular limitations. 4. Progression.js If tips about an active form field is what you are looking fo.. 더보기
jQuery Plugin For Auto Resizing iFrame - iFrame Resizer 아이프레임 리사이즈 아이프레임으로 컨텐츠를 관리할때 아이프레임 사이즈가 수시로 변하기때문에 resize를 해주어야 하는대 구글링을 통해서 쓸만한 jQuery Plugin 을 찾았다. 부모창에는 아이프레임에 들어가는 페이지에는 하단부분에 을 넣어준다. 출처 : http://www.jqueryscript.net/layout/jQuery-Plugin-For-Auto-Resizing-iFrame-iFrame-Resizer.html 더보기

반응형