Merge branch 'master' of github.com:gnuboard/yc4s
This commit is contained in:
BIN
shop/img/is_list_style.gif
Normal file
BIN
shop/img/is_list_style.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 318 B |
@ -2,5 +2,7 @@
|
||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
?>
|
||||
|
||||
<button type="button" class="sct_lst_view sct_lst_list">리스트뷰</button>
|
||||
<button type="button" class="sct_lst_view sct_lst_gallery">갤러리뷰</button>
|
||||
<div id="sct_lst">
|
||||
<button type="button" class="sct_lst_view sct_lst_list"><span></span>리스트뷰</button>
|
||||
<button type="button" class="sct_lst_view sct_lst_gallery"><span></span>갤러리뷰</button>
|
||||
</div>
|
||||
@ -3,26 +3,80 @@ 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);
|
||||
$.fn.listType = function(type)
|
||||
{
|
||||
var $el = this.find("li.sct_li");
|
||||
var count = $el.size();
|
||||
if(count < 1)
|
||||
return;
|
||||
|
||||
$el.each(function() {
|
||||
var st = $(this).attr("style");
|
||||
if(st) {
|
||||
$(this).data("style", st);
|
||||
}
|
||||
});
|
||||
|
||||
if(type == "gallery") {
|
||||
this.removeClass("sct_40");
|
||||
$el.each(function() {
|
||||
if($(this).data("style")) {
|
||||
$(this).attr("style", $(this).data("style"));
|
||||
}
|
||||
});
|
||||
set_cookie("ck_itemlist<?php echo $ca_id; ?>_type", "gallery", 1, g4_cookie_domain);
|
||||
$("button.sct_lst_gallery span").addClass("sct_lst_on").html("<b class=\"sound_only\">활성</b>");
|
||||
} else {
|
||||
$("ul.sct").addClass("sct_13");
|
||||
set_cookie("ck_itemlist_type", "list", 1, g4_cookie_domain);
|
||||
this.addClass("sct_40");
|
||||
$el.each(function() {
|
||||
if($(this).data("style")) {
|
||||
$(this).attr("style", "");
|
||||
}
|
||||
});
|
||||
set_cookie("ck_itemlist<?php echo $ca_id; ?>_type", "list", 1, g4_cookie_domain);
|
||||
$("button.sct_lst_list span").addClass("sct_lst_on").html("<b class=\"sound_only\">활성</b>");
|
||||
}
|
||||
}
|
||||
|
||||
// 리스트 타입 쿠키가 있을 경우 바로 적용
|
||||
if(itemlist_type = get_cookie("ck_itemlist<?php echo $ca_id; ?>_type")) {
|
||||
$("ul.sct").listType(itemlist_type);
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$("button.sct_lst_view").on("click", function() {
|
||||
var $el = $("ul.sct").find("li.sct_li");
|
||||
var count = $el.size();
|
||||
if(count < 1)
|
||||
return false;
|
||||
|
||||
$el.each(function() {
|
||||
var st = $(this).attr("style");
|
||||
if(st) {
|
||||
$(this).data("style", st);
|
||||
}
|
||||
});
|
||||
|
||||
if($(this).hasClass("sct_lst_gallery")) {
|
||||
$("ul.sct").removeClass("sct_13");
|
||||
set_cookie("ck_itemlist_type", "gallery", 1, g4_cookie_domain);
|
||||
$("ul.sct").removeClass("sct_40");
|
||||
$el.each(function() {
|
||||
if($(this).data("style")) {
|
||||
$(this).attr("style", $(this).data("style"));
|
||||
}
|
||||
});
|
||||
set_cookie("ck_itemlist<?php echo $ca_id; ?>_type", "gallery", 1, g4_cookie_domain);
|
||||
} else {
|
||||
$("ul.sct").addClass("sct_13");
|
||||
set_cookie("ck_itemlist_type", "list", 1, g4_cookie_domain);
|
||||
$("ul.sct").addClass("sct_40");
|
||||
$el.each(function() {
|
||||
if($(this).data("style")) {
|
||||
$(this).attr("style", "");
|
||||
}
|
||||
});
|
||||
set_cookie("ck_itemlist<?php echo $ca_id; ?>_type", "list", 1, g4_cookie_domain);
|
||||
}
|
||||
|
||||
$("button.sct_lst_view span").removeClass("sct_lst_on").html("");
|
||||
$(this).children("span").addClass("sct_lst_on").html("<b class=\"sound_only\">활성</b>");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user