views:

239

answers:

3

I have an unordered list in this format:

  <ul>
    <li><img src="yahoo.jpg"/></li>
    <li><img src="google.jpg"/></li>
  </ul>

What I want is when I double click on any image, a jquery pop up open with full image.

Thanks for help.

+1  A: 

no one will ever do a double click on an image on a website but you could setup a clickcounter and if(clickcounter > 1) doStuff();

antpaw
+1  A: 
$("ul li img").dblclick(function(){

  var src = $(this).attr("src");

  // popup code here..
  // um.. which jquery popup plugin?

});

or.. you should try using jQuery plugin for image gallery. try fancy box or jquery lightbox plugin

with jquery lightbox, you just call lightbox() function

$('ul li a').lightBox();
Anwar Chandra
He asked for double-click.
Herb Caudill
yes i ask for double click not single click.
air
sorry misread your question. now updated with dblclick function..
Anwar Chandra
+1  A: 

you can use this function

  $(document).ready(function() {
    $("li").bind("dblclick", function(){
    var src = $(this).attr("id");
    alert(src);
 });

 })

i use alert, but you can open any jquery box.