2009/12/23 17:20
function WindowReset( win /* Window Object */ ){         
 // 새창의 진행상황 체크 완료되면 코드실행
 while(win.document.readyState != 'complete'){} 
 var winBody = win.document.body; 
 // 새창의 사이즈에 더해줄 marginWidth와 marginHeight
 var marginHeight = parseInt(winBody.topMargin)+parseInt(winBody.bottomMargin);
 var marginWidth = parseInt(winBody.leftMargin)+parseInt(winBody.rightMargin);
 // 새창의 사이즈 설정
 var wid = winBody.scrollWidth + (winBody.offsetWidth - winBody.clientWidth) + marginWidth-5;
 var hei = winBody.scrollHeight + (winBody.offsetHeight - winBody.clientHeight) + marginHeight+17;
 // 사이즈 재조정
 win.resizeTo(wid, hei);
}

onload="WindowReset(this)" 추가
저작자 표시 비영리
Posted by 시아레
2009/10/14 15:14

function resizeHeight(fr) {
 fr.setExpression('height',Utotal.document.body.scrollHeight);
 var Dwidth = parseInt(document.body.scrollWidth);
 var Dheight = parseInt(document.body.scrollHeight);
 var divEl = document.createElement("div");
 divEl.style.position = "absolute";
 divEl.style.left = "0px";
 divEl.style.top = "0px";
 divEl.style.width = "100%";
 divEl.style.height = "100%";
 document.body.appendChild(divEl);
 window.resizeBy(Dwidth-divEl.offsetWidth, Dheight-divEl.offsetHeight);
 document.body.removeChild(divEl);
}



<iframe name="Utotal" onload="resizeHeight(this)">
저작자 표시 비영리
Posted by 시아레
2009/10/07 17:29
<script type="text/javascript">
function yesno() {
    var bResult = confirm("예, 아니오를 클릭하세요.");
    if (bResult == true) {
  // 예를 누른 경우
        alert("Yes");
 }
   else {
        // 아니오를 누른 경우
        alert("no");
   }
}
 </script>
저작자 표시 비영리
Posted by 시아레
2009/09/29 19:56

<SCRIPT LANGUAGE="JavaScript">
<!--
var checkflag = "false";  
function check(field) {
 if (checkflag == "false") {  
  for (i = 0; i < field.length; i++)
  {  
   field[i].checked = true;
  }  
  checkflag = "true";  
  }  
 else {  
  for (i = 0; i < field.length; i++)
  {
   field[i].checked = false;
  }
 checkflag = "false";  
 }
}
//-->
</SCRIPT>

<!-- <BODY></BODY> 사이에 넣을것 -->

<INPUT type=checkbox onClick="this.value=check(this.form.chk_to)">            <!-- 모두 체크 박스 -->

<input type="checkbox" name="chk_to" value=""></td>       <!-- 선택될 박스 -->
저작자 표시 비영리
Posted by 시아레
2009/07/31 13:15

[pczone's webprogramming] ::Javascript lecture center
 Javascript site map

JavaScript 강좌센터입니다.

Javascript란?
     
[1]Javascript의 정의 및 장단점
     [2]Javascript는 어디에 어떻게 넣는가?
Javascript의 기초
     
[1]Javascript의 변수와 상수
     [2]Javascript의 변수와 상수2
     [3]Javascript의 상수
     [4]Javascript의 수치 상수
     [5]Javascript의 논리 상수
     [6]Javascript의 주석 삽입
     [7]Javascript를 지원하지 않는 브라우저를 위한 코드의 삽입
대화상자
     
[1]확인 대화상자
     [2]경고 대화상자
     [3]입력 대화상자
연산자
     
[1]연산자에 관하여, 전체 종합
     [2]증감연산자
     [3]비교연산자
     [4]논리연산자
     [5]문자열 연결연산자
     [6]산술연산자의 축약 등
     [7]비트연산자
     [8]비트shift연산자
     [9]조건연산자(3항연산자)
     [10]연산자의 우선순위
조건문
     
[1]조건문이란?
     [2]if...else문
     [3]if...else if문
     [4]switch문
     [5]break명령어
반복문
     
[1]for문
     [2]for문의 실제예
     [3]for문의 실제예2
     [4]중첩 for문의 예
     [5]중첩 for문의 예2
     [6]while문
     [7]do...while문
     [8]continue
     [9]break
함수
     
[1]함수란 무엇인가?
     [2]변수의 통용범위
     [3]인수가 없는 함수
     [4]인수(매개 변수) 있는 함수 중 반환값이 없는 함수
     [5]인수(매개 변수) 있는 함수 중 반환값이 있는 함수
     [6]재귀함수
객체 1
     
[1]객체란 무엇인가?
     [2]새로운 객체의 생성
     [3]this 참조자
     [4]eval()
     [5]parseInt()와 parseFloat()
     [6]string 객체의 메소드
     [7]length 메소드
     [8]indexOf()와 lastIndexOf() 메소드
     [9]substring() 메소드
     [10]charAt() 메소드
     [11]replace() 메소드
     [12]split() 메소드
     [13]string format 메소드
     [14]toUpperCase()와 toLowerCase() 메소드
     [15]Date 객체의 기초
     [16]Date 객체 부분 추출 object
     [17]Date 객체 수정(setting) object
     [18]Date 객체에서 오전/오후 붙이기
     [19]Date 객체로 디지털 시계 만들기
     [20]Boolean() 객체
     [21]Number() 객체
     [22]typeof

객체 2
     
[1]Array 객체의 생성
     [2]Array 객체의 생성 2
     [3]reverse()
     [4]join()
     [5]sort()
     [6]Math
     [7]for...in(객체 제어문)
     [8]코딩의 절약(with문)


JavaScript tip & tech

 출처 : http://tong.nate.com/dorikke/15887145

 
저작자 표시 비영리
Posted by 시아레
2009/07/28 16:18

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
</head>
<script language="javascript">
<!--
function setCookie(name, value, expirehours)
{ 
    var todayDate = new Date(); 
    todayDate.setHours(todayDate.getHours() + expirehours); 
    document.cookie = name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";";
} 
 
function closeWin()
{ 
    if (document.notice_form.chkbox.checked) 
    { 
        setCookie("ncookie", "done", 24); 
    } 
    document.getElementById('k_popup').style.display = "none";
}
-->
</script>
<body>
<div id="k_popup" style="position:absolute; top: 위치; left:위치; height: 크기; width: 크기;">
<form name="notice_form">
<table width="394" border="0" cellspacing="0" cellpadding="0">
<tr> 
    <td colspan="3"><img src=" 통짜이미지.gif" width=" 크기" height=" 크기" border="0" usemap=" 사용시에"></td>
</tr>
<tr> 
    <td height="30" valign="center"><a href="javascript:closeWin()"><img src="창 닫기 이미지.gif" alt="팝업창 닫기" width=" 크기" height=" 크기" border="0"></a></td> 
    <td>오늘하루 이창을 열지 않음</td> 
    <td> 
      <input name="chkbox" type="checkbox" value="checkbox"/> 
    </td> 
  </tr>
</table>
<map name="Map" id="Map"> 
  <area shape="rect" coords="184,283,347,329" href="타킷링크.html">
</map>
</form>
</div> 
 
<script language="javascript">
<!--
cookiedata = document.cookie;
if (cookiedata.indexOf("ncookie=done") < 0)
{ 
    document.getElementById('k_popup').style.display = "block";
}
else
{
document.getElmentById('k_popup').style.display = "none";

}
-->
</script> 
내용은 여기에~~
</body>
</html>

파란색 글씨는 적당하게 수정해 주십시요
그리고 이미지맵은 필요시 사용하십시요.

2번째방법 ================================================================================

<script language="JavaScript">
<!--
function chkCookie(){
 cookiedata = document.cookie;
 if ( cookiedata.indexOf("maindiv=done") < 0 ) {
   document.all['popup'].style.visibility = "visible";
 }
 else {
   document.all['popup'].style.visibility = "hidden";
 }

}

function setCookie( name, value, expiredays ) {
  var todayDate = new Date();
  todayDate.setDate( todayDate.getDate() + expiredays );
  document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

function closeLayer() { 
    setCookie( "maindiv", "done" , 1 );
  document.all['popup'].style.visibility = "hidden";
}
//-->
</script>

 </head>
<body onLoad="chkCookie();">
<div id="popup" style="visibility:hidden">
  html 소스들</div>

저작자 표시 비영리
Posted by 시아레
2009/06/10 12:59

드림위버에서 플래시를 삽입하면 embed테그로 들어갑니다.

이 소스는 저도 어디서 보구 따온건데요...잘 됩니다.

<SCRIPT language=JavaScript>

<!--

document.write('<embed wmode="transparent" src="플래시파일경로" align="left" valing="top" scale=exactfit menu=false quality=high type="application/x-shockwave-flash" width="크기" height="크기"> </embed>');

//-->

</SCRIPT>

그냥 embed테그로 플래시가 삽입되는 부분에 대신 이렇게 넣어주면 레이어가 위로 보이게 됩니다.

scale은 어떤건지 아시죠? 이건 알아서 바꾸시구요..

------------------------------------------------------

윗분 글에 조금 첨삭하자면...
드림위버에서 굳이 오브젝트 태그를 사용하는데는 이유가 있습니다.
따라서 오브젝트 테그를 지워서는 안되겠지요...

<object ....>
  <param name=movie value="플래시파일명">
  <param name=quality value=high>
  <embed src="플래시파일명" .......>
  </embed>
</object>

원래는 이런식으로 드림위버에서 작성이 됩니다.
이대로 사용하면 별 문제 없지만 레이어가 위로 안가지요?
그래서 위에처럼 하시면 되지만...
아래처럼 두군데를 수정하면 원하는 결과를 얻을 수 있습니다.

<object ....>
  <param name=movie value="플래시파일명">
  <param name=wmode value="transparent">  <----- 이거하고,
  <param name=quality value=high>
  <embed src="플래시파일명" ....... wmode="transparent">  <-- 이것입니다.
  </embed>
</object>

꼭 엠베드로만 된다는 것은 아니라는 말이지요...
이경우 오브젝트 태그로도 명령을 내릴 수 있답니다.
Posted by 시아레