묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
작은 사진을 클릭했을시 크게 다른창 나오는 화면 소스 좀 봐주세요..
2006.05.03 16:02
예전에 사용했었는데.. 다시 해볼려고 하니까 안되네요..
http://cozy79jh.cafe24.com/photo_child.html
시범으로 한 html 에 소스 다 넣었구요..
원래 사용하려는건 head 에 기본 소스 넣고
사진 화일 있는 내용 소스에 소스 넣어서 사용하려고 하는 것입니다.
오류가 자꾸 나네요..
기본소스
================================================================================================
<script language="JavaScript">
<!--
var ie=document.all
var ns=document.layers
var ns6=document.getElementById&&!document.all
function enlarge(which,e){
if (ie||ns6){
crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage
if (crossobj.style.visibility=="hidden"){
crossobj.style.left=ns6? pageXOffset+e.clientX : document.body.scrollLeft+event.clientX
crossobj.style.top=ns6? pageYOffset+e.clientY : document.body.scrollTop+event.clientY
crossobj.innerHTML='<img id=drag style=cursor:move alt=그림옮기기 src="'+which+'">'
crossobj.style.visibility="visible"
}
else
crossobj.style.visibility="hidden"
return false
}
else if (document.layers){
if (document.showimage.visibility=="hide"){
document.showimage.document.write('<a href="#" onMouseover="drag_dropns(showimage)"><img src="'+which+'" border=0></a>')
document.showimage.document.close()
document.showimage.left=e.x
document.showimage.top=e.y
document.showimage.visibility="show"
}
else
document.showimage.visibility="hide"
return false
}
else
return true
}
function closepreview(){
crossobj.style.visibility="hidden"
}
var nsx,nsy,nstemp
function drag_dropns(name){
temp=eval(name)
temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
temp.onmousedown=gons
temp.onmousemove=dragns
temp.onmouseup=stopns
}
function gons(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}
function dragns(e){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}
function stopns(){
temp.releaseEvents(Event.MOUSEMOVE)
}
function drag_drop(e){
if (ie&&dragapproved){
crossobj.style.left=tempx+event.clientX-offsetx
crossobj.style.top=tempy+event.clientY-offsety
}
else if (ns6&&dragapproved){
crossobj.style.left=tempx+e.clientX-offsetx
crossobj.style.top=tempy+e.clientY-offsety
}
return false
}
function initializedrag(e){
if (ie&&event.srcElement.id=="drag"||ns6&&e.target.id=="drag"){
offsetx=ie? event.clientX : e.clientX
offsety=ie? event.clientY : e.clientY
tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)
dragapproved=true
document.onmousemove=drag_drop
}
}
document.onmousedown=initializedrag
document.onmouseup=new Function("dragapproved=false")
//-->
</script>
==========================================================================================
사진
<span onClick="return enlarge('../images/photo/family/jh_baby2.JPG',event)" style="cursor:hand"><img src="../images/photo/family/jh_baby2.JPG" width="120" height="90"></span>
http://cozy79jh.cafe24.com/photo_child.html
시범으로 한 html 에 소스 다 넣었구요..
원래 사용하려는건 head 에 기본 소스 넣고
사진 화일 있는 내용 소스에 소스 넣어서 사용하려고 하는 것입니다.
오류가 자꾸 나네요..
기본소스
================================================================================================
<script language="JavaScript">
<!--
var ie=document.all
var ns=document.layers
var ns6=document.getElementById&&!document.all
function enlarge(which,e){
if (ie||ns6){
crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage
if (crossobj.style.visibility=="hidden"){
crossobj.style.left=ns6? pageXOffset+e.clientX : document.body.scrollLeft+event.clientX
crossobj.style.top=ns6? pageYOffset+e.clientY : document.body.scrollTop+event.clientY
crossobj.innerHTML='<img id=drag style=cursor:move alt=그림옮기기 src="'+which+'">'
crossobj.style.visibility="visible"
}
else
crossobj.style.visibility="hidden"
return false
}
else if (document.layers){
if (document.showimage.visibility=="hide"){
document.showimage.document.write('<a href="#" onMouseover="drag_dropns(showimage)"><img src="'+which+'" border=0></a>')
document.showimage.document.close()
document.showimage.left=e.x
document.showimage.top=e.y
document.showimage.visibility="show"
}
else
document.showimage.visibility="hide"
return false
}
else
return true
}
function closepreview(){
crossobj.style.visibility="hidden"
}
var nsx,nsy,nstemp
function drag_dropns(name){
temp=eval(name)
temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
temp.onmousedown=gons
temp.onmousemove=dragns
temp.onmouseup=stopns
}
function gons(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}
function dragns(e){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}
function stopns(){
temp.releaseEvents(Event.MOUSEMOVE)
}
function drag_drop(e){
if (ie&&dragapproved){
crossobj.style.left=tempx+event.clientX-offsetx
crossobj.style.top=tempy+event.clientY-offsety
}
else if (ns6&&dragapproved){
crossobj.style.left=tempx+e.clientX-offsetx
crossobj.style.top=tempy+e.clientY-offsety
}
return false
}
function initializedrag(e){
if (ie&&event.srcElement.id=="drag"||ns6&&e.target.id=="drag"){
offsetx=ie? event.clientX : e.clientX
offsety=ie? event.clientY : e.clientY
tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)
dragapproved=true
document.onmousemove=drag_drop
}
}
document.onmousedown=initializedrag
document.onmouseup=new Function("dragapproved=false")
//-->
</script>
==========================================================================================
사진
<span onClick="return enlarge('../images/photo/family/jh_baby2.JPG',event)" style="cursor:hand"><img src="../images/photo/family/jh_baby2.JPG" width="120" height="90"></span>