<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <style>
    #mask {
      position:absolute;
      z-index:9000;
      background-color:#000;
      display:none;
      left:0;
      top:0;
    }
    .window{
      display: none;
      position:absolute;
      left:100px;
      top:100px;
      z-index:10000;
    }
    </style>
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <script>
    function wrapWindowByMask(){
        //화면의 높이와 너비를 구한다.
        var maskHeight = $(document).height();
        var maskWidth = $(window).width(); 
 
        //마스크의 높이와 너비를 화면 것으로 만들어 전체 화면을 채운다.
        $('#mask').css({'width':maskWidth,'height':maskHeight}); 
 
        //애니메이션 효과 - 일단 1초동안 까맣게 됐다가 80% 불투명도로 간다.
        $('#mask').fadeIn(1000);
        $('#mask').fadeTo("slow",0.8);   
 
        //윈도우 같은 거 띄운다.
        $('.window').show();
    }
 
    $(document).ready(function(){
        //검은 막 띄우기
        $('.openMask').click(function(e){
            e.preventDefault();
            wrapWindowByMask();
        });
 
        //닫기 버튼을 눌렀을 때
        $('.window .close').click(function (e) {
            //링크 기본동작은 작동하지 않도록 한다.
            e.preventDefault();
            $('#mask, .window').hide();
        });      
 
        //검은 막을 눌렀을 때
        $('#mask').click(function () {
            $(this).hide();
            $('.window').hide();
        });
    });
    </script>
</head>
<body>
    <div id="mask"></div>
    <div class="window">
        <input type="button" href="#" class="close" value="나는야 닫기 버튼(.window .close)"/>
    </div>
    <a href="#" class="openMask">검은 막 띄우기</a>
</body>
</html>
 <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%>"/> 

자바스크립트 타이머

JAVASCRIPT 2011. 7. 13. 10:57 Posted by Dayis
 <script type="text/javascript">
  setTimeout("noti_alert()", 300);//0.3초 후 noti_alert함수를 호출
  setInterval(re,3000); //3초 간격으로 re함수실행
 </script>

Flow Chart 작성 프로그램

정보 2011. 6. 1. 18:36 Posted by Dayis
http://live.gnome.org/Dia/Examples

Flow Chart, ERD, UML.. 기타등등 다 작성할 수 있다.
게다가 무료다..^^;

'정보' 카테고리의 다른 글

Grid 기반 웹 페이지 디자인을 위한 CSS Framework  (0) 2012.03.23
실시간 브라우저 점유율  (0) 2010.12.09

자바 반올림

JAVA 2011. 5. 25. 14:04 Posted by Dayis
System.out.println(Math.round(반올림수*반올림자릿수)/반올림자릿수.0);

소수점 첫번째 자리 반올림 : 반올림자릿수=1
소수점 두번째 자리 반올림 : 반올림자릿수=10
소수점 세번째 자리 반올림 : 반올림자릿수=100
소수점 네번째 자리 반올림 : 반올림자릿수=1000
                         .
                         .
                         .

jQuery 페이지내 Anchor로 이동

JAVASCRIPT 2011. 5. 4. 11:24 Posted by Dayis
<html>
<head>
<title>TEST</title>
<script src="/jquery/jquery-1.4.4.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
$(document).ready(function(){
$(".scroll").click(function(event){
//prevent the default action for the click event
event.preventDefault();
//get the full url - like mysitecom/index.htm#home
var full_url = this.href;
//split the url by # and get the anchor target name - home in mysitecom/index.htm#home
var parts = full_url.split("#");
var trgt = parts[1];
//get the top offset of the target anchor
var target_offset = $("#"+trgt).offset();
var target_top = target_offset.top;
//goto that anchor by setting the body scroll top to anchor top
$('html, body').animate({scrollTop:target_top}, 500);
});
});
//-->
</script>
</head>
<body>
<div align="center">
<table border="1" cellspacing="1" width="500" id="table1">
<tr>
<td>
<div align="left" id="top">
<table border="0" cellpadding="0" cellspacing="0" width="100" id="table2">
<tr>
<td><a href="#home" class="scroll">HOME</a></td>
</tr>
<tr>
<td><a href="#about" class="scroll">ABOUT</a></td>
</tr>
<tr>
<td><a href="#contact" class="scroll">CONTACT</a></td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td height="500" valign="top"><span id="home">HOME AREA</span>
<a href="#top" class="scroll">Go Top</a></td>
</tr>
<tr>
<td valign="top" height="700"><span id="about">ABOUT AREA</span>
<a href="#top" class="scroll">Go Top</a></td>
</tr>
<tr>
<td valign="top" height="800"><span id="contact">CONTACT AREA </span>
<a href="#top" class="scroll">Go Top</a></td>
</tr>
</table>
</div>
</body>
</html>

jQuery 스크롤 페이징

JAVASCRIPT 2011. 3. 14. 18:18 Posted by Dayis
mixsh나 twtkr등에서 스크를 마지막에 가면 자동으로 다음 글들을 불러 오게 하는 자료입니다.
JQUERY로 짜여졌고 간단합니다.

엄청나게 간단하네요....;;;

링크에 실제 배포하는 사이트 남겨 두었습니다.

샘플보기(스크롤해서 내려 보세요) :
http://www.webresourcesdepot.com/dnspinger/


구조설명:

컨텐츠 페이지 구조
<div class="wrdLatest" id=1>content</div>
<div class="wrdLatest" id=2>content</div>
<div id="lastPostsLoader"></div>

로딩중 이미지 보여주는 부분과 실제 데이터 가져오는 부분
function lastPostFunc()
{
    $('div#lastPostsLoader').html('<img src="bigLoader.gif">');
    $.post("scroll.asp?action=getLastPosts&lastID=" + $(".wrdLatest:last").attr("id"),   


    function(data){
        if (data != "") {
        $(".wrdLatest:last").after(data);           
        }
        $('div#lastPostsLoader').empty();
    });
};

스크롤 감지하는 부분
$(window).scroll(function(){
        if  ($(window).scrollTop() == $(document).height() - $(window).height()){
          lastPostFunc();
        }
});

'JAVASCRIPT' 카테고리의 다른 글

자바스크립트 타이머  (0) 2011.07.13
jQuery 페이지내 Anchor로 이동  (0) 2011.05.04
jQuery로 ajax실행 중 로딩이미지  (0) 2010.12.22
jQuery.ajax()를 이용한 페이지 실행  (0) 2010.12.21
JQuery select box  (0) 2010.12.20

jQuery로 ajax실행 중 로딩이미지

JAVASCRIPT 2010. 12. 22. 19:15 Posted by Dayis
jQuery로 ajax실행 중 로딩이미지
→ 첨부파일 참조

'JAVASCRIPT' 카테고리의 다른 글

jQuery 페이지내 Anchor로 이동  (0) 2011.05.04
jQuery 스크롤 페이징  (0) 2011.03.14
jQuery.ajax()를 이용한 페이지 실행  (0) 2010.12.21
JQuery select box  (0) 2010.12.20
jquery 오류  (0) 2010.12.09