Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strike><a href="http://jsfiddle.net/jaspermogg/pFyNY/1/" rel="nofollow noreferrer">http://jsfiddle.net/jaspermogg/pFyNY/1/</a> - you can double click the div to edit, or single click the link to open. That what you wanted?</p> <pre><code>$('.a0').dblclick(function(e){ e.preventDefault(); $(this).parent().find('input').val($(this).find('a').text()).show().focus(); $(this).hide(); }) $('#url0, #url1').each( function(index, element){ $(element).blur(function(){ $(this).hide().prev().show().find('a').html(this.value); }) } ); </code></pre> <p>And here's a jsFiddle that changes the href of the <code>a</code> to the value you edited it to, just in case that's what you're trying to do next :-) <a href="http://jsfiddle.net/jaspermogg/pFyNY/2/" rel="nofollow noreferrer">http://jsfiddle.net/jaspermogg/pFyNY/2/</a> </strike></p> <p>Here's the jsFiddle that does what you want - <a href="http://jsfiddle.net/jaspermogg/pFyNY/5/" rel="nofollow noreferrer">http://jsfiddle.net/jaspermogg/pFyNY/5/</a></p> <p>JS -</p> <pre><code>$('.a0 a').click(function(){ var href = $(this).attr('href'); // Redirect only after 500 milliseconds (CHANGE THE 500 IN THE CODE TO DETERMINE HOW LONG THE USER GETS TO DBLCLICK) if (!$(this).data('timer')) { $(this).data('timer', setTimeout(function () { window.location = href; }, 500)); } return false; // Prevent default action (redirecting) }); $('.a0').dblclick(function(){ clearTimeout($(this).find('a').data('timer')); $(this).find('a').data('timer', null); $(this).parent().find('input').val($(this).find('a').text()).show().focus(); $(this).hide(); }) $('#url0, #url1').each( function(index, element){ $(element).blur(function(){ $(this).hide().prev().show().find('a').html(this.value); }) } ); </code></pre> <p>Inspired by <a href="https://stackoverflow.com/questions/4818085/jquery-create-double-click-event-on-a-href">Jquery create Double Click event on A Href</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload