상품보기 유형 변경 코드를 파일에 분리해서 저장

This commit is contained in:
chicpro
2013-08-08 14:25:58 +09:00
parent 21e5ac6108
commit 0da7ccb589
7 changed files with 71 additions and 62 deletions

28
shop/list.sub2.php Normal file
View File

@ -0,0 +1,28 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<script>
// 리스트 타입 쿠키가 있을 경우 바로 적용
if(itemlist_type = get_cookie("ck_itemlist_type")) {
if(itemlist_type == "gallery") {
$("ul.sct").removeClass("sct_13");
set_cookie("ck_itemlist_type", "gallery", 1, g4_cookie_domain);
} else {
$("ul.sct").addClass("sct_13");
set_cookie("ck_itemlist_type", "list", 1, g4_cookie_domain);
}
}
$(function() {
$("button.sct_lst_view").on("click", function() {
if($(this).hasClass("sct_lst_gallery")) {
$("ul.sct").removeClass("sct_13");
set_cookie("ck_itemlist_type", "gallery", 1, g4_cookie_domain);
} else {
$("ul.sct").addClass("sct_13");
set_cookie("ck_itemlist_type", "list", 1, g4_cookie_domain);
}
});
});
</script>