リストを個数毎に区切ってスタイルを指定する
- 2016.11.11
- Coding JavaScript
- リスト, 何個毎, 個数
$('li').each(function(index){
//3つごとに設定
if(Math.floor(index/3)%2==0){
//classを付加
$(this).css('color','blue');
}else{
$(this).css('color','red');
};
});
参考サイト
-
前の記事
ImageMagickが使用可能か確認する 2016.11.11
-
次の記事
サイトのキャチフレーズ(キャッチコピー)を呼び出す 2016.11.14