onload funkcija.... help

onload funkcija.... help

offline
  • Pridružio: 10 Dec 2009
  • Poruke: 258
  • Gde živiš: Kosovo

Nasao sam neki pop up na net Smile
ima kod:
<li><a href="#dialog1" name="modal">POP UP</a></li>
kada kliknem na link pop up se otvori. Ja hocu da se otvori pop up pri ucitavanju stranice tj onload Smile



Registruj se da bi učestvovao u diskusiji. Registrovanim korisnicima se NE prikazuju reklame unutar poruka.
offline
  • Software developer
  • Pridružio: 06 Sep 2005
  • Poruke: 3800
  • Gde živiš: Beograd

sta hoces da ti se ucita pri otvaranju?
u body tagu stavljas atribut onload="akcija()"
moze to da bude neki JS koji ce da otvara popup
http://www.javascript-coder.com/window-popup/javascript-popup-window.phtml
eto ti primer, samo ovde izdaje jedostavno naredjenje, tebi treba funkcija za otvaranje druge stranice



offline
  • Pridružio: 10 Dec 2009
  • Poruke: 258
  • Gde živiš: Kosovo

Napisano: 17 Sep 2011 22:58

napravio sam nesto:
function startpopup() { setTimeout("popup2()",1000); } function popup2() { setTimeout("popup()",500); } function popup() { window.open("#dialog1"); }
2x sam koristio timeout jer meni chrome blokira pop-up kada ima samo jedan time out Very Happy
e sad nije to isto kao sto je kada se klikne na link GUZ - Glavom U Zid
sada mi otvori pop up onaj vindovsov tj ono kao nov windows prozor
a meni je pop up kao neka slicica sa tekst i ima ono iks sa strane za exit.
nije mi onaj pop up sto se meni otvara Very Happy

Dopuna: 18 Sep 2011 22:47

oke... evo kod za pop up koji sam nasao na net:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Simple JQuery Modal Window from Queness</title> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script> <script> $(document).ready(function() {       //select all the a tag with name equal to modal    $('a[name=modal]').click(function(e) {       //Cancel the link behavior       e.preventDefault();              //Get the A tag       var id = $(this).attr('href');           //Get the screen height and width       var maskHeight = $(document).height();       var maskWidth = $(window).width();           //Set heigth and width to mask to fill up the whole screen       $('#mask').css({'width':maskWidth,'height':maskHeight});              //transition effect             $('#mask').fadeIn(1000);          $('#mask').fadeTo("slow",0.8);              //Get the window height and width       var winH = $(window).height();       var winW = $(window).width();                     //Set the popup window to center       $(id).css('top',  winH/2-$(id).height()/2);       $(id).css('left', winW/2-$(id).width()/2);           //transition effect       $(id).fadeIn(2000);        });        //if close button is clicked    $('.window .close').click(function (e) {       //Cancel the link behavior       e.preventDefault();              $('#mask').hide();       $('.window').hide();    });              //if mask is clicked    $('#mask').click(function () {       $(this).hide();       $('.window').hide();    });              }); </script> <style> body { font-family:verdana; font-size:15px; } a {color:#333; text-decoration:none} a:hover {color:#ccc; text-decoration:none} #mask {   position:absolute;   left:0;   top:0;   z-index:9000;   background-color:#000;   display:none; }   #boxes .window {   position:absolute;   left:0;   top:0;   width:440px;   height:200px;   display:none;   z-index:9999;   padding:20px; } #boxes #dialog {   width:375px;   height:203px;   padding:10px;   background-color:#ffffff; } #boxes #dialog1 {   width:375px;   height:203px; } #dialog1 .d-header {   background:url(images/login-header.png) no-repeat 0 0 transparent;   width:375px;   height:150px; } #dialog1 .d-header input {   position:relative;   top:60px;   left:100px;   border:3px solid #cccccc;   height:22px;   width:200px;   font-size:15px;   padding:5px;   margin-top:4px; } #dialog1 .d-blank {   float:left;   background:url(images/login-blank.png) no-repeat 0 0 transparent;   width:267px;   height:53px; } #dialog1 .d-login {   float:left;   width:108px;   height:53px; } #boxes #dialog2 {   background:url(images/notice.png) no-repeat 0 0 transparent;   width:326px;   height:229px;   padding:50px 0 20px 25px; } </style> </head> <body onload="login.htm"> <h2><a href="http://www.queness.com">Simple jQuery Modal Window Examples from Queness WebBlog</a></h2> <ul> <li><a href="http://www.queness.com">Normal Link</a></li> <li><a href="#dialog" name="modal">Simple Window Modal</a></li> <li><a href="#dialog1" name="modal">Login Dialog Box</a></li> <li><a href="#dialog2" name="modal">Sticky Note</a></li> </ul> <div style="font-size:10px;color:#ccc">Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution 3.0 License.</div> <div id="boxes"> <div id="dialog" class="window"> Simple Modal Window | <a href="#"class="close"/>Close it</a> </div>   <!-- Start of Login Dialog -->  <form action="login.php" method="post"> <div id="dialog1" class="window">   <div class="d-header">     <input type="text" value="username" onclick="this.value=''"/><br/>     <input type="password" value="Password" onclick="this.value=''"/>      </div>   <div class="d-blank"></div>   <div class="d-login"><input type="image" alt="Login" title="Login" src="images/login-button.png"/></div> </div> </form> <!-- End of Login Dialog -->  <!-- Start of Sticky Note --> <div id="dialog2" class="window">   So, with this <b>Simple Jquery Modal Window</b>, it can be in any shapes you want! Simple and Easy to modify : ) <br/><br/> <input type="button" value="Close it" class="close"/> </div> <!-- End of Sticky Note --> <!-- Mask to cover the whole screen -->   <div id="mask"></div> </div> </body> </html>
Kad bi hteo neko od vas da uradi ovaj Login Dialog Box da se upali pri ucitavanju stranice tj onload.
Ako zna neko molim vas da mi uradi ovo.

Dopuna: 20 Sep 2011 11:47

bilo ko? pls.

Ko je trenutno na forumu
 

Ukupno su 500 korisnika na forumu :: 4 registrovanih, 0 sakrivenih i 496 gosta   ::   [ Administrator ] [ Supermoderator ] [ Moderator ] :: Detaljnije

Najviše korisnika na forumu ikad bilo je 3466 - dana 01 Jun 2021 17:07

Korisnici koji su trenutno na forumu:
Korisnici trenutno na forumu: Penzula, sasa76, Shilok, zlaya011