배경이미지를 사용자에 의해 변경할수 있는 방법
배경이미지를 사용자에 의해 변경할수 있는 소스를 찾다 아래와 같은 내용을 확인했습니다.
그런데 원하는 배경을 선택한후 새로고침을 하게 되면 - 즉 페이지를 이동하게 되면 - 원래의 처음 배경으로
돌아옵니다.
페이지가 새로고침되도 선택된 배경이 유지될수 있는 조언을 구합니다.
<!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년 전
적어주신 주소로가서 까보니 쿠키값으로 숫자 저장한다음에
배경 로딩때, 해당 숫자에 할당된 배경으로 뿌려주는 것 같아요 ㅇ_ㅇ..
배경 로딩때, 해당 숫자에 할당된 배경으로 뿌려주는 것 같아요 ㅇ_ㅇ..
게시판 목록
자유게시판
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 |
|
3주 전 | 58 | |
| 199538 | 3개월 전 | 256 | ||
| 199537 | 3개월 전 | 295 | ||
| 199536 |
|
3개월 전 | 276 | |
| 199535 | 3개월 전 | 281 | ||
| 199534 |
|
3개월 전 | 209 | |
| 199533 |
|
3개월 전 | 292 | |
| 199532 | 3개월 전 | 206 | ||
| 199531 | 3개월 전 | 381 | ||
| 199530 | 3개월 전 | 357 | ||
| 199529 |
|
3개월 전 | 267 | |
| 199528 | 3개월 전 | 175 | ||
| 199527 | 3개월 전 | 317 | ||
| 199526 | 3개월 전 | 214 | ||
| 199525 |
|
3개월 전 | 400 | |
| 199524 | 3개월 전 | 421 | ||
| 199523 | 3개월 전 | 251 | ||
| 199522 | 3개월 전 | 418 | ||
| 199521 | 3개월 전 | 208 | ||
| 199520 | 3개월 전 | 377 | ||
| 199519 |
|
3개월 전 | 335 | |
| 199518 |
비버팩토리
|
3개월 전 | 265 | |
| 199517 | 3개월 전 | 235 | ||
| 199516 | 3개월 전 | 359 | ||
| 199515 | 3개월 전 | 432 | ||
| 199514 | 3개월 전 | 240 | ||
| 199513 | 3개월 전 | 301 | ||
| 199512 |
|
3개월 전 | 310 | |
| 199511 | 3개월 전 | 348 | ||
| 199510 | 3개월 전 | 325 | ||
| 199509 | 3개월 전 | 263 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기