// 起動時の処理 $(document).ready(function(){ // colorboxの設定 $(".group1").colorbox({rel:'group1', transition:"none", width:"75%", height:"75%"}); $(".youtube").colorbox({iframe:"true", innerWidth:"70%", innerHeight:"70%"}); }); $(function(){ $("#btSearch").click(function(){ if($("#keyword").val().length == 0){ alert("キーワードを入力してください"); }else{ $("#fmSearch").submit(); } }); // ■検索ボックスのカテゴリー $("#slCategory").change(function(){ var category = $(this).val(); $("#fmSearch").prop("action", "/" + category + "/item/"); }); $("#keyword").focus(function(){ $(this).select(); }); // ■掲示板書き込み $("#btBbsRegister").click(function(){ var asin = $("#bbsAsin").val(); var name = $("#bbsName").val(); var message = $("#bbsMessage").val(); var response = $("input[name='bbsResponse']:checked").val(); if(message.length == 0){ alert("メッセージを入力してください"); return false; } $.ajax({ type: "POST", url: "/ajax/doRegisterBbs/", data: { asin: asin, name: name, message: message, response: response }, success: function(msg){ if(msg.length > 0){ alert(msg); }else{ location.reload(); } } }); }); $(".btThumb").click(function(){ var no = $(this).data('no'); $.ajax({ type: "POST", url: "/ajax/doGoodBbs/", data: { no: no }, success: function(msg){ if(msg.length > 0){ alert(msg); }else{ location.reload(); } } }); }); });