테스트 사이트 - 개발 중인 베타 버전입니다

배경이미지를 사용자에 의해 변경할수 있는 방법

배경이미지를 사용자에 의해 변경할수 있는 소스를 찾다 아래와 같은 내용을 확인했습니다.
그런데 원하는 배경을 선택한후 새로고침을 하게 되면 - 즉 페이지를 이동하게 되면 - 원래의 처음 배경으로
돌아옵니다. 
페이지가 새로고침되도 선택된 배경이 유지될수 있는 조언을 구합니다.
 
 
<!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[

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개

DB든 쿠키든 XML이든 현재 상태값을 저장 않하고 이게 가능한가요? 방법이 있으면 저도 알고 싶네요~ㅎ
위의 소스랑은 다른 구성이겠지만, 쿠키로 적용을 하는듯 한데 http://www.hangloose.co.kr/front/php/login/login_f.php 에서
가능한것 처럼 보이네요...ㅠㅠ 고수분들은 가능하지 않을까요?....ㅠㅠ
쿠키로는 가능하죠~ㅋ
그럼 위의 소스를 수정하여 쿠키적용이 가능하도록 변경이 가능하신가요? 가능하시다면 답변을 부탁드립니다.ㅠㅠ
적어주신 주소로가서 까보니 쿠키값으로 숫자 저장한다음에
배경 로딩때, 해당 숫자에 할당된 배경으로 뿌려주는 것 같아요 ㅇ_ㅇ..
그 기능이 위의 소스에 추가가 가능할까요? ㅜㅜ
자바스크립트로 쿠키를 다루는 부분에 대해서 조금 검색해보면 무리없이 적용 가능할 것 같아요 ^^
제가 초보라....검색만 보름을 넘어가는데...진전이 없네요 ㅜㅜ 도움을..부탁드립니다. ㅠㅠ

게시글 목록

번호 제목
5125
31169
31156
24468
5123
26932
18245
18239
5111
18236
5097
5096
26924
5086
5080
31139
26919
5078
26914
26898
18227
24462
26891
5072
5069
5066
26889
24457
5061
30628
5059
26413
18223
18222
31109
26410
26406
5056
5042
26885
31097
18214
5034
5030
31075
26879
5021
5019
18207
26854
5010
5002
4999
4986
4995
18196
30626
18195
26852
26846
4985
18186
30622
26842
18184
26839
18182
4972
4954
4951
4947
24448
26832
4937
4934
26827
18181
4924
18169
4930
4917
24438
26820
26813
4912
26804
4906
4895
4887
4882
4877
4869
30618
4866
26799
4862
26795
24430
4857
30609