|
Web razvoj Sve u vezi sa razvojem Internet sajtova: programi, dizajn, usluge hostinga, administracija... |
|
Alatke vezane za temu | Vrste prikaza |
17.9.2011, 0:59 | #1 |
Član
Član od: 25.8.2010.
Poruke: 30
Zahvalnice: 3
Zahvaljeno 0 puta na 0 poruka
|
Onload funkcija.... help
Nasao sam neki pop up na net
ima kod: Kod:
<li><a href="#dialog1" name="modal">POP UP</a></li> |
17.9.2011, 11:01 | #2 |
Član
Član od: 9.12.2007.
Poruke: 150
Zahvalnice: 20
Zahvaljeno 3 puta na 3 poruka
|
Re: Onload funkcija.... help
Pogledaj ovo:
U html kodu dodas gde zelis da ti se otvori pop up npr Kod:
<div id="pa"> <div class="pa_close"><a href="javascript:void(0)" onclick="hideAp()"><img src="close1.jpg" alt="close" /></a></div> <h1>Moj popup</h1> <br /><br /> <img src="popupslika.jpg" alt="special" /> </div> U head sekciji dodas ovaj java script, nazovi ga kako hoces: popup.js Kod:
var timer; var h = -450; // set this to the same value of the top property for the pa div in the style sheet var w = 250; // set this to the same value of the width property for the pa div in the style sheet, smaller to move it to the right, larger to move it to the left var t = 100; // set this to the actual pixel distance from the top where you want the pa div to be at the end of the descent function startAp() { setLeft(); showAp(); } function hideAp() { if (document.layers) document.layers.pa.visibility = 'hide'; else if (document.all) document.all.pa.style.visibility = 'hidden'; else if (document.getElementById) document.getElementById("pa").style.visibility = 'hidden'; } function showAp() { state=typeof tPos; if(state=='undefined') tPos = h; if(tPos < t) { tPos+=25; if (document.layers) document.layers.pa.top = tPos+"px"; else if (document.all) document.all.pa.style.top = tPos+"px"; else if (document.getElementById) document.getElementById("pa").style.top = tPos+"px"; } if(timer!=null) clearInterval(timer); timer = setTimeout("showAp()",10); } function getoPos() { if (document.layers) alert(document.layers.pa.top); else if (document.all) alert(document.all.pa.style.top); else if (document.getElementById) alert(document.getElementById("pa").style.top); } function setLeft() { if (document.layers) document.layers.pa.left = ((window.innerWidth / 2) - (w / 2))+"px"; else if (document.all) document.all.pa.style.left = ((document.body.offsetWidth / 2) - (w / 2))+"px"; else if (document.getElementById) document.getElementById("pa").style.left = ((window.innerWidth / 2) - (w / 2))+"px"; } |
17.9.2011, 23:18 | #3 |
Član
Član od: 25.8.2010.
Poruke: 30
Zahvalnice: 3
Zahvaljeno 0 puta na 0 poruka
|
Re: Onload funkcija.... help
pravo da ti kazem skoro da nemam nikakve veze sa web programiranje... znam samo neke osnove
nasao sam ja jedan pop up na net. Promenio sam ja malo izgled pop up-a i sve to i ima jedan kod koji glasi: Kod:
<li><a href="#dialog1" name="modal">POP UP</a></li> e ja bi sad da se otvori isto tako pop up pri ucitavanju stranice tj onload. znaci treba da se ucita "#dialog". |
18.9.2011, 0:03 | #4 |
Član
Član od: 9.12.2007.
Poruke: 150
Zahvalnice: 20
Zahvaljeno 3 puta na 3 poruka
|
Re: Onload funkcija.... help
Pa to je ovo sto sam ti dao. Kad otvoris stranicu iskocice ti ova slicica koju pozovem. Samo treba da ukljucis u head ovaj javascript i da u svoju stranicu ugradis gde hoces da ti se taj popup prikaze, to radis preko ovog div taga i to je to.
|
18.9.2011, 3:04 | #5 | |
Deo inventara foruma
Član od: 17.6.2011.
Poruke: 7.336
Zahvalnice: 94
Zahvaljeno 3.334 puta na 2.010 poruka
|
Re: Onload funkcija.... help
Citat:
Jedini pop-up prozori koji su dozvoljeni u novijim browserima su oni koji se otvaraju na eksplicitni zahtev korisnika: klik na neki element, hover itd. |
|
18.9.2011, 10:54 | #6 |
Član
Član od: 25.8.2010.
Poruke: 30
Zahvalnice: 3
Zahvaljeno 0 puta na 0 poruka
|
Re: Onload funkcija.... help
mora malo da se spamuje
kad bi bio neko ljubazan da mi samo napise javaskriptu da se otvori pop up bio bi mu doveka zahvalan nasao sam ja nesto: Kod:
$().ready(function() { $('#someLinkId').click(); }); ja koliko vidim treba da se automatski pozove href="#dialog1" i name="modal" znaci treba mi nesto ovako: Kod:
function startpopup() { NESTO STO URADI ISTO KAO I IKADA SE KLIKNE NA ONAJ LINK tj pozove #dialog1 i modal } npr: Kod:
function startpopup() { setTimeout("popup2()",1000); } function popup2() { setTimeout("popup()",500); } |
18.9.2011, 11:43 | #7 |
Član
Član od: 9.12.2007.
Poruke: 150
Zahvalnice: 20
Zahvaljeno 3 puta na 3 poruka
|
Re: Onload funkcija.... help
Pa ne znam sta ti hoces sa tim pop-up? Hoces kad neko poseti tvoju stranicu da mu iskoci neko obavestenje koje korisnik moze da zatvori i to je to, ili ti hoces da smaras narod pa da mu posaljes beskonacno obavestenja i da vise nikad niko ti ne dodje na sajt. Ako hoces ovo prvo imas tu sto sam postavio sve i nista ti vise ne treba. E sad reci da jos to ne znas da ugradis ....
|
18.9.2011, 17:20 | #8 |
Član
Član od: 25.8.2010.
Poruke: 30
Zahvalnice: 3
Zahvaljeno 0 puta na 0 poruka
|
Re: Onload funkcija.... help
ustvari to nije samo pop up obavestenje vec forma sa nekoliko pitanja gde treba da se odgovori na nekoliko pitanja pre nego sto se pristupi sajtu.
A koliko vidim ili ne razumete sta hocu ili ne znate ali ja mislim da je ono prvo. |
18.9.2011, 22:20 | #9 |
Član
Član od: 25.8.2010.
Poruke: 30
Zahvalnice: 3
Zahvaljeno 0 puta na 0 poruka
|
Re: Onload funkcija.... help
oke... evo kod za pop up koji sam nasao na net:
Kod:
<!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> Ako zna neko molim vas da mi uradi ovo. |
Bookmarks sajtovi |
|
|
Slične teme | ||||
tema | temu započeo | forum | Odgovora | Poslednja poruka |
PHP mail funkcija | Lider | Programiranje | 5 | 24.11.2010 18:12 |
Jedna nadam se laka funkcija | mirkan03 | Programiranje | 8 | 4.8.2010 12:32 |
Funkcija automatskog cimanja na mobilnom - kako? | Forman | Programi za mobilne telefone | 22 | 15.11.2009 18:59 |
[PHP] Ne radi mi mail() funkcija | mirk | Serverske aplikacije i baze podataka | 15 | 6.10.2007 17:04 |
VB6 Funkcija | DobroslaV | Programiranje | 10 | 25.7.2007 13:53 |