これがコードです。Button1 と button2 は未定義として表示されます。
$('.game_time').each(function() {
// bind_toggle($(this).find('a.preview_tweets.selected'), $(this).find('.with_tweets'),
// $(this).find('a.collapse_tweets'), $(this).find('.without_tweets'));
button1.click = function() {
if ($(this).find('a.preview_tweets.selected').hasClass('open')){
} else {
if ($(this).find('a.preview_tweets.selected').length == 0) {
get_preview_tweets('<%= game.away_team.url %>,<%= game.home_team.url %>',
3, '<%= game.id %>');
}
$(this).find('a.preview_tweets.selected').show()
$(this).find('a.preview_tweets.selected').addClass('open');
}
}
button2.click = function() {
if ($(this).find('a.preview_tweets.selected').hasClass('open')){
$(this).find('a.preview_tweets.selected').hide();
} else {
}
}
});
私はJavascriptに全く慣れていないので、明白なことがあれば申し訳ありません。