Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript]Nie działa okno Show
_Martin_
post
Post #1





Grupa: Zarejestrowani
Postów: 352
Pomógł: 9
Dołączył: 16.09.2005
Skąd: Rybnik

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


Witam

Mam skrypt który po kliknicu w link pokazuje okno z wybranymi przezemnie rzeczami które są potem niżej w div

Oto skrypt:

  1. <?php
  2. function showAtCursor(o, iShowingTime, behind) {
  3.    if (oShowedAtCursor) {
  4.        oShowedAtCursor.style.display = 'none';
  5.    }
  6.    
  7.    iShowedAtCursorShowingTime = iShowingTime;
  8.    
  9.    var o = document.getElementById(o);
  10.    oShowedAtCursor = o;
  11.    o.style.display = '';
  12.    o.style.top = tempY-10;
  13.    o.style.left = tempX-10;
  14.    if (behind) {
  15.        o.style.top = tempY+10 - o.offsetHeight;
  16.    }
  17.    o.style.position = 'absolute';
  18.    o.onclick = new Function("this.style.display = 'none';");
  19.    o.onmousemove = new Function("iShowedAtCursorLastActivity = (new Date()).getTime()");
  20.    
  21.    document.body.appendChild(o);
  22. }
  23. ?>


To skrypt js który pokazuje

Kod do wyświetlania linku:
  1. <?php
  2. <a href="java script:showAtCursor('options'.$aRow['id']. '',10);"><span class="pointer">++</span></a>
  3. ?>


A To w div co ma wyświetlać po kliknięciu w ten ++
  1. <?php
  2. <div class="sheet-pop" id="options'.$aRow['id'].'" style="display: block">
  3.                        <div class="sheet-text">
  4.                            <h4>Opcje:</h4>
  5.                            <div>
  6.                                <span class="pointer">+</span>
  7.                                <a href="?str=zgloszenia&cmd=activate&id='.$aRow['id'].'&panel=1">Aktywuj</a> <br />
  8.                                <span class="pointer">+</span>
  9.                                <a href="?str=zgloszenia&cmd=unactivate&id='.$aRow['id'].'&panel=1">Usuń</a>
  10.                            </div>
  11. ?>


CO TU NIE DZIAŁA?
już mówie wszystko (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Tzn na firefox ok na IE I OPera nie działa ta funkcja (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
_Martin_
post
Post #2





Grupa: Zarejestrowani
Postów: 352
Pomógł: 9
Dołączył: 16.09.2005
Skąd: Rybnik

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


A TAk masz racja
cos w tej funkcji na dole jest nie tak i wszystko psuje (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Wielkie dzięki już biorę się do pracy (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

P.S Błąd w funkcji js:

  1. function payConfirm(value, title, url, type) {
  2.    var c = document.createElement('div');
  3.    document.body.appendChild(c);
  4.    
  5.    var types = [];
  6.    types.push("jednorazowe obciążenie");
  7.    types.push("cotygodniowe obciążenie");
  8.    types.push("comiesięczne obciążenie");
  9.    types.push("cozesonowe obciążenie");
  10.    
  11.    if (types[type]) {
  12.        type = types[type];
  13.    } else {
  14.        type = "inne - " + type;
  15.    }
  16.    
  17.    var name = 'cash'+(new Date()).getTime();
  18.    
  19.    c.innerHTML = '<div class="sheet-info" id="'+name+'"><div class="sheet-text"><h4>Potwierdzenie obciążenia kasy klubowej:</h4><div><span class="pointer">+</span> Nazwa: '+title+'</div><div><span class="pointer">+</span> Wartość: '+nf(value,true)+'</div><div><span class="pointer">+</span> Stan po: '+nf(<?php echo intval($aKlub['stan_konta']); ?>-value, true)+'</div><span class="pointer">+</span> Typ: '+type+'</div><div><input type="button" class="ibutton" onclick="window.location=''+url+''" value="Zatwierdź" /> <input type="button" class="ibutton" onclick="$(''+name+'').style.display = 'none';" value="Anuluj" /></div></div></div>';
  20.    
  21.    showAtCursor(name, 500);
  22. }

Usune to i działa (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

Ten post edytował _Martin_ 3.02.2009, 19:12:00
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 11.10.2025 - 22:17