Ir para conteúdo



Botão fechar em banner flutuante.


1 resposta neste tópico

#1
Filipi Macau

  • Participantes
  • 56 posts
Bom gente,

Tenho esse banner flutuante em cima do site que é uma imagem estatica e nele tem um botão "Fechar"

Tá acontecendo de clicar em "Fechar" e o banner ser jogado pro canto da tela e não fechar, só consegue fechar quando clica pela segunda vez.

alguém pode me dá uma luz.
segue o codigo:

<style type="text/css">

div#geral {
width: 770px;
margin: 0 auto;
text-align: left;
}
</style>

<div id="geral">
<body>
<div id="showimage" style="position: absolute; width: 323; left: 220; top: 80; height: 176">

<table border="0" bgcolor="#FFFFFF" cellpadding="20" cellspacing="0">

<tr>
<td onMousedown="initializedragie()" style="cursor:hand">
<ilayer onSelectStart="return false">
<layer onMouseover="dragswitch=1;drag_dropns(showimage)" onMouseout="dragswitch=0">

<div style=position:absolute;left:280px;top:3px;><a href="" onClick="hidebox();return false" style=text-decoration:none; title=Janela><font color=blue face=verdana size=2 align=left><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;FECHAR</b></a></div>

<img src="images/bannerflutua.jpg" alt="hc" border="0" width="378" height="223" title="hicompras">
</layer>
</ilayer>
</td>
</tr>
</table>
</div>
</body>
</div>

<script language="javascript">
var dragswitch=0
var nsx
var nsy
var nstemp
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 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 stopns(){
temp.releaseEvents(Event.MOUSEMOVE)
}
function dragns(e){
if (dragswitch==1){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}
}
function gons(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}


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>

agradeço qualquer ajuda. obrigado.
fiLIpi-maCAu



#2
MVJunior

  • Participantes
  • 106 posts
Po cara...
Aqui no IE7 funcionou!




Tópicos Relacionados Collapse