Búsqueda en el Foro:
Buscar


Autor Mensaje
Mensaje23-08-2011, 19:47 (UTC)    
Título del mensaje: [Ayuda urgente] Problema con ventana flotante

Saludos amigo de pwg,
soy practicamente nuevo aqui,

y tengo un problema muy grande, que simplemente a la larga se a convertido en un verdadero dolor de cabeza .

eh creado un intro en flash, y ahora lo quero poner en en mi web en la pagina principal, no quero ponerlo de intro a ver si me explico mejor,
quero ponerlo en la pagina principal y que salga como una ventana flotante al medio de la pagina y que se pueda cerrar, tengo este codigo pero no me a funcionado:

Código:
 <script language=javascript>
function closeDiv() {
document.getElementById('floatLayer').style.left = "-1000";
return false;
}
window.onerror = null;
var topMargin = 150;
var slideTime = 2500;
var ns6 = (!document.all && document.getElementById);
var ie4 = (document.all);
var ns4 = (document.layers);
function layerObject(id,left) {
if (ns6) {
this.obj = document.getElementById(id).style;
this.obj.left = left;
return this.obj;
}
else if(ie4) {
this.obj = document.all[id].style;
this.obj.left = left;
return this.obj;
}
else if(ns4) {
this.obj = document.layers[id];
this.obj.left = left;
return this.obj;
}
}
function layerSetup() {
floatLyr = new layerObject('floatLayer', pageWidth * .5);
window.setInterval("main()", 10)
}
function floatObject() {
if (ns4 || ns6) {
findHt = window.innerHeight;
} else if(ie4) {
findHt = document.body.clientHeight;
}
}
function main() {
if (ns4) {
this.currentY = document.layers["floatLayer"].top;
this.scrollTop = window.pageYOffset;
mainTrigger();
}
else if(ns6) {
this.currentY = parseInt(document.getElementById('floatLayer').style.top);
this.scrollTop = scrollY;
mainTrigger();
} else if(ie4) {
this.currentY = floatLayer.style.pixelTop;
this.scrollTop = document.body.scrollTop;
mainTrigger();
}
}
function mainTrigger() {
var newTargetY = this.scrollTop + this.topMargin;
if ( this.currentY != newTargetY ) {
if ( newTargetY != this.targetY ) {
this.targetY = newTargetY;
floatStart();
}
animator();
}
}
function floatStart() {
var now = new Date();
this.A = this.targetY - this.currentY;
this.B = Math.PI / ( 2 * this.slideTime );
this.C = now.getTime();
if (Math.abs(this.A) > this.findHt) {
this.D = this.A > 0 ? this.targetY - this.findHt : this.targetY + this.findHt;
this.A = this.A > 0 ? this.findHt : -this.findHt;
}
else {
this.D = this.currentY;
}
}
function animator() {
var now = new Date();
var newY = this.A * Math.sin( this.B * ( now.getTime() - this.C ) ) + this.D;
newY = Math.round(newY);
if (( this.A > 0 && newY > this.currentY ) || ( this.A < 0 && newY < this.currentY )) {
if ( ie4 )document.all.floatLayer.style.pixelTop = newY;
if ( ns4 )document.layers["floatLayer"].top = newY;
if ( ns6 )document.getElementById('floatLayer').style.top = newY + "px";
}
}
function start() {
if(ns6||ns4) {
pageWidth = innerWidth;
pageHeight = innerHeight;
layerSetup();
floatObject();
}
else if(ie4) {
pageWidth = document.body.clientWidth;
pageHeight = document.body.clientHeight;
layerSetup();
floatObject();
}
}
</script>
<style type="text/css">
<!--
.Estilo1 {font-family: Arial, Helvetica, sans-serif}
.Estilo2 {font-size: 18px}
.Estilo3 {
color: #ffffff;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
-->
</style>
<div id="floatLayer" style="position:absolute;left:6px;top:350px; background-color: #FFFFFF">
<table width="150" border="8" cellpadding="10" cellspacing="0" style=" ">
<tr>
<td align="center" valign="top" bgcolor="ffffff"><div align="left">

<font color="808080">[ <a href="" onClick="return closeDiv()">cerrar</a> ]</font>
<embed height="400" width="500" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="http://img69.xooimage.com/files/4/d/6/intro-web-final-2c1b20b.swf" play="true" loop="true" menu="true"></embed>

<b></b><br>
</div></td>
</tr>
</table>
<script>start()</script>
</div>
</BODY>
</HTML>



Ademas el boton o el texto cerrar no funciona muy bien, habra alguna manera de modificarlo y que se cierre sin ocultar la ventana?, y no lo logro centrara al medio.
me gustaria que quedara algo como el de jotform, que aparece un video y al bajar y al subir lo sige y al apretar en la X se cierra.





me gustaria que alguien me echara una mano con este codigo, u otro similar,
muchísimas gracias, saludos.


Ultima edición por dolaresdiarios el Mar Ago 23, 2011 8:28 pm; editado 2 veces
Mensaje23-08-2011, 19:54 (UTC)    
Título del mensaje:

Mensaje23-08-2011, 20:36 (UTC)    
Título del mensaje:



Muchas gracias por tu ayuda, ya e logrado hacer lo que quería.
pero aun tengo una duda:

Puedo crear una ventana flotante o un pop up como la de jot form?
así que salga el intro medio y que lo demas de la pagina este oscuro se puede lograr?
gracias


Ultima edición por dolaresdiarios el Mar Ago 23, 2011 8:09 pm; editado 2 veces
Mostrar mensajes anteriores:   


Powered by phpBB © 2001, 2005 phpBB Group