CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2002
    Location
    France
    Posts
    6

    how can i swap images and change the second image position

    i want to swap 2 images and to change the swapped img position so when i put the mouse over some text it will make the first image desapear and shw the second image bellow the text by getting the x and y coordinates of the text
    can any one help

  2. #2
    Join Date
    Jul 2002
    Location
    Don't Know, Don't Care
    Posts
    346
    woh woh woh, hold 'er down there killer, there's a much easier way to do this than getting the x and y coordinates of the text.
    And what you're doing sounds to me like it's not really an image swap in the normal sense. I think that this would be much easier.
    Code:
    <!--in the head-->
    <style type="text/css">
    #img1{position:absolute; top:0px;left:0px;visibility:"visible"}
    #text1{position:absolute;top:210px;left:0px;visibility:"visible"}
    #img2{position:absolute;top:240px;left:0px;visibility:"hidden"}
    </style>
    
    
    <!--in the body-->
    <img id="img1" src="image1.jpg" height="200px" width="50px">
    <div id="text1"height="20px" onmouseover="javascript:document.all.img1.style.visibility='hidden';document.all.img2.style.visibility='visible';" onmouseout="javascript:document.all.img1.style.visibilty='visible';document.all.img2.style.visibility='hidden';">
    Some Text Here
    </div>
    <img id="img2" src="image2.jpg" height="200px" width="50px">
    there you go
    much simpler, and you can adjust the positions anyway that you want to. good luck.

    C G C F A D--Feel the Noise

    "When your life goes nowhere and leads back to me, doesn't that tell you something?"
    ~Gray Area Fury

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

Featured