views:

36

answers:

2

I just tried the tooltip like this Easy image preview... But i cant get it to work....

I used this,

<style>
body {
    margin:0;
    padding:40px;
    background:#fff;
    font:80% Arial, Helvetica, sans-serif;
    color:#555;
    line-height:180%;
}

h1{
    font-size:180%;
    font-weight:normal;
    color:#555;
}
h2{
    clear:both;
    font-size:160%;
    font-weight:normal;
    color:#555;
    margin:0;
    padding:.5em 0;
}
a{
    text-decoration:none;
    color:#f30; 
}
p{
    clear:both;
    margin:0;
    padding:.5em 0;
}
pre{
    display:block;
    font:100% "Courier New", Courier, monospace;
    padding:10px;
    border:1px solid #bae2f0;
    background:#e3f4f9; 
    margin:.5em 0;
    overflow:auto;
    width:800px;
}

img{border:none;}
ul,li{
    margin:0;
    padding:0;
}
li{
    list-style:none;
    float:left;
    display:inline;
    margin-right:10px;
}



/*  */

#preview{
    position:absolute;
    border:1px solid #ccc;
    background:#333;
    padding:5px;
    display:none;
    color:#fff;
    }

/*  */
</style>
<script type="text/javascript" src="jquery.js"></script>

<ul>
  <li>
     <a href="Images/4.jpg" class="preview" title="Lake and a mountain">
          <img src="Images/4s.jpg" alt="gallery thumbnail" />
    </a>
  </li>
</ul>

and included style... Nothing happens when i hover over the anchor tag....

+1  A: 

You have included jquery.js, but not main.js, which is the second script on the example you gave.

<script src="jquery.js" type="text/javascript"></script>
<script src="main.js" type="text/javascript"></script>
Sohnee
@sohnee just now figured it out and got it working
Pandiya Chendur
+1  A: 

They are using a jQuery plugin to do this. See main.js file and there you can see the image preview script.

rahul
@rahul ya just found it using firebug and included the js... The tooltip works.... Firebug rocks
Pandiya Chendur