Jump to content
Fórum Script Brasil
  • 0

Exemplo De Janela Que Se Move E Fecha


jissa

Question

Clique para ver Funcionando

</html>

<head>

<script language=JavaScript>

var dragswitch=0

var nsx

var nsy

var 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){

if (dragswitch==1){

temp.moveBy(e.x-nsx,e.y-nsy)

return false

}

}

function stopns(){

temp.releaseEvents(Event.MOUSEMOVE)

}

var dragapproved=false

function drag_dropie(){

if (dragapproved==true){

document.all.showimage.style.pixelLeft=tempx+event.clientX-iex

document.all.showimage.style.pixelTop=tempy+event.clientY-iey

return false

}

}

function initializedragie(){

iex=event.clientX

iey=event.clientY

tempx=showimage.style.pixelLeft

tempy=showimage.style.pixelTop

dragapproved=true

document.onmousemove=drag_dropie

}

if (document.all){

document.onmouseup=new Function("dragapproved=false")

}

function hidebox(){

if (document.all)

showimage.style.visibility="hidden"

else if (document.layers)

document.showimage.visibility="hide"

}

</SCRIPT>

</head>

<body>

<DIV id=showimage style="LEFT: 510; POSITION: absolute; TOP: 1; WIDTH: 224; height:83">

<TABLE bgColor=#000080 border=0 cellPadding=2 cellSpacing=0 width=228>

<TBODY>

<TR>

<TD width="226">

<TABLE border=0 cellPadding=0 cellSpacing=0 height=36 width="226">

<TBODY>

<TR>

<TD onmousedown=initializedragie() style="CURSOR: hand"

width="225"><ILAYER width="100%"><LAYER onmouseout=dragswitch=0

onmouseover=dragswitch=1;drag_dropns(showimage) width="100%"><FONT

color=#ffffff face=Verdana><STRONG><SMALL>www.superscript.com.br</SMALL></STRONG></FONT></LAYER></ILAYER></TD>

<TD style="CURSOR: hand" width="34"><A

href="http://"

onclick="hidebox();return false"><IMG border=0 height=20

src="close_o.gif" width=16></A></TD></TR>

<TR>

<TD bgColor=#ffffff colSpan=2

style="PADDING-BOTTOM: 4px; PADDING-LEFT: 4px; PADDING-RIGHT: 4px; PADDING-TOP: 4px"

width="251"><SMALL><FONT

face=Verdana>está janela pode ser movida<br>e fechada clique no x para fechar.</FONT></SMALL><p>

Visite-nos:<a href="http://www.superscript.com.br/forum/forum/default.asp">www.superscript.com.br</a></TD>

</TR>

</TBODY>

</TABLE>

</TD>

</TR>

</TBODY>

</TABLE>

</DIV>

</body>

</html>

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0
Clique para ver Funcionando

</html>

<head>

<script language=JavaScript>

var dragswitch=0

var nsx

var nsy

var 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){

if (dragswitch==1){

temp.moveBy(e.x-nsx,e.y-nsy)

return false

}

}

function stopns(){

temp.releaseEvents(Event.MOUSEMOVE)

}

var dragapproved=false

function drag_dropie(){

if (dragapproved==true){

document.all.showimage.style.pixelLeft=tempx+event.clientX-iex

document.all.showimage.style.pixelTop=tempy+event.clientY-iey

return false

}

}

function initializedragie(){

iex=event.clientX

iey=event.clientY

tempx=showimage.style.pixelLeft

tempy=showimage.style.pixelTop

dragapproved=true

document.onmousemove=drag_dropie

}

if (document.all){

document.onmouseup=new Function("dragapproved=false")

}

function hidebox(){

if (document.all)

showimage.style.visibility="hidden"

else if (document.layers)

document.showimage.visibility="hide"

}

</SCRIPT>

</head>

<body>

<DIV id=showimage style="LEFT: 510; POSITION: absolute; TOP: 1; WIDTH: 224; height:83">

<TABLE bgColor=#000080 border=0 cellPadding=2 cellSpacing=0 width=228>

<TBODY>

<TR>

<TD width="226">

<TABLE border=0 cellPadding=0 cellSpacing=0 height=36 width="226">

<TBODY>

<TR>

<TD onmousedown=initializedragie() style="CURSOR: hand"

width="225"><ILAYER width="100%"><LAYER onmouseout=dragswitch=0

onmouseover=dragswitch=1;drag_dropns(showimage) width="100%"><FONT

color=#ffffff face=Verdana><STRONG><SMALL>www.superscript.com.br</SMALL></STRONG></FONT></LAYER></ILAYER></TD>

<TD style="CURSOR: hand" width="34"><A

href="http://"

onclick="hidebox();return false"><IMG border=0 height=20

src="close_o.gif" width=16></A></TD></TR>

<TR>

<TD bgColor=#ffffff colSpan=2

style="PADDING-BOTTOM: 4px; PADDING-LEFT: 4px; PADDING-RIGHT: 4px; PADDING-TOP: 4px"

width="251"><SMALL><FONT

face=Verdana>está janela pode ser movida<br>e fechada clique no x para fechar.</FONT></SMALL><p>

Visite-nos:<a href="http://www.superscript.com.br/forum/forum/default.asp">www.superscript.com.br</a></TD>

</TR>

</TBODY>

</TABLE>

</TD>

</TR>

</TBODY>

</TABLE>

</DIV>

</body>

</html>

como que você achou esse site.

Link to comment
Share on other sites

  • 0

Cara, você não precisa dar "quote" em todas as mensagens ............. isso só carrega o servidor.!!!!!!!!!!!

se alguém quiser ver a mensagem é só olhar pra cima>..........

sobre o site 'www.superscript.com.br' é um site que está sendo desenvolvido com participação minha e do jissa........... e ajuda de alguns amigos....... aqui do forun inclusive.....

Link to comment
Share on other sites

  • 0
Davi.. o que não Funciona????
No meu browser, o Mozilla, não funca e nem no Opera. O div nem se mexe...:(

ué! ...eu tenho o Opera7 aqui e funcionou direitinho! :blink:

...o Davi, você tem um link onde eu possa encontrar esse Mozilla pra baixar? - acho q só falta ele pra minha coleção! :D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.1k
    • Total Posts
      652k
×
×
  • Create New...