Foros del Web » Programando para Internet » Javascript »

Popup al principio no quiero que carge

Estas en el tema de Popup al principio no quiero que carge en el foro de Javascript en Foros del Web. Hola amigos Tengo 2 detalles 1.- el popup que programe se carga al principio, lo cual NO quiero que lo haga. 2.- No esta haciendo ...
  #1 (permalink)  
Antiguo 16/04/2013, 22:00
 
Fecha de Ingreso: abril-2013
Mensajes: 34
Antigüedad: 11 años
Puntos: 0
Pregunta Popup al principio no quiero que carge

Hola amigos

Tengo 2 detalles

1.- el popup que programe se carga al principio, lo cual NO quiero que lo haga.
2.- No esta haciendo el centrado ni poniendo el fondo en negro.

plis HELPPP...

les dejo el codigo

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Puestos de Trabajo</title>
<script type="text/javascript" src="js/jquery.js"></script>
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/whmcs.css" rel="stylesheet">
<style type="text/css">
body {
background-color: #FFFFFF;
}
</style>
<script src="js/whmcs.js"></script>
</head>
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
<head>
<script src="http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js" type="text/javascript"></script>

<script type="text/javascript">
//Configuramos el evento de carga de página, se ejecuta solamente 1 vez cuando la página cargo por completo
$(document).ready(function(){
centraVentana();
muestraVentana();
//Agregamos el evento "click" del div: ventanaPopup1Cerrar
$("#ventanaPopup1Cerrar").click(function(){
ocultaVentana();
});
//Agregamos el evento "click" del div: ventanaPopup1Fondo
$("#ventanaPopup1Fondo").click(function(){
ocultaVentana();
});
});

function centraVentana() {
//Obtenemos ancho y alto del navegador, y alto y ancho de la popUp
var windowWidth = document.documentElement.clientWidth;
var windowHeight = document.documentElement.clientHeight;
var popupHeight = $("#ventanaPopup1").height();
var popupWidth = $("#ventanaPopup1").width();
//centering
$("#ventanaPopup1").css({
"position": "absolute",
"top": windowHeight/2-popupHeight/2,
"left": windowWidth/2-popupWidth/2
});

//Solo se necesita para IE6
$("#ventanaPopup1Fondo").css({
"height": windowHeight
});
}

function ocultaVentana() {
$("#ventanaPopup1Fondo").fadeOut("slow");
$("#ventanaPopup1").fadeOut("slow");
}

function muestraVentana() {
$("#ventanaPopup1Fondo").css({
"opacity": "0"
});
$("#ventanaPopup1Fondo").fadeIn("slow");
$("#ventanaPopup1").fadeIn("slow");
}
</script>

</head>
</html>
<body>
<div class="whmcscontainer">
<div class="contentpadded">
<div class="page-header">
<div class="styled_title">
<h1>Puestos de Trabajos</h1></div>
</div>
<div class="internalpadding"></div>
<?php
$cann=mysql_query("SELECT Count(id) AS resultado FROM puesto");
if($dat=mysql_fetch_array($cann)){
$numeros=$dat['resultado'];
}
?>
<p><?php echo $numeros; ?> Registros encontrados, Página 1 de 1</p>
<p>&nbsp;</p>
<table class="zebra-striped">
<thead>
<tr>
<th width="9%" class="headerSortdesc"><a href="">ID</a></th>
<th width="40%" class="headerSortdesc"><a href="">Nombre</a></th>
<th width="26%" class="headerSortdesc"><a href="">Estado</a></th>
<th class="headerSortdesc">&nbsp;</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT * FROM puesto ORDER BY id";
$can=mysql_query($sql);
while($dato=mysql_fetch_array($can)){
$id=$dato['id'];
$nombre=$dato['nombre'];
if($dato['estado']=='s'){
$tipor='Activo';
$color='#060';
}else{
$tipor='No Activo';
$color='#F00';
}


?>
<tr>
<td><?php echo $id; ?></td>
<td><?php echo $nombre; ?></td>
<td><p><span style="color:<?php echo $color; ?>"><?php echo $tipor; ?></span></p></td>
<td>
<p><input type="button" value="Cambiar Estado" class="btn primary" onClick="window.location='php_estado_puestos.php?i d=<?php echo $id; ?>'" /></p><input type="button" value="Editar Puesto de Trabajo" class="btn primary" onClick="muestraVentana(); window.location='puestos.php?id=<?php echo $id; ?>'" /></td>
</tr>
<?php
}

?>

</tbody>
</table>




<div id="ventanaPopup1">
<a id="ventanaPopup1Cerrar">x</a>
<?php
if(empty($_GET['id'])){
$id= $numeros+1;
$boton='Guardar';
$nombre="";
}else{
$id=$_GET['id'];
$boton='Actualizar';
$cano=mysql_query("SELECT * FROM puesto WHERE id=$id");
if($ato=mysql_fetch_array($cano)){
$nombre=$ato['nombre'];
}
}
?>
<table class="zebra-striped">
<thead>
<tr>
<th class="headerSortdesc">Editar Puesto de Trabajo<?php echo $id; ?></th>
</tr>
<tr>
<th class="headerSortdesc">
<form name="form1" method="get" action="php_guardar_puestos.php">
<input name="cod" type="hidden" readonly id="cod" value="<?php echo $id; ?>">
<label for="anom">Nombre: </label>
<input name="anom" type="text" id="anom" value="<?php echo $nombre; ?>">

<input type="submit" name="very" class="btn primary" id="button" value="<?php echo $boton; ?>">
</form><br><br>
<form name="form2" method="post" action="puestos.php">
<input type="submit" name="button" class="btn primary" id="button" value="Nuevo Registro">
</form>
</th>

</tr>
</thead>
</table>
</div>
<div id="ventanaPopup1Fondo"></div>
</body>
</html>
  #2 (permalink)  
Antiguo 17/04/2013, 08:16
Avatar de maycolalvarez
Colaborador
 
Fecha de Ingreso: julio-2008
Ubicación: Caracas
Mensajes: 12.120
Antigüedad: 15 años, 8 meses
Puntos: 1532
Respuesta: Popup al principio no quiero que carge

si no quieres que se cargue al inicio, simplemente no lo llames desde el onready
__________________
¡Por favor!: usa el highlight para mostrar código
El que busca, encuentra...
  #3 (permalink)  
Antiguo 17/04/2013, 19:41
 
Fecha de Ingreso: abril-2013
Mensajes: 34
Antigüedad: 11 años
Puntos: 0
Respuesta: Popup al principio no quiero que carge

Eso es lo que hago pero cuando lo mando llamar desde el boton no me lo carga

saludos

Etiquetas: html, input, jquery, js, php, popup, principio, quiero, select
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 04:04.