본문 바로가기

Web Progreming

(96)
[ PHP ] 이미지 업로드 해서 사이즈 지정 $img = imagecreatefromjpeg($file_names); $width = imageSX($img); $height = imageSY($img); // 이미지 사이즈 지정.. 아래 사이즈 보다 이미지가 작으면 나머지 공간은 검은색으로 모두 채움. $target_width = 800; $target_height = 450; $target_ratio = $target_width / $target_height; $img_ratio = $width / $height; if ($target_ratio > $img_ratio) { $new_height = $target_height; $new_width = $img_ratio * $target_height; } else { $new_height = $..
[ Linux ] 가상호스트 관리 방법?? DocumentRoot /home/계정폴더/public_html ServerName www.주소.com ServerAlias 주소.com SetEnvIfNoCase Request_URI (gif|png|jpg|css|js|bmp|jpeg|swf)$ do_not_log SetEnvIf Remote_Addr ^아이피 do_not_log ErrorLog /home/apache_log/주소.com-error_log CustomLog /home/apache_log/ 주소.com-access_log combined 리눅스는 참 해줄게 많구나아... 언제 해보나;;;
[ 정규식 ] 모든 html 태그를 찾는 정규 표현식 모든 html 태그를 찾는 정규 표현식. var objReg = new RegExp(); objReg= /[]*[>]/gi;
[ jQuery ] 이미지 센타로 오게하는... var left = ( $(window).scrollLeft() + ($(window).width() - $layerPopupObj.width()) / 2 ); var top = ( $(window).scrollTop() + ($(window).height() - $layerPopupObj.height()) / 2 ); $layerPopupObj.css({'left':left,'top':top, 'position':'absolute'});
[ jquery ] 마우스 따라 다니기 $('#img_pop').mousemove(function(e) { //var position = $(this).position(); var offset = $(this).offset(); var x = e.pageX - (offset.left); var y = e.pageY - (offset.top); $('#layer_img_pop').show().css({'left': e.pageX+16, 'top': e.pageY+16}); }); 어찌 하다 보니 아래 처럼 바뀌었네... 아래것은 브라우져 창 크기에 따라 위치가 이동하는 이미지 팝업니다. div 창이 보여질때 마다 이미지 값을 불러오는거라 그런지 느리다.. $('.img_pop').mousemove(function(e) { $('#org_img_..
[ HTML ] iframe 자동 높이 조절 $(document).ready(function(){ $("#board_IFM").load(function(){ alert($(this.contentDocument).find('body').height()); $("#iframe_src").attr('value',$(this.contentDocument).find('body').height()); var iHeight=($(this.contentDocument).find('body').height()); $(this).height(iHeight); }) }) 아.. 삽질 좀 했네.. 잘 써먹어야 할텐데..ㅋㅋ
[ PHP ] class.upload.php class.upload.php samples, a files uploading and images manipulation PHP classThese images are created by the class.upload.php test suite, that you can download part of the package. original file image/png - 150 x 100 - 35.25KB width 50, height auto image/png - 50 x 33 - 4.75KB $foo->image_resize = true; $foo->image_ratio_y = true; $foo->image_x = 50;height 50, width auto image/png - 75 x 50 - 10..
[ JavaScript ] 브라우저 체크 function whichBrs() { var agt=navigator.userAgent.toLowerCase(); if (agt.indexOf("opera") != -1) return 'Opera'; if (agt.indexOf("staroffice") != -1) return 'Star Office'; if (agt.indexOf("webtv") != -1) return 'WebTV'; if (agt.indexOf("beonex") != -1) return 'Beonex'; if (agt.indexOf("chimera") != -1) return 'Chimera'; if (agt.indexOf("netpositive") != -1) return 'NetPositive'; if (agt.indexOf(..