Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> nowe okno
eReS_
post 8.02.2006, 08:44:33
Post #1





Grupa: Zablokowani
Postów: 5
Pomógł: 0
Dołączył: 8.02.2006

Ostrzeżenie: (0%)
-----


jak w zgodnosci z XHTML 1.0 Strict, zrobic linka, ktory bedzie otwieral nowe okienko (ale takie zuborzone, bez paska nawigacji, menu)
Go to the top of the page
+Quote Post
revyag
post 8.02.2006, 09:12:01
Post #2





Grupa: Przyjaciele php.pl
Postów: 2 258
Pomógł: 16
Dołączył: 21.09.2004
Skąd: Kielce

Ostrzeżenie: (0%)
-----


Zapraszam do lektury:
klik


--------------------
-------------

------
Go to the top of the page
+Quote Post
eReS_
post 8.02.2006, 11:57:32
Post #3





Grupa: Zablokowani
Postów: 5
Pomógł: 0
Dołączył: 8.02.2006

Ostrzeżenie: (0%)
-----


Zrobilem to tak:
  1. <script language='javascript' type='text/javascript'>
  2. function PopUp(url, name, width,height,center,resize,scroll,posleft,postop) {
  3. if (posleft != 0) { x = posleft }
  4. if (postop != 0) { y = postop }
  5. if (!scroll) { scroll = 1 }
  6. if (!resize) { resize = 1 }
  7. if ((parseInt (navigator.appVersion) >= 4 ) && (center)) {
  8. X = (screen.width - width ) / 2;
  9. Y = (screen.height - height) / 2;
  10. }
  11. if (scroll != 0) { scroll = 1 }
  12. var Win = window.open( url, name, 'width='+width+',height='+height+',top='+Y+',left='+X+',resizable='+resize+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no');
  13. }
  14.  
  15. function ShowHide(id1, id2) {
  16. if (id1 != '') expMenu(id1);
  17. if (id2 != '') expMenu(id2);
  18. }
  19.  
  20. function expMenu(id) {
  21. var itm = null;
  22. if (document.getElementById) {
  23. itm = document.getElementById(id);
  24. } else if (document.all){
  25. itm = document.all[id];
  26. } else if (document.layers){
  27. itm = document.layers[id];
  28. }
  29.  
  30. if (!itm) {
  31. // do nothing
  32. }
  33. else if (itm.style) {
  34. if (itm.style.display == "none") { itm.style.display = ""; }
  35. else { itm.style.display = "none"; }
  36. }
  37. else { itm.visibility = "show"; }
  38. }
  39. //-->
  40. </script>
  41.  
  42. <a href="javascript:PopUp('eeee.php','Pager','500','450','0','1','1','1')">Link</a>


i ie, wywala komunikat po otwarciu strony ze zablokowal okienka ;/
a przeciez chocby na tym forum przy "zobacz histroie ostrzezen" jest taki pop-up i niewywala info za poblokowal ...
Go to the top of the page
+Quote Post
revyag
post 8.02.2006, 12:07:03
Post #4





Grupa: Przyjaciele php.pl
Postów: 2 258
Pomógł: 16
Dołączył: 21.09.2004
Skąd: Kielce

Ostrzeżenie: (0%)
-----


Cytat
jak w zgodnosci z XHTML 1.0 Strict, zrobic linka, ktory bedzie otwieral nowe okienko (ale takie zuborzone, bez paska nawigacji, menu)

To w końcu co chcesz ?
Zajrzałeś chociaż na stronę, którą podałem ?


--------------------
-------------

------
Go to the top of the page
+Quote Post
eReS_
post 8.02.2006, 12:16:46
Post #5





Grupa: Zablokowani
Postów: 5
Pomógł: 0
Dołączył: 8.02.2006

Ostrzeżenie: (0%)
-----


chce cos takiego jak na tym forum pojawia sie po kliknieciu na "pokaz historie" ostrzezen.

otwiera nowe okienko bez pierdol. i ie nieblokuje tego smile.gif

na tamtej stronie jest wlasnie w/w przyklad smile.gif
Go to the top of the page
+Quote Post
revyag
post 8.02.2006, 12:28:55
Post #6





Grupa: Przyjaciele php.pl
Postów: 2 258
Pomógł: 16
Dołączył: 21.09.2004
Skąd: Kielce

Ostrzeżenie: (0%)
-----


Cytat
na tamtej stronie jest wlasnie w/w przyklad smile.gif

naprawdę? nie wydaje mi się.
Kod
<script type="text/javascript">
function popupWin(link,attribs) {
    var popupWin = null;
    popupWin = window.open(link,'winPopup',attribs);  
}

function popupWindows() {
    if(!document.getElementsByTagName) {
         return;
    }
    var scrW = screen.availWidth;
    var scrH = screen.availHeight;
    var anchors = document.getElementsByTagName("a");
    for (var i = 0; i < anchors.length; i++) {
         var anchor = anchors[i];
         var linkDest = anchor.getAttribute("href");
         var relIndex = anchor.getAttribute("rel");
         var relSplit = relIndex.split("|");
         var windowAttributes = "";
         if(relSplit[0] == "popup") {
              if (relSplit[1] > scrW) {
                 pW = scrW - 10;
              }
              else {
                 pW = relSplit[1];
              }
              if (relSplit[2] > scrH) {
                 pH = scrH - 40;
              }
              else {
                 pH = relSplit[2];
              }
              scrX = (scrW - pW - 10) * .5;
              scrY = (scrH - pH - 30) * .5;
              var windowAttributes = "width=" + pW + ",height=" + pH + ",left=" + scrX + ",top=" + scrY + ",screenX=" + scrX + ",screenY=" + scrY;
              windowAttributes += ",location=" + relSplit[4] + ",resizable=" + relSplit[4] + ",scrollbars=" + relSplit[4];
              anchor.setAttribute("href", "javascript:popupWin('" + linkDest + "','" + windowAttributes + "')");
         }
    }
}
window.onload = popupWindows;
</script>

  1. <p><a href="http://www.wp.pl/" rel="popup|600|400|0|1">SitePoint</a></p>


to jest przykład ze strony którą podałem.


--------------------
-------------

------
Go to the top of the page
+Quote Post
eReS_
post 8.02.2006, 15:25:41
Post #7





Grupa: Zablokowani
Postów: 5
Pomógł: 0
Dołączył: 8.02.2006

Ostrzeżenie: (0%)
-----


taaa, tylko jak wylaczyc pasek nawigacji a zostawic samego scroolbara ...

bo mi sie udaja wylaczac scroolbar+pasek nawigacji razem

ehhh
ciezkie zycie jest webmastera tongue.gif
Go to the top of the page
+Quote Post
crash
post 8.02.2006, 15:40:43
Post #8





Grupa: Przyjaciele php.pl
Postów: 2 196
Pomógł: 2
Dołączył: 17.01.2004
Skąd: Sosnowiec

Ostrzeżenie: (0%)
-----


Ja żeby mieć typowego popUp'a używam:
Kod
scrollbars=yes, menubar=no, toolbar=no, resizable=no, statusbar=0


--------------------
Go to the top of the page
+Quote Post
revyag
post 8.02.2006, 15:45:06
Post #9





Grupa: Przyjaciele php.pl
Postów: 2 258
Pomógł: 16
Dołączył: 21.09.2004
Skąd: Kielce

Ostrzeżenie: (0%)
-----


Bardzo łatwo. Rozwiązanie aż kłuje w oczy.
Dodajemy dodatkowe właściwości w atrybucie rel.
np.
  1. <a href="http://www.wp.pl/" rel="popup|600|400|0|0|0|1">SitePoint</a>


i drobna modyfikacja funkcji.
Kod
windowAttributes += ",location=" + relSplit[4] + ",resizable=" + relSplit[5] + ",scrollbars=" + relSplit[6];


tyle.


--------------------
-------------

------
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 18.06.2025 - 16:57