0

Hi,

I have a icon which on mouseover action i'm changing to another icon little bigger and with a tooltip. This icon is placed inside a table row before the text data. When mouseover happens it moves the text data to right and new icon is displayed. I dont want the text to move to right.

Can anyone help me with this?

Below is the code that i'm using:

    <html>
<head>

<style type="text/css">
#contextual-action-icon:hover
{
    position:relative;
    bottom:12px;
    left:-3px;  
}
</style>

<script type="text/javascript" src="/C:/Users/ng/Documents/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $('#contextual-action-icon').live('mouseover mouseout mousedown click', function(event){
    if(event.type == 'mouseover')
        $(this).attr('src','/C:/Users/ng/Documents/Unnamed Site 1/core/images/tables/ipop_ovr.png');
    if(event.type == 'mouseout')
        $(this).attr('src','/C:/Users/ng ![Snap51](/attachments/small/3/Snap51.png "align-right") /Documents/Unnamed Site 1/core/images/tables/ipopglyph_sm_qualifier.png');
  });
});
</script>
</head>
<body>
<table border="1">
    <tr>
        <td> 
        <img id='contextual-action-icon' align='top' src='/C:/Users/ng/Documents/Unnamed Site 1/core/images/tables/ipopglyph_sm_qualifier.png' title='More...'/>
        Hi
        </td>
    </tr>
</table>
</body>
</html>

I have attached screenshots of the output.

Thanks in Advance,
VenusCrystal

Attachments Snap5.png 4.57 KB Snap6.png 5.23 KB
2
Contributors
4
Replies
6
Views
5 Years
Discussion Span
Last Post by VenusCrystal
0

VC,

You need to provide space around the small version of the icon, into which the large version will fit.

This can be done by adjusting the margins in CSS:

#contextual-action-icon
{
    width: 50px;
    height: 30px;
    margin: 3px;
}
#contextual-action-icon:hover
{
    width: 56px;
    height: 36px;
    margin: 0;
}

You may need to adjust this to get exactly what you want. The rules are simple:

  • width + horizontal margins = k_width
  • height + vertical margins = k_height

where k_width and k_height are constants (56px and 30px respectively in the example).

Airshow

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.