【发布时间】:2009-06-09 11:51:50
【问题描述】:
如何将 5 个点击功能合二为一?例如
$("div#styleswitcher a.green").click(function () {
$("container").css({ 'background': 'green' });
});
$("div#styleswitcher a.blue").click(function () {
$("container").css({ 'background': 'blue' });
});
$("div#styleswitcher a.red").click(function () {
$("container").css({ 'background': 'red' });
});
$("div#styleswitcher a.yellow").click(function () {
$("container").css({ 'background': 'yellow' });
});
【问题讨论】:
标签: javascript jquery css