Results 1 to 7 of 7

Thread: [RESOLVED] CSS Layer Popup on mouseover...

  1. #1

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Resolved [RESOLVED] CSS Layer Popup on mouseover...

    say I have something like this for a layer:
    Code:
    div.image  { 
      position:absolute; visibility:hidden; 
      width:200px; left:10; top:10; z-index:500; 
      font-size:12px; 
      background-color: white;
      border: 3px solid;	
      border-color: black; 
      z-index:500;
    	}
    how would I make it appear / disappear on mouseover of a link
    I dont want anything fancy in the layer (like links etc) just a picture to
    appear near the mouse (and make sure its visible )

    do I need to use javascript? or can this all be done with CSS?

    thanks!
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  2. #2

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: CSS Layer Popup on mouseover...

    ok im close... using examples I have found I can get the image to appear/disappear...

    great.. but I can figure out how to make it appear near the link? offset a bit or something...

    when i start messing with the position: and change it to relative... it makes the link word move.. no good! lol

    Code:
    <HTML>
    	<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <head>
    	<meta http-equiv="Content-Type" content="text/html;charset=Windows-1252">
    <style type="text/css">
    <!--
    	body {position: relative; background: white; margin: 0; padding: 0;}
    	div#links a { text-align: left; font: bold 1em sans-serif;}
    	div#links a img {height: 0; width: 0; border-width: 0;}
    	div#links a:hover img {
    				position: absolute; 
    				top: 190px; 
    				left: 55px; 
    				height: 40px; 
    				width: 40px; 
    				border-width: 1px;
    				border-color: red}
    	div#links a:hover {color: red; border-width: 1px}
    -->
    </style>
    </head>
    <body>
    <p>this is a test. hover over <div id="links"><a href="">Test<img src="static_snow.gif"></a></p>
    </body>
    </html>
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: CSS Layer Popup on mouseover...

    ok.. wait.. sorry lol

    it just clicked that the image is part of the Link.. therefore u could click the image
    forget it.. I need some javascript I guess!
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: CSS Layer Popup on mouseover...

    Make the image a background instead... less markup = good

    And where is your closing </div> ?

    Code:
    /* CSS: */
    #links a
    {
        padding-right: 42px;  /* 40px plus 2px spacing */
        background: white;
    }
    
    #links a:hover
    {
        background: white url('static_snow.gif') center right no-repeat;
    }
    HTML:
    HTML Code:
    <body>
        <p id="links">this is a test. hover over <a href="">Test</a></p>
    </body>

  5. #5

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: CSS Layer Popup on mouseover...

    well. that does work .. sort of...
    but if u add text after the link.. there is a space where the image is ...
    and the image is only the height of the text....

    I want the image to appear.. like "Floating" over other stuff....
    so I think I have to use JScript.. right?
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  6. #6
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: CSS Layer Popup on mouseover...

    yeah, that would be easier

  7. #7

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: CSS Layer Popup on mouseover...

    ok.. found a good script. thanks!
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

Posting Permissions

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



Click Here to Expand Forum to Full Width