jquery ajax ページの読み込みが少し遅いと思います。onClick ハンドラーで href をクリックすると、応答しないことがあり、ダブルクリックする必要がありますか? どうすればこれを回避できますか?
<a target="_blank" class="arrow" href="javascript:void();"
onclick="f(\"value",\"value\");return false;">
<div class="teaser">
<h3></h3>
<p class="subheadline"></p>
<hr class="divider">
<p></p>
</div>
<img height="353" class="img" src="example.jpg" width="374">
</a>
空の h3 タグと p タグが原因でしょうか? ちょっと鈍い感じ??
私の関数 f は次のとおりです。
function f (url, id)
{
var btn = $(this);
if (btn.data('running'))
return;
$j('#tx #singleview').empty();
btn.data('running', true);
url="http://"+url+"index.php?id="+id+"&eID=tx";
url_stack.push(url);
$j.getJSON(url, function(json) {
$('#container').css({
"z-index" : "-100",
"margin-left" : "148",
"top" : "-800"
})
$('#container').animate({
"opacity": "0.0",
"top": '+=800'
}, 900, function() {
// Animation complete.
});
var singleview = $j('#tx #singleview');
singleview.css({
"position": "relative",
"top": "-800px",
"height": "800px"
})
singleview.append($j("#singleviewTemplate").tmpl(json).css({
"visibility": "visible",
"position": "relative"
}));
singleview.animate({
opacity: 100.0,
top: 0
}, 900, function() {
// Unset it here, this lets the button be clickable again
btn.data('running', false);
});
});
}