배경이미지를 사용자에 의해 변경할수 있는 방법
배경이미지를 사용자에 의해 변경할수 있는 소스를 찾다 아래와 같은 내용을 확인했습니다.
그런데 원하는 배경을 선택한후 새로고침을 하게 되면 - 즉 페이지를 이동하게 되면 - 원래의 처음 배경으로
돌아옵니다.
페이지가 새로고침되도 선택된 배경이 유지될수 있는 조언을 구합니다.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>back</title>
<script language='javascript' type='text/javascript'>
//<![CDATA[
<html>
<head>
<title>back</title>
<script language='javascript' type='text/javascript'>
//<![CDATA[
var ary = new Array();
ary.push('http://thumb.opencast.naver.net/opencast01/d/o/doldoly2002/20100403/2328333933853.jpg?type=f10060');
ary.push('http://thumb.opencast.naver.net/opencast01/d/o/doldoly2002/20100403/23494064089956.jpg?type=f10060');
ary.push('http://thumb.opencast.naver.net/opencast01/d/o/doldoly2002/20100403/23353148487012.jpg?type=f10060');
ary.push('http://thumb.opencast.naver.net/opencast01/d/o/doldoly2002/20100403/23391992675918.jpg?type=f10060');
window.onload = function()
{
}
function fncChange(pos)
{
document.body.style.backgroundImage ='url("'+ary[Number(pos)]+'")';
}
//]]>
</script>
<style type='text/css'>
#maketop {background-color: transparent;}
#makebanner {background-color: transparent;}
body
{
background-image: url('http://thumb.opencast.naver.net/opencast01/d/o/doldoly2002/20100403/2328333933853.jpg?type=f10060');
background-repeat: no-repeat;
background-position: top center;
}
</style>
</head>
<body>
<input type='button' onclick='fncChange(0)' value='1번 배경'/>
<input type='button' onclick='fncChange(1)' value='2번 배경'/>
<input type='button' onclick='fncChange(2)' value='3번 배경'/>
<input type='button' onclick='fncChange(3)' value='4번 배경'/>
</body>
</html>
잘부탁드립니다.
댓글 8개
13년 전
위의 소스랑은 다른 구성이겠지만, 쿠키로 적용을 하는듯 한데 http://www.hangloose.co.kr/front/php/login/login_f.php 에서
가능한것 처럼 보이네요...ㅠㅠ 고수분들은 가능하지 않을까요?....ㅠㅠ
가능한것 처럼 보이네요...ㅠㅠ 고수분들은 가능하지 않을까요?....ㅠㅠ
13년 전
적어주신 주소로가서 까보니 쿠키값으로 숫자 저장한다음에
배경 로딩때, 해당 숫자에 할당된 배경으로 뿌려주는 것 같아요 ㅇ_ㅇ..
배경 로딩때, 해당 숫자에 할당된 배경으로 뿌려주는 것 같아요 ㅇ_ㅇ..
게시판 목록
자유게시판
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 |
|
2주 전 | 48 | |
| 199628 | 2개월 전 | 228 | ||
| 199627 |
|
2개월 전 | 288 | |
| 199626 | 2개월 전 | 265 | ||
| 199625 | 2개월 전 | 157 | ||
| 199624 |
|
2개월 전 | 213 | |
| 199623 | 2개월 전 | 279 | ||
| 199622 | 2개월 전 | 229 | ||
| 199621 | 2개월 전 | 195 | ||
| 199620 | 2개월 전 | 151 | ||
| 199619 | 2개월 전 | 192 | ||
| 199618 | 2개월 전 | 126 | ||
| 199617 |
비버팩토리
|
2개월 전 | 248 | |
| 199616 | 2개월 전 | 140 | ||
| 199615 | 2개월 전 | 185 | ||
| 199614 | 2개월 전 | 229 | ||
| 199613 | 2개월 전 | 229 | ||
| 199612 | 2개월 전 | 185 | ||
| 199611 | 2개월 전 | 133 | ||
| 199610 | 2개월 전 | 94 | ||
| 199609 | 2개월 전 | 159 | ||
| 199608 |
techstar
|
2개월 전 | 145 | |
| 199607 | 2개월 전 | 221 | ||
| 199606 | 2개월 전 | 178 | ||
| 199605 | 2개월 전 | 243 | ||
| 199604 |
|
2개월 전 | 296 | |
| 199603 | 2개월 전 | 190 | ||
| 199602 | 2개월 전 | 181 | ||
| 199601 |
|
2개월 전 | 217 | |
| 199600 | 2개월 전 | 155 | ||
| 199599 | 2개월 전 | 223 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기