Print Page | Close Window

Mensaje al entrar en la web

Printed From: Vida Una
Category: Programación
Forum Name: Códigos JavaScript
Forum Description: Los mejores códigos en Java y Javascript de ayuda para los webmaster. Los mejores ejemplos y trucos útiles de la aplicación de JavaScript .
URL: https://www.vidauna.com/forum_posts.asp?TID=1360
Printed Date: 27 Abril 2024 at 6:20pm


Topic: Mensaje al entrar en la web
Posted By: Programador
Subject: Mensaje al entrar en la web
Date Posted: 25 Enero 2011 at 8:54am

Mensaje al entrar en la web

 
 
Copia y pega en <head>
 
<script language="JavaScript1.2">

//drag drop function for NS 4////
/////////////////////////////////

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)
}

//drag drop function for IE 4+////
/////////////////////////////////
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")
}
////drag drop functions end here//////
function hidebox(){
if (document.all)
showimage.style.visibility="hidden"
else if (document.layers)
document.showimage.visibility="hide"
}

</script>
 
 
Copia y pega en tu pagina <body> si te da algun problema incluye esta parte dentro de una tabla . Puedes modificar los colores , el tipo de fuente , el tamaño...
Guardate esta imagen en el mismo directorio que el script y la pagina:
 
<div id="showimage" style="position:absolute;width:250px;left:10;top:70">
<table border="0" width="250" bgcolor="#FF0000" cellspacing="0" cellpadding="4">
<tr>
<td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0" height="36">
<tr>
<td onMousedown="initializedragie()" style="cursor:move" width="100%"><ilayer width="100%"><layer width="100%" onMouseover="dragswitch=1;drag_dropns(showimage)" onMouseout="dragswitch=0">
<center>
<font face="Verdana" color="#FFFFFF"><strong>AQUÍ PUEDES PONER UN TITULO</strong></font>
</center></layer></ilayer></td>
<td style="cursor:hand"><a href="#" onClick="hidebox();return false">
<img src="close.gif" border=0 width="16" height="16"></a></td>
</tr>
<tr>
<td width="100%" bgcolor="#CCCC33" style="padding:2px" colspan="2">
<!--Begin html content here. --------->
<div align="center"><font size="2">Aquí puedes poner lo que quieras.<br>Imágenes, enlaces , , ,<img src="boy4.gif" border="0"></font><p><strong>
  <font size="2"><br>Cualquier código html sirve para configurar el mensaje que tu quieras.</font></strong></div>
<!--End of html content. --------->
</td>
</tr>
</table>
 



Print Page | Close Window