I m trying to invoke a click on first .loader
child when document is ready, but no success:
html:
<a class="loader" data-target="david-boy" title="Danny Boy-Rivera">
<span class="img"><span class="play"></span><img src="img/gallery-image1.jpg" alt="" /></span>
<h2>Danny Boy</h2>
</a>
j 质量:
//Does not work
$( a.loader:first-child ).bind( click );
$( a.loader:first-child ).trigger( click );
$( a.loader:first-child ).click();
//Works
$( a.loader:first-child ).css("background", "red");
任何想法为什么?
Update
Handler:
$( .loader ).click(function(){
var name=$(this).data("target");
callVideo(name);
});
Update2
因此,问题是,我已宣布“<条码>:第一-儿童条码>在手上采取行动。 我改变了他们的地点和一切ok。