JQuery click function requiring 2 clicks
<p>I've recently encountered a problem, and despite coming across similar questions here alreadt, none of the answers provided appear to work for me.</p>

<p>I have a jQuery click function, and an 'onclick' function on the same link (it shows a hidden div, and pops up a window - the intention being for both to happen at the same time).  At the moment, when the link is clicked, the popup works fine, but it requires a second click for the hidden div to show - the popup showing again on that second click.</p>

<p>I've tried a few things, like moving the script to the bottom of the page (didn't work at all), and also removing the onclick event altogether - but the 'show' aspect always seems to require 2 clicks.</p>

<p>Any pointers would be much appreciated!  My code is below;</p>

<pre><code>&lt;script language="javascript"&gt;
jQuery(document).ready(function() {
$(".show").click(function(){
var left = $(this).next('span').css('left');
if ( left == '3px') {
$(this).next('span').animate({left:'148px'}, 1000);
} else {
$(this).next('span').animate({left:'3px'}, 1000);
}
return false;
});
});
&lt;/script&gt;

&lt;script type="text/javascript"&gt;
function showPopup(url) {
newwindow=window.open(url,'name','height=190,width=520,top=200,left=300,resizable');
if (window.focus) {this.window.focus()}
}
&lt;/script&gt;

&lt;!--- In Page ---&gt;
&lt;div class="coupon"&gt;&lt;a href="/relevantpage.html" onclick="showPopup(this.href);return(false);"   class="show"&gt;&lt;/a&gt;&lt;span class="code"&gt;ABC1&lt;/span&gt;&lt;/div&gt;
</code></pre>
