我有以下功能我希望能夠做的哪些工作得非常好內$(document).ready(function(){
發送參數到jQuery函數
$('.threadWrapper > .littleme').click(function() {
$(this).next().toggle();
$(this).toggle();
$('.littleme').not(this).next().hide();
$('.littleme').not(this).show();
// re-run masonry
$('#mainContent').masonry();
return false;
}).next().hide();
是內嵌調用該JavaScript包含threadWrapper類中的每個div元素也有自己的ID。我想要做的就是能夠使用內聯JavaScript調用併發送一個id作爲參數來觸發此函數。例如:
$(function(id){
$('#id > .littleme').next().toggle();
$('#id > .littleme').toggle();
etc. etc.
});