SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Non-Member
    Join Date
    Sep 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    POPUP BOXwith image

    the follwing is the code for a onmouseover popup box..
    i want to add an image to the popup box...
    i tried using the image (<img src="">) but didnt work out
    the parameters for popup function is passed in the anchor tag.


    Code:
    <SCRIPT TYPE="text/javascript">
    
    Xoffset=-60;    
    Yoffset= 20;    
    
    var old,skn,iex=(document.all),yyy=-1000;
    
    var ns4=document.layers
    var ns6=document.getElementById&&!document.all
    var ie4=document.all
    
    if (ns4)
    skn=document.dek
    else if (ns6)
    skn=document.getElementById("dek").style
    else if (ie4)
    skn=document.all.dek.style
    if(ns4)document.captureEvents(Event.MOUSEMOVE);
    else{
    skn.visibility="visible"
    skn.display="none"
    }
    document.onmousemove=get_mouse;
    
    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></TABLE>";
    yyy=Yoffset;
     if(ns4){skn.document.write(content);skn.document.close();skn.visibility="visible"}
     if(ns6){document.getElementById("dek").innerHTML=content;skn.display=''}
     if(ie4){document.all("dek").innerHTML=content;skn.display=''}
    }
    
    function get_mouse(e){
    var x=(ns4||ns6)?e.pageX:event.x+document.body.scrollLeft;
    skn.left=x+Xoffset;
    var y=(ns4||ns6)?e.pageY:event.y+document.body.scrollTop;
    skn.top=y+yyy;
    }
    
    function kill(){
    yyy=-1000;
    if(ns4){skn.visibility="hidden";}
    else if (ns6||ie4)
    skn.display="none"
    }
    
    //-->
    </SCRIPT>

  2. #2
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi uniaxaj,

    Welcome to SPF!

    What browser are you testing with?

    I'll be honest with you - that code has many problems. But we do want to help you. Do you want us to help you re-write it?

  3. #3
    Non-Member
    Join Date
    Sep 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation

    ok now let me be honest with you...

    ima total newbie in javascript

    i downloaded this code...
    so i dunno how to rewrite it.

    please help me with this......
    is it possible to add an image into the popup box?

  4. #4
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There are lots of others to download. Have a look at this one: overLib.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •