YesYo.com MintState Forums
뒤로    YesYo.com MintState BBS > Tech > Javascript
검색
멤버이름    오토
비밀번호 
 

배너 레이어 중앙위치 기준으로 정렬

페이지 정보

작성자 MintState 댓글 0건 조회 9,087회 작성일 08-11-17 12:02

본문

배너 레이어 중앙위치 기준으로 정렬

<div id="left_popup" style="position: absolute; left:expression((document.body.clientWidth) / 2 - 465); top:155px; z-index: 100;"> 
내용.....
</div>


<div id="Layer1" style="position:absolute; visibility:visible; left:expression((document.body.clientWidth/2)-503); top:145px; width:100; ">
내용.....
</div>


<center>
	<table width=800 border=0 cellspacing=0 cellpadding=0>
		<tr>
			<td height=50>
				Top Contents
			</td>
		</tr>
		<tr> 
			<td bgcolor=#cfcfcf>
				<div id=platDiv style="position:relative;">
					<div style="position:absolute;top:0;left:-117;width:110">LeFt Contents</div>
				</div>
				Middle Contents
			</td>
		</tr>
	</table>
</center>


파란에 있던거..
<style type="text/css">
body {text-align:center;margin:0;padding:0;}
#outline {position:relative;text-align:left;width:825px;margin:0 auto;}
#left_outban {position:absolute;top:147px;left:-83px;}
#right_outban {position:absolute;top:147px;right:-83px;}
</style>
<div id="outline">
<div id="left_outban">LeftBanner</div>
<div id="right_outban">RightBanner</div>
Main
</div>


네이버에 있는 것입니다.
본문 index.html
<html dir="ltr" lang="ko">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" />
<style>
	body{background-color:#ffffff;margin:0;text-align:center;}
</style>
</head>
<body>
<table width=800 border=1 align=center><tr><td align=center>ddd</td></tr></table>
<iframe src=banner.html width=0 height=0 border=0 frameborder=0 scrolling=no marginheight=0 marginwidth=0 id=fmicro name=fmicro></iframe>
<div id=test name=test style=position:absolute;left:50%;top:0;z-index:15;height:10px><div id=adspace name=adspace></div></div>
</body>
</html>


배너 banner.html
<html dir="ltr" lang="ko">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" />
<style>
	body{background-color:#ffffff;margin:0;text-align:center;}
</style>
<script language=javascript>
// JavaScript for AD #2
// 2006-07-06
// inome _at_ nhncorp.com

// Flash
// s: source url, d: flash id, w: source width, h: source height, t: wmode
// f: frequency, l: link list
// k: flashvars key, v: flashvars value
// y: style 

function mf8(s,d,w,h,t,f,l,y){
    var keys = new Array();
    var values = new Array();
    if(f != null && f.length > 0){keys.push("nfreq");values.push(f);}
    for(var i = 0; l != null && i < l.length; i++){
        var clkid = i + 1;
        keys.push(clkid);values.push(encode(l[i]));
    }
    return mf81(s,d,w,h,t,keys,values,y);
}

function mf81(s,d,w,h,t,k,v,y){
    var flashvars = "";
    if(k != null && v != null && k.length > 0 && k.length == v.length){
        for(var i = 0; i < k.length; i++){
            if(i > 0){ flashvars += "&"; }
            flashvars += k[i] + "=" + v[i];
        }
    }

    var styles = (y)?"style=\""+y+"\"":"";

    var code = "";
    code  = "<object type=\"application/x-shockwave-flash\" ";
    code +=         "classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" ";
    code +=         "codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" ";
    code +=         "width=\""+w+"\" height=\""+h+"\" id=\""+d+"\" "+styles+">";
    code += "<param name=\"movie\" value=\""+s+"\" />";
    code += "<param name=\"quality\" value=\"high\" />";
    //code += "<param name=\"bgcolor\" value=\"#ffffff\" />";
    code += "<param name=\"wmode\" value=\""+t+"\" />";
    code += "<param name=\"menu\" value=\"false\" />";
    code += "<param name=\"allowScriptAccess\" value=\"always\" />";
    code += "<param name=\"swliveconnect\" value=\"true\" />";

    if(flashvars.length > 0){
        code += "<param name=\"FlashVars\" value=\""+flashvars+"\" />";
    }

    code += "<embed src=\""+s+"\" quality=\"high\" "
    //code +=        "bgcolor=\"#ffffff\" "
    code +=        "id=\"_"+d+"\" "
    code +=        "wmode=\""+t+"\" "
    code +=        "menu=\"false\" width=\""+w+"\" height=\""+h+"\" "
    code +=        "type=\"application/x-shockwave-flash\" "
    code +=        "allowScriptAccess=\"always\" "

    if(flashvars.length > 0){
        code +=    "FlashVars=\""+flashvars+"\" ";
    }

    code +=        "pluginspage=\"http://www.macromedia.com/go/getflashplayer\"> "
    code += "</embed>"
    code += "</object>"

    return code;
}

// assign code innerHTML
function setcode(target, code){ target.innerHTML = code; }

// url encode
function encode(str){
    var result = "";
    for (i=0;i<str.length;i++) {
        if(str.charAt(i) == " ") result +=  "+";
        else result +=  str.charAt(i);    
    }    
    return escape(result);
}

// 레이어에 배너 나타 내기
var is="naver_icon_90x125_break.swf";
var sp;
function initAd() {
		try{
			sp=parent.document.getElementById("adspace");
			showIcon();
		}
		catch(e){}
	}
	function nimp(idx){adRR(list,idx);}
	function showIcon() {
		try{
			setcode(sp,mf8(is,"i",90,125,"transparent"));
			with(sp.style){position="relative";right="514px";top="50px";}
		}
		catch(e){}
	}
</script>
</head>
<body onload="initAd()" leftmargin="0" topmargin="0"></body>
</html>

댓글목록

등록된 댓글이 없습니다.

Total 178건 5 페이지
게시물 검색
모바일 버전으로 보기
CopyRight ©2004 - 2021, YesYo.com MintState. ™