(X)HTML, JavaScript, DHTML, XML, CSS Client scripting tehnologije, Dynamic HTML, Cascading Stylesheets, XML i standardi |
|
Alati teme | Način prikaza |
11. 02. 2006. | #11 |
Goran Pilipović
Sir Write-a-Lot
|
Ne ignoriše title, naprotiv.
__________________
Goran Pilipović a.k.a. Ugly Fingers Bradley f.k.a. bluesman I don't always know what I'm talking about but I know I'm right! |
11. 02. 2006. | #12 |
expert
Master
Datum učlanjenja: 20.12.2005
Poruke: 730
Hvala: 0
0 "Hvala" u 0 poruka
|
Sad cu ponovo pred editor, za drugu verziju
|
11. 02. 2006. | #13 | |
Dejan Katašić
Wrote a book
Datum učlanjenja: 10.06.2005
Lokacija: Novi Sad
Poruke: 1.017
Hvala: 129
86 "Hvala" u 43 poruka
|
Citat:
|
|
11. 02. 2006. | #14 | |
expert
Master
Datum učlanjenja: 20.12.2005
Poruke: 730
Hvala: 0
0 "Hvala" u 0 poruka
|
Citat:
@bluesman Here it comes... Kôd:
<?xml version="1.0" encoding="UTF-8" ?> <!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" xml:lang="en"> <head> <title>popup test</title> <script type="text/javascript"> /* copyright (C) 2006 Bojan Bozovic (http://maestitia.net/) Dejan Katasic (http://korisnik.blog.hr/) :) */ function show_popup(e) { var evt=e; var tekst=document.createTextNode(this.title); if (typeof (e) != 'object') evt = event; var popup=document.getElementById('popup'); var x,y; if (self.pageYOffset) // all except Explorer { x = self.pageXOffset; y = self.pageYOffset; } else if (document.documentElement && document.documentElement.scrollTop) // Explorer 6 Strict { x = document.documentElement.scrollLeft; y = document.documentElement.scrollTop; } else if (document.body) // all other Explorers { x = document.body.scrollLeft; y = document.body.scrollTop; } popup.appendChild(tekst); this.title=""; popup.style.visibility="visible"; popup.style.top=y+evt.clientY+10+"px"; popup.style.left=x+evt.clientX+10+"px"; } function hide_popup() { var popup=document.getElementById("popup"); this.title=popup.innerHTML; popup.innerHTML=""; popup.style.visibility="hidden"; } function init(){ document.body.innerHTML=document.body.innerHTML+"<div class='popup' id='popup'></div>"; var links = document.getElementsByTagName('a'); for (var i = 0; i < links.length; i++) { if (links[i].title!="") { links[i].onmousemove=show_popup; links[i].onmouseover=show_popup; links[i].onmouseout=hide_popup; } } } </script> <style type="text/css"> div.popup { color:white; background:black; border:1px solid red; position:absolute; visibility:hidden; } </style> <body onload="init()"> <p> <a title="DPT Forums" href="http://www.devprotalk.com">DPT</a> </p> </body> </html> Poslednja izmena od bojan_bozovic : 11. 02. 2006. u 04:25. |
|
11. 02. 2006. | #15 |
Nikola Denić
Sir Write-a-Lot
|
E dobro je ovo, samo jos da stavite neku fancy transparenciju ..
__________________
Do not ask yourself what the world needs. Ask yourself what makes you come alive, and then go do that. Because what the world needs is people who have come alive |
11. 02. 2006. | #16 | |
expert
Master
Datum učlanjenja: 20.12.2005
Poruke: 730
Hvala: 0
0 "Hvala" u 0 poruka
|
Citat:
Kada se show_popup pozove moras da kreiras novi popup, sa document.createElement ili document.body.innerHTML i da ga uklonis iz DOM stabla nakon hide_popup. Zasto? Da bi mogao da imas vise popupova sto ti je nuzno za fadeout efekt Fadeout - samo menjas stilove opacity;-khtml-opacity,-moz-opacity i filter:Alpha(opacity) ili kako vec bese za IE u petlji. Ovo vec sljaka na http://maestitia.net/ meni zasada bolje ne treba. |
|
12. 02. 2006. | #17 |
expert
Master
Datum učlanjenja: 20.12.2005
Poruke: 730
Hvala: 0
0 "Hvala" u 0 poruka
|
Sto vise radim na ovome, sve vise lici na overlib :)
Kôd:
function show_popup(e){ var evt=e; var tekst=document.createTextNode(this.title); if(typeof(e)!='object')evt=event; var popup=document.getElementById('popup'); var x,y,ix,iy,ox=10,oy=10; if (self.innerHeight&&self.pageYOffset) // all except Explorer { ix = self.innerWidth; iy = self.innerHeight; x=self.pageXOffset; y=self.pageYOffset; } else if (document.documentElement && document.documentElement.clientHeight&&document.documentElement.scrollTop) // Explorer 6 Strict Mode { ix = document.documentElement.clientWidth; iy = document.documentElement.clientHeight; x=document.documentElement.scrollLeft; y=document.documentElement.scrollTop; } else if (document.body) // other Explorers { ix = document.body.clientWidth; iy = document.body.clientHeight; x=document.body.scrollLeft; y=document.body.scrollTop; } popup.appendChild(tekst); this.title=""; if(ix<(evt.clientX+ox+popup.clientWidth)){ ox=-(popup.clientWidth); } if(iy<(evt.clientY+oy+popup.clientHeight)){ oy=-(popup.clientHeight); } popup.style.visibility="visible"; popup.style.top=y+evt.clientY+oy+"px"; popup.style.left=x+evt.clientX+ox+"px";} function hide_popup(){ var popup=document.getElementById("popup"); this.title=popup.innerHTML;popup.innerHTML=""; popup.style.visibility="hidden"; } function init(){ var agt=navigator.userAgent.toLowerCase(); var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)); var is_mac = (agt.indexOf("mac")!=-1); if(document.getElementById&&!(is_ie&&is_mac)){ document.body.innerHTML=document.body.innerHTML+"<div class='popup' id='popup'></div>"; var links=document.getElementsByTagName('a'); for(var i=0;i<links.length;i++){ if(links[i].title!=""){ links[i].onmousemove=show_popup; links[i].onmouseover=show_popup; links[i].onmouseout=hide_popup;}}}} Fixed: popup se prikazuje iznad kursora ako je link suvise nisko |
12. 02. 2006. | #18 | |
Ivan Dilber
Sir Write-a-Lot
|
Citat:
Imao sam nekih problema nedavno sa transparencijom, pa ajde molim te pojasni ovo, mozda mi ustedis besane noci Btw, jedan predlog...kad se doda ovaj overlay, trebalo bi pobrisati title za linkove (ili alt ako je slika), to bi trebalo da resi problem sa baloncicem koji otvori browser...
__________________
Leadership is the art of getting people to want to do what you know must be done. |
|
12. 02. 2006. | #19 |
expert
Master
Datum učlanjenja: 20.12.2005
Poruke: 730
Hvala: 0
0 "Hvala" u 0 poruka
|
Pa i brise title, ne brise alt u slikama, to ce i meni da treba, ali se to lako doda, tako sto ubacimo i init za slike ako imaju title, pa brisemo i alt, veruj na rec ;-)
Ako menjas transparenciju postojecem divu a korisnik predje na sledeci link, sta onda biva? Zato treba vise od jednog diva da bi imao dobar fadeout kad korisnik predje na sledeci link, a fadeout se nije zavrsio. |
12. 02. 2006. | #20 |
expert
Master
Datum učlanjenja: 20.12.2005
Poruke: 730
Hvala: 0
0 "Hvala" u 0 poruka
|
@ivanhoe
Kôd:
function init(){ var agt=navigator.userAgent.toLowerCase(),i; var is_ie=((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)); var is_mac=(agt.indexOf("mac")!=-1); if(document.getElementById&&!(is_ie&&is_mac)){ document.body.innerHTML=document.body.innerHTML+"<div class='popup' id='popup'></div>"; var links=document.getElementsByTagName('a'); var slike=document.getElementsByTagName('img'); for(i=0;i<links.length;i++){ if(links[i].title!=""){ links[i].onmousemove=show_popup; links[i].onmouseover=show_popup; links[i].onmouseout=hide_popup; } } if (is_ie) { // nasli smo IE for(i=0;i<slike.length;i++){ slike[i].alt=""; // brisi alt property na svim slikama } } } } |
|
|
Slične teme | ||||
Tema | Početna poruka teme | Forum | Odgovori | Poslednja poruka |
Kohana display event | ivanhoe | Web aplikacije, web servisi i software | 4 | 30. 09. 2009. 00:27 |
Lose Organizovan Vista Event | Dejan Bizinger | Opušteno | 5 | 01. 03. 2007. 19:46 |
<select> onClose event | godza | (X)HTML, JavaScript, DHTML, XML, CSS | 14 | 23. 07. 2006. 20:04 |