jQuery(function() { jQuery(".subPhoto li").click(function(){ var suImgURL = jQuery(this).find("img").attr('src'); jQuery('.mainPhoto img').attr('src', suImgURL); jQuery(this).addClass('active'); jQuery('.subPhoto li').not(this).removeClass('active'); }); }); jQuery(function() { jQuery(".subPhoto2 li").click(function(){ var suImgURL = jQuery(this).find("img").attr('src'); jQuery('.mainPhoto2 img').attr('src', suImgURL); jQuery(this).addClass('active'); jQuery('.subPhoto2 li').not(this).removeClass('active'); }); }); /*jshint browser: true, jquery: true*/ jQuery(function() { var attendance = jQuery('.post-title'); // 2回使うので変数に入れて処理削減 var attendanceHtmlArray, attendanceThis; attendance.each(function() { // class="post-title"が複数あるかもしれないのですべてに対して処理 attendanceThis = jQuery(this); // 3回使うので変数に入れて処理削減(thisはここではn個目のclass="post-title"を表します) attendanceHtmlArray = attendanceThis.html().split('
'); // thisのHTMLを取得し、hr要素で分割して配列に代入 attendanceThis.empty(); // thisの内容を削除 jQuery(attendanceHtmlArray).each(function(index) { // attendanceHtmlArrayの各要素に対して処理 attendanceThis.append(function() { // thisの最後に追加 if(attendanceHtmlArray[index].indexOf('本日出勤 栄') != -1) { // 「本日出勤 栄」という文字列が含まれたら return '' + attendanceHtmlArray[index] + ''; } else if(attendanceHtmlArray[index].indexOf('本日出勤 名駅') != -1) { // 「本日出勤 名駅」という文字列が含まれたら return '' + attendanceHtmlArray[index] + ''; } else if(attendanceHtmlArray[index].indexOf('本日出勤 伏見') != -1) { // 「本日出勤 伏見」という文字列が含まれたら return '' + attendanceHtmlArray[index] + ''; } else if(attendanceHtmlArray[index].indexOf('本日出勤 千種・今池') != -1) { // 「本日出勤 千種・今池」という文字列が含まれたら return '' + attendanceHtmlArray[index] + ''; } else if(attendanceHtmlArray[index].indexOf('本日出勤 金山') != -1) { // 「本日出勤 金山」という文字列が含まれたら return '' + attendanceHtmlArray[index] + ''; } else { // 「上記全て」の文字列が含まれていなかったら return attendanceHtmlArray[index] + '
'; } }); }); }); }); /*jshint browser: true, jquery: true*/ jQuery(function() { var attendance = jQuery('.attendance'); // 2回使うので変数に入れて処理削減 var attendanceHtmlArray, attendanceThis; attendance.each(function() { // class="attendance"が複数あるかもしれないのですべてに対して処理 attendanceThis = jQuery(this); // 3回使うので変数に入れて処理削減(thisはここではn個目のclass="attendance"を表します) attendanceHtmlArray = attendanceThis.html().split('
'); // thisのHTMLを取得し、hr要素で分割して配列に代入 attendanceThis.empty(); // thisの内容を削除 jQuery(attendanceHtmlArray).each(function(index) { // attendanceHtmlArrayの各要素に対して処理 attendanceThis.append(function() { // thisの最後に追加 if(attendanceHtmlArray[index].indexOf('栄') != -1) { // 「栄」という文字列が含まれたら return '' + attendanceHtmlArray[index] + ''; } else if(attendanceHtmlArray[index].indexOf('伏見') != -1) { // 「伏見」という文字列が含まれたら return '' + attendanceHtmlArray[index] + ''; } else if(attendanceHtmlArray[index].indexOf('千種・今池') != -1) { // 「千種・今池」という文字列が含まれたら return '' + attendanceHtmlArray[index] + ''; } else if(attendanceHtmlArray[index].indexOf('名駅') != -1) { // 「名駅」という文字列が含まれたら return '' + attendanceHtmlArray[index] + ''; } else if(attendanceHtmlArray[index].indexOf('金山') != -1) { // 「金山」という文字列が含まれたら return '' + attendanceHtmlArray[index] + ''; } else { // 「上記全て」の文字列が含まれていなかったら return attendanceHtmlArray[index] + '
'; } }); }); }); }); /*jshint browser: true, jquery: true*/ jQuery(function() { var attendance = jQuery('.post-title'); // 2回使うので変数に入れて処理削減 var attendanceHtmlArray, attendanceThis; attendance.each(function() { // class="post-title"が複数あるかもしれないのですべてに対して処理 attendanceThis = jQuery(this); // 3回使うので変数に入れて処理削減(thisはここではn個目のclass="post-title"を表します) attendanceHtmlArray = attendanceThis.html().split('
'); // thisのHTMLを取得し、hr要素で分割して配列に代入 attendanceThis.empty(); // thisの内容を削除 jQuery(attendanceHtmlArray).each(function(index) { // attendanceHtmlArrayの各要素に対して処理 attendanceThis.append(function() { // thisの最後に追加 if(attendanceHtmlArray[index].indexOf('   ') != -1) { // 「   」という文字列が含まれたら return '' + attendanceHtmlArray[index] + ''; } else { // 「   」という文字列が含まれていなかったら return attendanceHtmlArray[index] + '
'; } }); }); }); });