Hi CirTap,
I tried changing the value of the z-index but then the table vanishes and only the background image remains. This happens at z=3 and any value above 3.
Any other hints?
Ranjit
Main Topics
Browse All TopicsHI,
I am trying to get the effect of a text pop up on MouseOver event. I have the code for this from some website, used it in some of my pages and it works.
But now what i am trying to do is incorporate that effect in a page which has another effect--- that of making the background image resize as per the window size. The solution to this later part can be found at -
http://www.experts-exchang
I have implemented that at http://web.njit.edu/~ras5/
Now the problem is when i try to comdine both the effects i do not get the MouseOver text box. When i remove the code of background effect the text box does come. So i guess the text box hides behind the background when both effects are present. I do not know how to solve this problem.
The page containing the code for both the effects i am trying to achieve is at http://web.njit.edu/~ras5/
You can see the implementation of the code and the manner in which i am trying to achieve it by right clicking and viewing the source. Though the stretching of background is achieved.....the text pop up on mouseover does not appear when the mouse is over the first image.
Below i have given the individual codes for each effect-
--------------------------
For stretching background to window size--
<style type="text/css">
#backPic {
z-Index:0;
display:block;
position:absolute;
display:block;
left:0%;
top:0%;
width:100%;
height:100%;
}
/* make it sticky in non MSIE 5/6 */
html>body #backPic {
position:fixed;
}
#tbl {
border:2px solid red;
display:block;
z-index:2;
position:absolute;
left:0%;
top:0%;
width:100%;
/* for CSS2 browsers */
min-height:100%;
}
h1 {color:red;}
</style>
<script language="JScript">
<!-- /* MSIE only JScript !! */
function fixBgImage() {
if (document.all.backPic.styl
document.all.backPic.style
document.recalc();
}
}
ie5 = (document.all && document.getElementById && !document.fireEvent)?true:
ie55= (document.all && document.fireEvent && !document.createComment)?t
ie6 = (document.all && document.fireEvent && document.createComment)?tr
if (!window.opera && (ie5 || ie55 || ie6)) onload=fixBgImage;
// -->
</script>
<body topmargin="0" leftmargin="0">
<img src="images/castlecopy.jpg
--------------------------
--------------------------
For getting pop up text box on MouseOver--
<DIV ID="dek"></DIV>
<SCRIPT TYPE="text/javascript">
<!--
//Pop up information box II (Mike McGrath (mike_mcgrath@lineone.net,
//Permission granted to Dynamicdrive.com to include script in archive
//For this and 100's more DHTML scripts, visit http://dynamicdrive.com
Xoffset=-60; // modify these values to ...
Yoffset= 20; // change the popup position.
var old,skn,iex=(document.all)
var ns4=document.layers
var ns6=document.getElementByI
var ie4=document.all
if (ns4)
skn=document.dek
else if (ns6)
skn=document.getElementByI
else if (ie4)
skn=document.all.dek.style
if(ns4)document.captureEve
else{
skn.visibility="visible"
skn.display="none"
}
document.onmousemove=get_m
function popup(msg,bak){
var content="<TABLE WIDTH=150 BORDER=1 BORDERCOLOR=black CELLPADDING=2 CELLSPACING=0 "+
"BGCOLOR="+bak+"><TD ALIGN=center><FONT COLOR=black SIZE=2>"+msg+"</FONT></TD>
yyy=Yoffset;
if(ns4){skn.document.write
if(ns6){document.getElemen
if(ie4){document.all("dek"
}
function get_mouse(e){
var x=(ns4||ns6)?e.pageX:event
skn.left=x+Xoffset;
var y=(ns4||ns6)?e.pageY:event
skn.top=y+yyy;
}
function kill(){
yyy=-1000;
if(ns4){skn.visibility="hi
else if (ns6||ie4)
skn.display="none"
}
//-->
</SCRIPT>
Usage example-
<td width="33%" align="center">
<a href="../../images/pics/mi
ONMOUSEOVER="popup('Playin
<img border="2" src="../../images/pics/mis
--------------------------
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi,
I found the error. The problem was with the index........but that was because i forgot to paste the following lines :
<STYLE TYPE="text/css">
<!--
#dek {POSITION:absolute;VISIBIL
//-->
</STYLE>
BUt i have one more question related to this effect-
How can i achieve the watermark effect with this code? I tried placing the bgproperties = fixed in the body tag but it does not achieve that effect. Any possibility to achieve that effect for this same image stretchable code?
I know the heading os this question is slightly different from what i am writing now but that is mainly because i solved that problem and now i am trying to achieve another effect .....using the same points i have allocated!! :)
I have not been able to get the watermark effect as yet inspite of me trying to play around with the code given above (courtesy- Cirtap) and using the CSS parameter - background-attachment:fixe
(Actually i doubt the watermark feature can work for the code because it was meant to stretch the image as per the page size which it does successfully)
So i found this other javascript given below(from the link: http://www.webreference.co
--------------------------
<HEAD>
<SCRIPT LANGUAGE="JavaScript1.2">
<!--
NS4 = (document.layers);
IE4 = (document.all);
scaleWidth = true;
scaleHeight = true;
imSRC = "skiff.jpg";
if (NS4) window.onload = setResize;
function setResize(){
setTimeout("window.onresiz
}
function reDo(){
window.location.reload()
}
if (IE4) window.onresize = reDoIE;
function reDoIE(){
imBG.width = document.body.clientWidth;
imBG.height = document.body.clientHeight
}
function makeIm() {
winWid = (NS4) ? innerWidth : document.body.clientWidth;
winHgt = (NS4) ? innerHeight : document.body.clientHeight
imStr = "<DIV ID=elBGim"
+ " STYLE='position:absolute;l
+ "<IMG NAME='imBG' BORDER=0 SRC=" + imSRC;
if (scaleWidth) imStr += " WIDTH=" + winWid;
if (scaleHeight) imStr += " HEIGHT=" + winHgt;
imStr += "></DIV>";
document.write(imStr);
}
//-->
</SCRIPT>
</HEAD>
<BODY MARGINHEIGHT=0 MARGINWIDTH=0>
<SCRIPT LANGUAGE="JavaScript1.2">
<!--
makeIm();
//-->
</SCRIPT>
.
. remainder of page HTML
.
----------------------
Business Accounts
Answer for Membership
by: cirtapPosted on 2003-07-05 at 17:40:14ID: 8862367
Hi,
it's probably because of a z-index problem with 'dek' layer. Try to raise it to some barge number (100 or so) so it'll always appear above other positioned elements.
Althought the backPic has a z-index of 0 does not mean the layer might get overed by some other element.
Have fun,
CirTap