Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Sep 2007
    Posts
    27
    Thanks
    7
    Thanked 0 Times in 0 Posts

    hovering alt tagin css

    Does anyone no how to make a hovering icon i when you hover over an image i have seen it done it almost looks like a styled alt tag bi need it to come up in random places i have tried hoover with transparencey in places but cant ge anything to work

  • #2
    Senior Coder BarrMan's Avatar
    Join Date
    Feb 2005
    Location
    Israel.
    Posts
    1,644
    Thanks
    69
    Thanked 83 Times in 82 Posts
    You can't do that with HTML/CSS, You will need to use JavaScript for that.
    User a function that gets your mouse coordinates and then presents a box using the value of your mouse coordinates to locate the message box.

    Should be something like this:
    Code:
    function showBox()
    {
    var x = window.event.clientX + document.scrollLeft;
    var y = window.event.clientY + document.scrollTop;
    var obj = document.getElementById("msgBox"); //msgBox = the id of the box
    obj.style.left = x + "px";
    obj.style.top = y + "px";
    obj.style.display = "block";
    }

  • #3
    New Coder
    Join Date
    Sep 2007
    Posts
    27
    Thanks
    7
    Thanked 0 Times in 0 Posts
    can you tll me how i would assign this to an object s or image if i put that in the css do i need to make the image a link befor it works


  •  

    Posting Permissions

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