<div id="chapter_select"></div> 레이어창을 브라우져 화면가운데 띄우는 자바스크립트 예제입니다. jQuery로 작성하였습니다. 

function fnOpenChapter() {
var obj = $('#chapter_select');
var iHeight = (document.body.clientHeight / 2) - obj.height() / 2 + document.body.scrollTop;
var iWidth = (document.body.clientWidth / 2) - obj.width() / 2 + document.body.scrollLeft;

obj.css({
position: 'absolute'
, display:'block'
, top: iHeight
, left: iWidth
});
}


여기서 주의할 것은 document.body.scrollTop 와 document.body.scrollLeft 입니다. 화면에 스크롤이 생겨서 스크롤 위치가 변경될 경우에는 스크롤 값도 레이어 위치에 영향을 주므로 해당 값도 확인해서 레이어 위치값에 반영합니다.

Join절 Update

MS-SQL 2011. 11. 3. 10:54 Posted by Dayis
UPDATE T1 SET
T1.TITLE='TITLE'
,T1.MESSAGE='MESSAGE'
FROM
TABLE T1 INNER JOIN TABLE=T2 ON T1.CODE=T2.CODE
WHERE
T1.LAGNUAGE='KR' AND T2.SITE='JP'

'MS-SQL' 카테고리의 다른 글

MS-SQL 인덱스 조각모음  (0) 2013.01.03
MS-SQL 전체 테이블 크기 조회 (용량순, 테이블이름순)  (0) 2012.08.16
declare cursor  (0) 2012.06.12
join, update  (0) 2010.11.22
프로시져 사용시 ADO타입  (0) 2010.10.06
$(document).ready(function() {
       var WidthMax ; //브라우저 넓이에 따라 이미지 크기를 달리한다.
WidthMax = ($(window).width()*0.63); //이미지 넓이를 브라우저의 63% 크기로 지정

$(".entry").each(function() {
var imgwidth = $(this).attr("width");
if (imgwidth > WidthMax) 
{
var imgheight = $(this).attr("height");
var ratio = imgwidth/imgheight;
var newHeight = Math.round(WidthMax/ratio);
$(this).attr({width:WidthMax, height:newHeight});
}
});
});

이미지의 width값이 반드시 있어야 한다.
<img src="<%=ImageURL%>" class="entry" width="<%=ImageSize%>"/>