$.each(tools, function (i, tool) {
$("<img>", tool).appendTo($toolbar);
});
//define toolset (JSON, e.g. from database)...
var tools = [{
"data-id": 1,
alt: "sun",
title: "sun",
src: "http://cdn4.iconfinder.com/data/icons/iconsland-weather/PNG/48x48/Sunny.png",
"data-description": "sun in photo"
}, {
"data-id": 2,
alt: "snow",
title: "snow",
src: "http://cdn4.iconfinder.com/data/icons/iconsland-weather/PNG/48x48/Thermometer_Snowflake.png",
"data-description": "snow in photo"
}, {
"data-id": 3,
alt: "cloud",
title: "cloud",
src: "http://cdn4.iconfinder.com/data/icons/iconsland-weather/PNG/48x48/Overcast.png",
"data-description": "cloud in photo"
}, {
"data-id": 4,
alt: "rain",
title: "rain",
src: "http://cdn4.iconfinder.com/data/icons/iconsland-weather/PNG/48x48/Night_Rain.png",
"data-description": "rain in photo"
}];
初めて見たjQueryを見ています。何が起こるかはツールごとであり、JSON に記述された適切な属性を使用して img タグが作成されると思います。もしそうなら、私はそれは非常にきちんとしていると思います.この手法は、おそらくマニュアルまたは API ドキュメントのどこでより詳細に説明されているのでしょうか?
前もって感謝します...