22-10-2007, 23:33
|
|
|
|
חבר מתאריך: 01.05.06
הודעות: 7,861
|
|
הפעם - עובד בIE, ולא עובד בFF - חלון צף.
למעשה נכנסתי חזק קצת לJS היום, והחלטתי לנסות לבנות חלון צף.
עם עזרה של קישורים פה ושם, הצלחתי בערך לעשות הכל חוץ מתאימות לדפדפנים.
להלן הקובץ:
https://2007-uploaded.fresh.co.il/2...3/74161236.html
אשר כפי שתוכלו לבדוק בעצמכם, עובד בexplorer ולא עובד כראוי בFireFox.
הקוד:
קוד:
<div onmousemove="show(event)" onmouseout="hide()" style="display:inline; cursor:default">
<u>this area is decorated by comment</u>,
</div>
and only this poor text is lonly...
<div id="pop" style="background:#efefef;border:1px solid gray;">Some comment</div>
<script type="text/javascript">
var pop = document.getElementById("pop");
pop.style.display = 'none';
function detectBrowser() {
if (document.all)
return 'IE';
else
return 'NS';
}
function show(event) {
version = detectBrowser(); //finds your browser.
pop.style.position = 'absolute';
pop.style.zIndex = 2;
pop.style.left = ((version == 'IE') ? (event.x+document.body.scrollLeft) : (event.pageX))+15;
pop.style.top = ((version == 'IE') ? (event.y+document.body.scrollTop) : (event.pageY))+10;
pop.style.display = 'inline';
}
function hide() {
pop.style.display = 'none';
}
</script>
|