这里我有jquery点击它只有当我点击一个li但我想让它在页面加载时工作请帮助...!
//User clicks on a city / gallery;
$fp_galleries.bind('click',function(){
$fp_galleries.removeClass('current');
var $gallery = $(this);
$gallery.addClass('current');
var gallery_index = $gallery.index();
if(gallery_idx == gallery_index)
return;
gallery_idx = gallery_index;
//close the gallery and slider if opened
if($fp_thumbContainer.data('opened')==true){
$fp_scrollWrapper.fadeOut();
$fp_thumbContainer.stop().animate({'height':'0px'},200,function(){
openGallery($gallery);
});
}
else
openGallery($gallery);
});
答案 0 :(得分:0)
使用load事件来调用li ...
上的click事件所以在load事件的主体中......执行$('#id_of_li').click()
;
或者......将点击的主体移动到另一个功能并在点击和加载中调用它?