음......귀찮은 작업? 뭐 보면 알겠지만...

간단한 기본 레이아웃 페이지 설정을 해주면
자동으로 스타일과 레이어를 이용해 원하는 레이아웃을 받을수 있다....뭐 직접 보면..-0-;;;;



http://www.inknoise.com/experimental/layoutomatic.php
2007/09/01 23:01 2007/09/01 23:01

어디서 복사해논건지...-0-;;;;;
뭐 쓸때마다 만들기도 찾기도 귀찮고......해서 올려두는,......

=========================================



/*****
  * 사업자등록번호 체크
  * return : boolean
  * ex) 111-11-11111
  *****/
function check_worknum(resno) {
    fmt = /^\\d{3}-\\d{2}-\\d{5}$/;
    if(!fmt.test(resno)) return false;
    // Check Sum 코드의 유효성 검사


    buf = new Array(10);
    for (i = 0; i < 3; i++) buf[i] = parseInt(resno.charAt(i));
    for (i = 3; i < 5; i++) buf[i] = parseInt(resno.charAt(i + 1));
    for (i = 5; i < 10; i++) buf[i] = parseInt(resno.charAt(i + 2));
    multipliers = [1,3,7,1,3,7,1,3,5,1];
    for (i = 0, sum = 0; i < 10; i++){
        if(i==0 || i==9){
            sum += (buf[i] * multipliers[i]);
        }else{
            sum += (buf[i] * multipliers[i]%10);
            if(i==8) sum += Math.floor(buf[i] * multipliers[i] / 10);
        }
    }
    if (sum % 10 != 0) return false;
    return true;
}
 


 /*****
  * 주민등록번호 체크
  * return : boolean
  * ex) 111111-1111111
  * TODO : 주민등록번호 뒷자리 첫번째 자리에 7,8 로 시작하는 주민등록 번호가 있다. 이것은 귀화한 사람에게 발급되는 번호라고 한다
  *    할 수 있다면 체크했으면 좋겠는데 아직은 위의 번호를 가진 사람도 보지 못했거니와 유효성도 같은 방식으로 해야 하는지 알지 못하겠다.
  *****/
function check_regnum(resno){
 
    // 주민번호의 형태와 7번째 자리(성별) 유효성 검사
    fmt = /^\\d{6}-[1234]\\d{6}$/;
    if(!fmt.test(resno)) return false;


 
    // 날짜 유효성 검사
    birthYear   = (resno.charAt(7) <= \"2\") ? \"19\" : \"20\";
    birthYear  += resno.substr(0, 2);
    birthMonth = resno.substr(2, 2) - 1;
    birthDate    = resno.substr(4, 2);
    birth          = new Date(birthYear, birthMonth, birthDate);
 
    if(birth.getYear() % 100 != resno.substr(0, 2) || birth.getMonth() != birthMonth || birth.getDate() != birthDate) return false;
 
    // Check Sum 코드의 유효성 검사
    buf = new Array(13);
    for (i = 0; i < 6; i++) buf[i] = parseInt(resno.charAt(i));
    for (i = 6; i < 13; i++) buf[i] = parseInt(resno.charAt(i + 1));
 
    multipliers = [2,3,4,5,6,7,8,9,2,3,4,5];
    for (i = 0, sum = 0; i < 12; i++) sum += (buf[i] *= multipliers[i]);
 
    if((11 - (sum % 11)) % 10 != buf[12]) return false;
 
    return true;
}


/*****
  * 법인번호 체크
  * return : boolean
  * ex) 111111-1111111
  *****/
function check_corpnum(resno){
    fmt = /^\\d{6}-\\d{7}$/;
    if(!fmt.test(resno)) return false;
    // Check Sum 코드의 유효성 검사
    buf = new Array(13);
    for (i = 0; i < 6; i++) buf[i] = parseInt(resno.charAt(i));
    for (i = 6; i < 13; i++) buf[i] = parseInt(resno.charAt(i + 1));
 
    multipliers = [1,2,1,2,1,2,1,2,1,2,1,2];
    for (i = 0, sum = 0; i < 12; i++) sum += (buf[i] *= multipliers[i]);
    if(10 - sum.toString().substring(sum.toString().length*1 - 1,sum.toString().length*1)*1 != buf[12]) return false;
 
    return true;
}

2007/09/01 23:01 2007/09/01 23:01
[원문] http://firejune.com/83&ct1=8&ct2=42 


이 글은 다른분이 올리신 방법을 약간 수정 했습니다.

아이프레임 사용시 문서크기를 자동으로 조절하려면 아래 소스를 아이프레임 내의 제일 하단에 넣어 주세요.
<script>        
       document.body.scrollIntoView(true);        
       parent.document.all.inner1.height = document.body.scrollHeight;
</script>

그리고 아이프레임 소스를 아래와 같이 만들어 주세요.



<iframe id=inner1 src='test.htm' width=600 height=0 frameborder=0 scrolling=no marginwidth=0 marginheight=0 leftmargin=0 topmargin=0></iframe>



문서의 크기에 맞게 조절하기 위해서 iFrame으로 호출될 문서에 스크립트를 썼습니다.
문서가 다 읽히면 그 문서의 길이를 구해 다시 iFrame 의 높이를 조절하는 겁니다.
폭은 width=600 의 값을 조절해 주시면 되겠죠?
document.body.scrollIntoView(true); 현 문서의 맨 마지막으로 이동을 명령합니다. (faile) 라고 해주면 맨 아래로 갑니다.

parent.document.all.inner1.height = document.body.scrollHeight;

inner1 은 iframe 의 id 또는 name 값입니다.
iframe 의 입장에서는 자신을 포함하고 있는 문서가 부모(parent) 가 됩니다.
해석을 하면 부모.문서.모든것중.inner1.높이 에 현재 내 문서(iframe안의 문서)의 스크롤까지 포함한 높이로 바꿔줘라..입니다.

만약 아이프레임 내부에 게시판이 들어간다면 관리자 모드 게시판 환경설정에서 "게시판 하단에 출력할 내용"의 </div>앞에   <script>         document.body.scrollIntoView(true);         parent.document.all.inner1.height = document.body.scrollHeight; </script> 를 넣으시면 됩니다.

또 아이프레임 상태에서 최근게시물을 표시하면 일반적으로 새창으로 게시판만 덜렁뜨는데 이것은 새로운 문서 한장을 만들고 그곳에 최근게시물을 만들어 주시고 링크를 거시면 됩니다.
최근게시물 상단에는 기본 제로 경로 설정이 되어있어야합니다.

또한 링크 타겟을 주시면 완벽하게 두장의 html문서 만으로 홈페이지가 완성됩니다.

음악을 링크 걸 경우에도 초기 페이지가 변경이 안되니 음악이 끊길 염려가 없겠지요?

기존의 노프레임이나 프레임을 나눠 불편한것을 해소시킬수 있을것입니다.
2007/09/01 23:00 2007/09/01 23:00
음...어디서 주서온건지......음...네이버던가....-0-;;;;;;;
할튼 뭐 스무스 스크롤이라 해야하나??
네이버 딱 보면 인기검색어 올라가는거 같이 되는 스크롤....음...네이번가 보다...-0-;;;;


========================================================





//서브 화면 이벤트에서 사용 여러항목 순차적 스크롤 smooth scroll? marquee scroll?
function smScroll(layername) {
    this.name = "smScroll";
    this.divId = layername;
    this.item = new Array();
    this.itemcount = 0;
    this.currentspeed = 0;
    this.scrollspeed = 50;
    this.pausedelay = 1000;
    this.pausemouseover = false;
    this.stop = false;
    this.height = 100;
    this.width = 100;
    this.stopHeight=0;
    this.i=0;
    this.reloadData = 0;

    this.add = function () {
        var text = arguments[0];
        this.item[this.itemcount] = text;
        this.itemcount = this.itemcount + 1;
    };

    this.start = function () {
        if ( this.itemcount == 1 ) {
            this.add(this.item[0]);
        }
        this.display();
        this.currentspeed = this.scrollspeed;
        this.stop = true;
        setTimeout(this.name+'.scroll()',this.currentspeed);
        window.setTimeout(this.name+".stop = false", this.pausedelay);
    };
   
    this.display = function () {
        var htmlCode;
        htmlCode = '<div id="'+this.name+'" style="height:'+this.height+'; width:'+this.width+'; position:relative; overflow:hidden; " OnMouseOver="'+this.name+'.onmouseover(); " OnMouseOut="'+this.name+'.onmouseout(); ">';
        for(var i = 0; i < this.itemcount; i++) {
            htmlCode += '<div id="'+this.name+'item'+i+'"style="left:0px; width:'+this.width+'; position:absolute; top:'+(this.height*i)+'px; ">';
            htmlCode += this.item[i];
            htmlCode += '</div>';
        }
        htmlCode += '</div>';

        document.getElementById(this.divId).innerHTML=htmlCode;  
    };
   
    this.scroll = function () {
        if ( this.pause == true ) {
            window.setTimeout(this.name+".scroll()",this.pausedelay);
            this.pause = false;
        } else {
            this.currentspeed = this.scrollspeed;
            if ( !this.stop ) {
                for (var i = 0; i < this.itemcount; i++) {
                    obj = document.getElementById(this.name+'item'+i).style;
                    obj.top = parseInt(obj.top) - 1;
                    if ( parseInt(obj.top) <= this.height * (-1) ) obj.top = this.height * (this.itemcount-1);
                    if ( parseInt(obj.top) == 0 ) {
                        this.currentspeed = this.pausedelay;
                        this.i = i;
                    }
                }
            }
            if( !this.stop && i == this.itemcount && parseInt(obj.top) == 0 && this.reloadData == 1 ) {
                this.reloadData = 0;
            }
            else {
                window.setTimeout(this.name+".scroll()",this.currentspeed);
            }
        }
    };
   
    this.rolling = function () {
        if ( this.stop == false  ) {
            this.next();
        }
        window.setTimeout(this.name+".rolling()",this.scrollspeed);
    }
   
    this.onmouseover = function () {
        if ( this.pausemouseover ) {
            this.stop = true;
        }
    };
   
    this.onmouseout = function () {
        if ( this.pausemouseover ) {
            this.stop = false;
        }
    };
   
    this.next = function() {
   
        for (i = 0; i < this.itemcount; i++) {
            obj = document.getElementById(this.name+'item'+i).style;
            if ( parseInt(obj.left) < 1 ) {
                width = this.width + parseInt(obj.left);
                break;
            }
        }
        for (i = 0; i < this.itemcount; i++) {
            obj = document.getElementById(this.name+'item'+i).style;
            if ( parseInt(obj.left) < 1 ) {
                obj.left = this.width * (this.itemcount-1);
            } else {
                obj.left = parseInt(obj.left) - width;
            }
        }
   
    }
   
    this.prev = function() {
   
        for (i = 0; i < this.itemcount; i++) {
            obj = document.getElementById(this.name+'item'+i).style;
            if ( parseInt(obj.left) < 1 ) {
                width = parseInt(obj.left) * (-1);
                break;
            }
        }
        if ( width == 0 ) {
            total_width = this.width * (this.itemcount-1);
            for (i = 0; i < this.itemcount; i++) {
                obj = document.getElementById(this.name+'item'+i).style;
                if ( parseInt(obj.left) + 1 > total_width ) {
                    obj.left = 0;
                } else {
                    obj.left = parseInt(obj.left) + this.width;
                }
            }
        } else {
            for (i = 0; i < this.itemcount; i++) {
                obj = document.getElementById(this.name+'item'+i).style;
                if ( parseInt(obj.left) < 1 ) {
                    obj.left = 0;
                } else {
                    obj.left = parseInt(obj.left) + width;
                }
            }
        }
    }
   
    this.unext = function () {
        this.onmouseover();
        this.next();
        window.setTimeout(this.name+".onmouseout()",this.pausedelay);
    }
   
    this.uprev = function () {
        this.onmouseover();
        this.prev();
        window.setTimeout(this.name+".onmouseout()",this.pausedelay);
    }
}


<script>

eventstop = new smScroll('list');
eventstop.name = 'eventstop';
eventstop.height = 32;
eventstop.width  = 181;
eventstop.scrollspeed  = 1;
eventstop.pausedelay   = 5000;
eventstop.pausemouseover = true;

eventstop.add("<a href='#' onfocus='blur();'><span class='boldtxt fontevent '>[ 이벤트 하나 ]</span> 문화대축제 이벤트에참여 하시면, 10월 문화혜택을 즐...</a>");
eventstop.add("<a href='#' onfocus='blur();'><span class='boldtxt fontevent '>[ 이벤트 두울 ]</span> 문화대축제 이벤트에참여 하시면, 10월 문화혜택을 즐...</a>");
eventstop.add("<a href='#' onfocus='blur();'><span class='boldtxt fontevent '>[ 이벤트 세엣 ]</span> 문화대축제 이벤트에참여 하시면, 10월 문화혜택을 즐...</a>");
//eventstop.add("진행중인 이벤트가 없습니다.");

</script>
 
            <table width="207"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="13"><img src="/img/left_eventbg_l.gif"></td>
                <td background="/img/left_eventbg_m.gif" class="small wtxt">
                    <div id='list' ></div>
                </td>
                <td width="13"><img src="/img/left_eventbg_r.gif"></td>
              </tr>
            </table>

<script>
eventstop.start();
</script>
2007/09/01 22:59 2007/09/01 22:59
어디서 주서다 썼던 건지 기억이 나지 않는다....
시간 절약을 위해 -0-//

=====================================================


//퀵바~~
var scroll_pixel,div_pixel,gtpos,gbpos,loop,moving_spd;
var top_margin = 40;        /// 창의 맨위와의 여백 내려올때
var top_margin2 =20;        /// 창의 맨위와의 여백 올라올때
var speed = 20;                /// 점차 줄어드는 속도를 위한 설정
var speed2 = 15;            /// setTimeout을 위한 속도 설정
var moving_stat = 1;        /// 메뉴의 스크롤을 로딩시 on/off설정 1=움직임 0은 멈춤

function check_scrollmove()
{
  scroll_pixel = document.body.scrollTop;
        gtpos = document.body.scrollTop+top_margin;
        gbpos = document.body.scrollTop+top_margin2;
  if(quick.style.pixelTop < gtpos)
        {
         moving_spd = (gbpos-quick.style.pixelTop)/speed;
         quick.style.pixelTop += moving_spd;
        }
        if(quick.style.pixelTop > gtpos)
        {
         moving_spd = (quick.style.pixelTop-gtpos)/speed;
         quick.style.pixelTop -= moving_spd;
        }
        loop = setTimeout("check_scrollmove()",speed2);
}
function moving_control()
{
  if(!moving_stat){ check_scrollmove(); moving_stat = 1;}
        else{ clearTimeout(loop); moving_stat = 0; div_id.style.pixelTop = top_margin;}
}

//사용은 check_scrollmove 이걸로 시작~
2007/09/01 22:58 2007/09/01 22:58
TAG ,