애니메이션 스킨 jQuery 코드 변경
This commit is contained in:
@ -11,8 +11,6 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
|||||||
|
|
||||||
<!-- 상품진열 20 시작 { -->
|
<!-- 상품진열 20 시작 { -->
|
||||||
<?php
|
<?php
|
||||||
$itemtype = $this->type;
|
|
||||||
|
|
||||||
for ($i=1; $row=sql_fetch_array($result); $i++) {
|
for ($i=1; $row=sql_fetch_array($result); $i++) {
|
||||||
$sct_last = '';
|
$sct_last = '';
|
||||||
if($i>1 && $i%$this->list_mod == 0)
|
if($i>1 && $i%$this->list_mod == 0)
|
||||||
@ -20,9 +18,9 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
|
|||||||
|
|
||||||
if ($i == 1) {
|
if ($i == 1) {
|
||||||
if ($this->css) {
|
if ($this->css) {
|
||||||
echo "<ul id=\"smt_{$itemtype}\" class=\"{$this->css}\">\n";
|
echo "<ul id=\"smt_{$this->type}\" class=\"{$this->css}\">\n";
|
||||||
} else {
|
} else {
|
||||||
echo "<ul id=\"smt_{$itemtype}\" class=\"sct smt_20\">\n";
|
echo "<ul id=\"smt_{$this->type}\" class=\"sct smt_20\">\n";
|
||||||
}
|
}
|
||||||
echo "<li class=\"sct_li sct_li_first\">\n";
|
echo "<li class=\"sct_li sct_li_first\">\n";
|
||||||
}
|
}
|
||||||
@ -86,61 +84,83 @@ if($i == 1) echo "<p class=\"sct_noitem\">등록된 상품이 없습니다.</p>\
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$.fn.topRolling = function(option)
|
||||||
var $smt<?php echo $itemtype; ?> = $("#smt_<?php echo $itemtype; ?> li.sct_li");
|
{
|
||||||
var $smt<?php echo $itemtype; ?>_a = $("#smt_<?php echo $itemtype; ?> li.sct_li a");
|
var $smt = this.find("li.sct_li");
|
||||||
var smt<?php echo $itemtype; ?>_height = $smt<?php echo $itemtype; ?>.closest("ul").height();
|
var $smt_a = $smt.find("a");
|
||||||
var smt<?php echo $itemtype; ?>_count = $smt<?php echo $itemtype; ?>.size();
|
var height = $smt.closest("ul").height();
|
||||||
var smt<?php echo $itemtype; ?>_c_idx = smt<?php echo $itemtype; ?>_o_idx = 0;
|
var count = $smt.size();
|
||||||
var smt<?php echo $itemtype; ?>_time = 5000;
|
var c_idx = o_idx = 0;
|
||||||
var smt<?php echo $itemtype; ?>_a_time = 800;
|
var fx = null;
|
||||||
var smt<?php echo $itemtype; ?>_interval = null;
|
|
||||||
|
|
||||||
if(smt<?php echo $itemtype; ?>_count > 1)
|
// 기본 설정값
|
||||||
smt<?php echo $itemtype; ?>_interval = setInterval(top_rolling, smt<?php echo $itemtype; ?>_time);
|
var settings = $.extend({
|
||||||
|
interval: 5000,
|
||||||
|
duration: 800
|
||||||
|
}, option);
|
||||||
|
|
||||||
$smt<?php echo $itemtype; ?>.hover(
|
if(count < 2)
|
||||||
|
return;
|
||||||
|
|
||||||
|
fx = setInterval(top_rolling, settings.interval);
|
||||||
|
|
||||||
|
$smt.hover(
|
||||||
function() {
|
function() {
|
||||||
if(smt<?php echo $itemtype; ?>_interval != null)
|
if(fx != null)
|
||||||
clearInterval(smt<?php echo $itemtype; ?>_interval);
|
clearInterval(fx);
|
||||||
},
|
},
|
||||||
function() {
|
function() {
|
||||||
if(smt<?php echo $itemtype; ?>_interval != null)
|
if(fx != null)
|
||||||
clearInterval(smt<?php echo $itemtype; ?>_interval);
|
clearInterval(fx);
|
||||||
|
|
||||||
if(smt<?php echo $itemtype; ?>_count > 1)
|
if(count > 1)
|
||||||
smt<?php echo $itemtype; ?>_interval = setInterval(top_rolling, smt<?php echo $itemtype; ?>_time);
|
fx = setInterval(top_rolling, settings.interval);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$smt<?php echo $itemtype; ?>_a.on("focusin", function() {
|
$smt_a.on("focusin", function() {
|
||||||
if(smt<?php echo $itemtype; ?>_interval != null)
|
if(fx != null)
|
||||||
clearInterval(smt<?php echo $itemtype; ?>_interval);
|
clearInterval(fx);
|
||||||
});
|
});
|
||||||
|
|
||||||
$smt<?php echo $itemtype; ?>_a.on("focusout", function() {
|
$smt_a.on("focusout", function() {
|
||||||
if(smt<?php echo $itemtype; ?>_interval != null)
|
if(fx != null)
|
||||||
clearInterval(smt<?php echo $itemtype; ?>_interval);
|
clearInterval(fx);
|
||||||
|
|
||||||
if(smt<?php echo $itemtype; ?>_count > 1)
|
if(count > 1)
|
||||||
smt<?php echo $itemtype; ?>_interval = setInterval(top_rolling, smt<?php echo $itemtype; ?>_time);
|
fx = setInterval(top_rolling, settings.interval);
|
||||||
});
|
});
|
||||||
|
|
||||||
function top_rolling() {
|
function top_rolling() {
|
||||||
$smt<?php echo $itemtype; ?>.eq(smt<?php echo $itemtype; ?>_o_idx).animate(
|
$smt.each(function(index) {
|
||||||
{ top: "-="+smt<?php echo $itemtype; ?>_height+"px" }, smt<?php echo $itemtype; ?>_a_time
|
if($(this).is(":visible")) {
|
||||||
|
o_idx = index;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$smt.eq(o_idx).animate(
|
||||||
|
{ top: "-="+height+"px" }, settings.duration,
|
||||||
|
function() {
|
||||||
|
$(this).css("display", "none").css("top", height+"px");
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
smt<?php echo $itemtype; ?>_c_idx = (smt<?php echo $itemtype; ?>_o_idx + 1) % smt<?php echo $itemtype; ?>_count;
|
c_idx = (o_idx + 1) % count;
|
||||||
|
|
||||||
$smt<?php echo $itemtype; ?>.eq(smt<?php echo $itemtype; ?>_c_idx).css("display", "block").animate(
|
$smt.eq(c_idx).css("display", "block").animate(
|
||||||
{ top: "-="+smt<?php echo $itemtype; ?>_height+"px" }, smt<?php echo $itemtype; ?>_a_time,
|
{ top: "-="+height+"px" }, settings.duration,
|
||||||
function() {
|
function() {
|
||||||
$smt<?php echo $itemtype; ?>.eq(smt<?php echo $itemtype; ?>_o_idx).css("display", "none").css("top", smt<?php echo $itemtype; ?>_height+"px");
|
o_idx = c_idx;
|
||||||
smt<?php echo $itemtype; ?>_o_idx = smt<?php echo $itemtype; ?>_c_idx;
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
$("#smt_<?php echo $this->type; ?>").topRolling();
|
||||||
|
// 기본 설정값을 변경하려면 아래처럼 사용
|
||||||
|
//$("#smt_<?php echo $this->type; ?>").topRolling({ interval: 5000, duration: 800 });
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<!-- } 상품진열 20 끝 -->
|
<!-- } 상품진열 20 끝 -->
|
||||||
@ -11,14 +11,12 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
|||||||
|
|
||||||
<!-- 상품유형 30 시작 { -->
|
<!-- 상품유형 30 시작 { -->
|
||||||
<?php
|
<?php
|
||||||
$itemtype = $this->type;
|
|
||||||
|
|
||||||
for ($i=1; $row=sql_fetch_array($result); $i++) {
|
for ($i=1; $row=sql_fetch_array($result); $i++) {
|
||||||
if ($i == 1) {
|
if ($i == 1) {
|
||||||
if ($this->css) {
|
if ($this->css) {
|
||||||
echo "<ul id=\"smt_{$itemtype}\" class=\"{$this->css}\">\n";
|
echo "<ul id=\"smt_{$this->type}\" class=\"{$this->css}\">\n";
|
||||||
} else {
|
} else {
|
||||||
echo "<ul id=\"smt_{$itemtype}\" class=\"sct smt_30\">\n";
|
echo "<ul id=\"smt_{$this->type}\" class=\"sct smt_30\">\n";
|
||||||
}
|
}
|
||||||
echo "<li class=\"sct_li sct_li_first\">\n";
|
echo "<li class=\"sct_li sct_li_first\">\n";
|
||||||
}
|
}
|
||||||
@ -82,61 +80,83 @@ if($i == 1) echo "<p class=\"sct_noitem\">등록된 상품이 없습니다.</p>\
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$.fn.leftRolling = function(option)
|
||||||
var $smt<?php echo $itemtype; ?> = $("#smt_<?php echo $itemtype; ?> li.sct_li");
|
{
|
||||||
var $smt<?php echo $itemtype; ?>_a = $("#smt_<?php echo $itemtype; ?> li.sct_li a");
|
var $smt = this.find("li.sct_li");
|
||||||
var smt<?php echo $itemtype; ?>_width = $smt<?php echo $itemtype; ?>.width();
|
var $smt_a = $smt.find("a");
|
||||||
var smt<?php echo $itemtype; ?>_count = $smt<?php echo $itemtype; ?>.size();
|
var width = $smt.width();
|
||||||
var smt<?php echo $itemtype; ?>_c_idx = smt<?php echo $itemtype; ?>_o_idx = 0;
|
var count = $smt.size();
|
||||||
var smt<?php echo $itemtype; ?>_time = 7000;
|
var c_idx = smt_o_idx = 0;
|
||||||
var smt<?php echo $itemtype; ?>_a_time = 1500;
|
var fx = null;
|
||||||
var smt<?php echo $itemtype; ?>_interval = null;
|
|
||||||
|
|
||||||
if(smt<?php echo $itemtype; ?>_count > 1)
|
// 기본 설정값
|
||||||
smt<?php echo $itemtype; ?>_interval = setInterval(left_rolling, smt<?php echo $itemtype; ?>_time);
|
var settings = $.extend({
|
||||||
|
interval: 7000,
|
||||||
|
duration: 1500
|
||||||
|
}, option);
|
||||||
|
|
||||||
$smt<?php echo $itemtype; ?>.hover(
|
if(count < 2)
|
||||||
|
return;
|
||||||
|
|
||||||
|
fx = setInterval(left_rolling, settings.interval);
|
||||||
|
|
||||||
|
$smt.hover(
|
||||||
function() {
|
function() {
|
||||||
if(smt<?php echo $itemtype; ?>_interval != null)
|
if(fx != null)
|
||||||
clearInterval(smt<?php echo $itemtype; ?>_interval);
|
clearInterval(fx);
|
||||||
},
|
},
|
||||||
function() {
|
function() {
|
||||||
if(smt<?php echo $itemtype; ?>_interval != null)
|
if(fx != null)
|
||||||
clearInterval(smt<?php echo $itemtype; ?>_interval);
|
clearInterval(fx);
|
||||||
|
|
||||||
if(smt<?php echo $itemtype; ?>_count > 1)
|
if(count > 1)
|
||||||
smt<?php echo $itemtype; ?>_interval = setInterval(left_rolling, smt<?php echo $itemtype; ?>_time);
|
fx = setInterval(left_rolling, settings.interval);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$smt<?php echo $itemtype; ?>_a.on("focusin", function() {
|
$smt_a.on("focusin", function() {
|
||||||
if(smt<?php echo $itemtype; ?>_interval != null)
|
if(smt_interval != null)
|
||||||
clearInterval(smt<?php echo $itemtype; ?>_interval);
|
clearInterval(smt_interval);
|
||||||
});
|
});
|
||||||
|
|
||||||
$smt<?php echo $itemtype; ?>_a.on("focusout", function() {
|
$smt_a.on("focusout", function() {
|
||||||
if(smt<?php echo $itemtype; ?>_interval != null)
|
if(fx != null)
|
||||||
clearInterval(smt<?php echo $itemtype; ?>_interval);
|
clearInterval(fx);
|
||||||
|
|
||||||
if(smt<?php echo $itemtype; ?>_count > 1)
|
if(count > 1)
|
||||||
smt<?php echo $itemtype; ?>_interval = setInterval(left_rolling, smt<?php echo $itemtype; ?>_time);
|
fx = setInterval(left_rolling, settings.interval);
|
||||||
});
|
});
|
||||||
|
|
||||||
function left_rolling() {
|
function left_rolling() {
|
||||||
$smt<?php echo $itemtype; ?>.eq(smt<?php echo $itemtype; ?>_o_idx).animate(
|
$smt.each(function(index) {
|
||||||
{ left: "-="+smt<?php echo $itemtype; ?>_width+"px" }, smt<?php echo $itemtype; ?>_a_time
|
if($(this).is(":visible")) {
|
||||||
|
o_idx = index;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$smt.eq(o_idx).animate(
|
||||||
|
{ left: "-="+width+"px" }, settings.duration,
|
||||||
|
function() {
|
||||||
|
$(this).css("display", "none").css("left", width+"px");
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
smt<?php echo $itemtype; ?>_c_idx = (smt<?php echo $itemtype; ?>_o_idx + 1) % smt<?php echo $itemtype; ?>_count;
|
c_idx = (o_idx + 1) % count;
|
||||||
|
|
||||||
$smt<?php echo $itemtype; ?>.eq(smt<?php echo $itemtype; ?>_c_idx).css("display", "block").animate(
|
$smt.eq(c_idx).css("display", "block").animate(
|
||||||
{ left: "-="+smt<?php echo $itemtype; ?>_width+"px" }, smt<?php echo $itemtype; ?>_a_time,
|
{ left: "-="+width+"px" }, settings.duration,
|
||||||
function() {
|
function() {
|
||||||
$smt<?php echo $itemtype; ?>.eq(smt<?php echo $itemtype; ?>_o_idx).css("display", "none").css("left", smt<?php echo $itemtype; ?>_width+"px");
|
o_idx = c_idx;
|
||||||
smt<?php echo $itemtype; ?>_o_idx = smt<?php echo $itemtype; ?>_c_idx;
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
$("#smt_<?php echo $this->type; ?>").leftRolling();
|
||||||
|
// 기본 설정값을 변경하려면 아래처럼 사용
|
||||||
|
//$("#smt_<?php echo $this->type; ?>").leftRolling({ interval: 7000, duration: 1500 });
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<!-- } 상품진열 30 끝 -->
|
<!-- } 상품진열 30 끝 -->
|
||||||
@ -11,8 +11,6 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
|||||||
|
|
||||||
<!-- 상품진열 40 시작 { -->
|
<!-- 상품진열 40 시작 { -->
|
||||||
<?php
|
<?php
|
||||||
$itemtype = $this->type;
|
|
||||||
|
|
||||||
for ($i=1; $row=sql_fetch_array($result); $i++) {
|
for ($i=1; $row=sql_fetch_array($result); $i++) {
|
||||||
$sct_last = '';
|
$sct_last = '';
|
||||||
if($i>1 && $i%$this->list_mod == 0)
|
if($i>1 && $i%$this->list_mod == 0)
|
||||||
@ -20,9 +18,9 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
|
|||||||
|
|
||||||
if ($i == 1) {
|
if ($i == 1) {
|
||||||
if ($this->css) {
|
if ($this->css) {
|
||||||
echo "<ul id=\"smt_{$itemtype}\" class=\"{$this->css}\">\n";
|
echo "<ul id=\"smt_{$this->type}\" class=\"{$this->css}\">\n";
|
||||||
} else {
|
} else {
|
||||||
echo "<ul id=\"smt_{$itemtype}\" class=\"sct smt_40\">\n";
|
echo "<ul id=\"smt_{$this->type}\" class=\"sct smt_40\">\n";
|
||||||
}
|
}
|
||||||
echo "<li class=\"sct_li sct_li_first\">\n";
|
echo "<li class=\"sct_li sct_li_first\">\n";
|
||||||
}
|
}
|
||||||
@ -86,50 +84,70 @@ if($i == 1) echo "<p class=\"sct_noitem\">등록된 상품이 없습니다.</p>\
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$.fn.itemlistShow = function(option)
|
||||||
var $smt<?php echo $itemtype; ?> = $("#smt_<?php echo $itemtype; ?> li.sct_li");
|
{
|
||||||
var $smt<?php echo $itemtype; ?>_a = $("#smt_<?php echo $itemtype; ?> li.sct_li a");
|
var $smt = this.find("li.sct_li");
|
||||||
var smt<?php echo $itemtype; ?>_count = $smt<?php echo $itemtype; ?>.size();
|
var $smt_a = $smt.find("a");
|
||||||
var smt<?php echo $itemtype; ?>_c_idx = smt<?php echo $itemtype; ?>_o_idx = 0;
|
var count = $smt.size();
|
||||||
var smt<?php echo $itemtype; ?>_time = 3000;
|
var c_idx = o_idx = 0;
|
||||||
var smt<?php echo $itemtype; ?>_interval = null;
|
var fx = null;
|
||||||
|
|
||||||
if(smt<?php echo $itemtype; ?>_count > 1)
|
// 기본 설정값
|
||||||
smt<?php echo $itemtype; ?>_interval = setInterval(itemlist_show, smt<?php echo $itemtype; ?>_time);
|
var settings = $.extend({
|
||||||
|
interval: 3000
|
||||||
|
}, option);
|
||||||
|
|
||||||
$smt<?php echo $itemtype; ?>.hover(
|
if(count < 2)
|
||||||
|
return;
|
||||||
|
|
||||||
|
fx = setInterval(itemlist_show, settings.interval);
|
||||||
|
|
||||||
|
$smt.hover(
|
||||||
function() {
|
function() {
|
||||||
if(smt<?php echo $itemtype; ?>_interval != null)
|
if(fx != null)
|
||||||
clearInterval(smt<?php echo $itemtype; ?>_interval);
|
clearInterval(fx);
|
||||||
},
|
},
|
||||||
function() {
|
function() {
|
||||||
if(smt<?php echo $itemtype; ?>_interval != null)
|
if(fx != null)
|
||||||
clearInterval(smt<?php echo $itemtype; ?>_interval);
|
clearInterval(fx);
|
||||||
|
|
||||||
if(smt<?php echo $itemtype; ?>_count > 1)
|
if(count > 1)
|
||||||
smt<?php echo $itemtype; ?>_interval = setInterval(itemlist_show, smt<?php echo $itemtype; ?>_time);
|
fx = setInterval(itemlist_show, settings.interval);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$smt<?php echo $itemtype; ?>_a.on("focusin", function() {
|
$smt_a.on("focusin", function() {
|
||||||
if(smt<?php echo $itemtype; ?>_interval != null)
|
if(fx != null)
|
||||||
clearInterval(smt<?php echo $itemtype; ?>_interval);
|
clearInterval(fx);
|
||||||
});
|
});
|
||||||
|
|
||||||
$smt<?php echo $itemtype; ?>_a.on("focusout", function() {
|
$smt_a.on("focusout", function() {
|
||||||
if(smt<?php echo $itemtype; ?>_interval != null)
|
if(fx != null)
|
||||||
clearInterval(smt<?php echo $itemtype; ?>_interval);
|
clearInterval(fx);
|
||||||
|
|
||||||
if(smt<?php echo $itemtype; ?>_count > 1)
|
if(count > 1)
|
||||||
smt<?php echo $itemtype; ?>_interval = setInterval(itemlist_show, smt<?php echo $itemtype; ?>_time);
|
fx = setInterval(itemlist_show, settings.interval);
|
||||||
});
|
});
|
||||||
|
|
||||||
function itemlist_show() {
|
function itemlist_show() {
|
||||||
$smt<?php echo $itemtype; ?>.eq(smt<?php echo $itemtype; ?>_o_idx).css("display", "none");
|
$smt.each(function(index) {
|
||||||
smt<?php echo $itemtype; ?>_c_idx = (smt<?php echo $itemtype; ?>_o_idx + 1) % smt<?php echo $itemtype; ?>_count;
|
if($(this).is(":visible")) {
|
||||||
$smt<?php echo $itemtype; ?>.eq(smt<?php echo $itemtype; ?>_c_idx).css("display", "block");
|
o_idx = index;
|
||||||
smt<?php echo $itemtype; ?>_o_idx = smt<?php echo $itemtype; ?>_c_idx;
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$smt.eq(o_idx).css("display", "none");
|
||||||
|
c_idx = (o_idx + 1) % count;
|
||||||
|
$smt.eq(c_idx).css("display", "block");
|
||||||
|
o_idx = c_idx;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
$("#smt_<?php echo $this->type; ?>").itemlistShow();
|
||||||
|
// 기본 설정값을 변경하려면 아래처럼 사용
|
||||||
|
//$("#smt_<?php echo $this->type; ?>").itemlistShow({ interval: 3000 });
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<!-- } 상품진열 40 끝 -->
|
<!-- } 상품진열 40 끝 -->
|
||||||
@ -10,8 +10,6 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
|||||||
|
|
||||||
<!-- 상품진열 50 시작 { -->
|
<!-- 상품진열 50 시작 { -->
|
||||||
<?php
|
<?php
|
||||||
$itemtype = $this->type;
|
|
||||||
|
|
||||||
for ($i=1; $row=sql_fetch_array($result); $i++) {
|
for ($i=1; $row=sql_fetch_array($result); $i++) {
|
||||||
$sct_last = '';
|
$sct_last = '';
|
||||||
if($i>1 && $i%$this->list_mod == 0)
|
if($i>1 && $i%$this->list_mod == 0)
|
||||||
@ -19,9 +17,9 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
|
|||||||
|
|
||||||
if ($i == 1) {
|
if ($i == 1) {
|
||||||
if ($this->css) {
|
if ($this->css) {
|
||||||
echo "<ul id=\"smt_{$itemtype}\" class=\"{$this->css}\">\n";
|
echo "<ul id=\"smt_{$this->type}\" class=\"{$this->css}\">\n";
|
||||||
} else {
|
} else {
|
||||||
echo "<ul id=\"smt_{$itemtype}\" class=\"sct smt_50\">\n";
|
echo "<ul id=\"smt_{$this->type}\" class=\"sct smt_50\">\n";
|
||||||
}
|
}
|
||||||
echo "<li class=\"sct_li sct_li_first\">\n";
|
echo "<li class=\"sct_li sct_li_first\">\n";
|
||||||
}
|
}
|
||||||
@ -85,76 +83,95 @@ if($i == 1) echo "<p class=\"sct_noitem\">등록된 상품이 없습니다.</p>\
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$.fn.itemDrop = function(option)
|
||||||
var $smt<?php echo $itemtype; ?> = $("#smt_<?php echo $itemtype; ?> li.sct_li");
|
{
|
||||||
var $smt<?php echo $itemtype; ?>_a = $("#smt_<?php echo $itemtype; ?> li.sct_li a");
|
var $smt = this.find("li.sct_li");
|
||||||
var smt<?php echo $itemtype; ?>_count = $smt<?php echo $itemtype; ?>.size();
|
var $smt_a = $smt.find("a");
|
||||||
var $smt<?php echo $itemtype; ?>_height = $smt<?php echo $itemtype; ?>.height();
|
var count = $smt.size();
|
||||||
var smt<?php echo $itemtype; ?>_c_idx = smt<?php echo $itemtype; ?>_o_idx = 0;
|
var height = $smt.height();
|
||||||
var smt<?php echo $itemtype; ?>_time = 6000;
|
var c_idx = o_idx = 0;
|
||||||
var smt<?php echo $itemtype; ?>_a_time = 800;
|
var fx = null;
|
||||||
var smt<?php echo $itemtype; ?>_delay = 300;
|
|
||||||
var smt<?php echo $itemtype; ?>_interval = null;
|
|
||||||
var delay = 0;
|
var delay = 0;
|
||||||
|
|
||||||
|
// 기본 설정값
|
||||||
|
var settings = $.extend({
|
||||||
|
interval: 6000,
|
||||||
|
duration: 800,
|
||||||
|
delay: 300
|
||||||
|
}, option);
|
||||||
|
|
||||||
// 초기실행
|
// 초기실행
|
||||||
if(smt<?php echo $itemtype; ?>_count > 0) {
|
if(count > 0) {
|
||||||
$smt<?php echo $itemtype; ?>.eq(0).find("div").each(function() {
|
$smt.eq(0).find("div").each(function() {
|
||||||
$(this).delay(delay).animate(
|
$(this).delay(delay).animate(
|
||||||
{ top: "+="+$smt<?php echo $itemtype; ?>_height+"px" }, smt<?php echo $itemtype; ?>_a_time
|
{ top: "+="+height+"px" }, settings.duration
|
||||||
);
|
);
|
||||||
|
|
||||||
delay += smt<?php echo $itemtype; ?>_delay;
|
delay += settings.delay;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if(smt<?php echo $itemtype; ?>_count > 1)
|
if(count > 1)
|
||||||
smt<?php echo $itemtype; ?>_interval = setInterval(item_drop, smt<?php echo $itemtype; ?>_time);
|
fx = setInterval(item_drop, settings.interval);
|
||||||
|
|
||||||
$smt<?php echo $itemtype; ?>.hover(
|
$smt.hover(
|
||||||
function() {
|
function() {
|
||||||
if(smt<?php echo $itemtype; ?>_interval != null)
|
if(fx != null)
|
||||||
clearInterval(smt<?php echo $itemtype; ?>_interval);
|
clearInterval(fx);
|
||||||
},
|
},
|
||||||
function() {
|
function() {
|
||||||
if(smt<?php echo $itemtype; ?>_interval != null)
|
if(fx != null)
|
||||||
clearInterval(smt<?php echo $itemtype; ?>_interval);
|
clearInterval(fx);
|
||||||
|
|
||||||
if(smt<?php echo $itemtype; ?>_count > 1)
|
if(count > 1)
|
||||||
smt<?php echo $itemtype; ?>_interval = setInterval(item_drop, smt<?php echo $itemtype; ?>_time);
|
fx = setInterval(item_drop, settings.interval);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$smt<?php echo $itemtype; ?>_a.on("focusin", function() {
|
$smt_a.on("focusin", function() {
|
||||||
if(smt<?php echo $itemtype; ?>_interval != null)
|
if(fx != null)
|
||||||
clearInterval(smt<?php echo $itemtype; ?>_interval);
|
clearInterval(fx);
|
||||||
});
|
});
|
||||||
|
|
||||||
$smt<?php echo $itemtype; ?>_a.on("focusout", function() {
|
$smt_a.on("focusout", function() {
|
||||||
if(smt<?php echo $itemtype; ?>_interval != null)
|
if(fx != null)
|
||||||
clearInterval(smt<?php echo $itemtype; ?>_interval);
|
clearInterval(fx);
|
||||||
|
|
||||||
if(smt<?php echo $itemtype; ?>_count > 1)
|
if(count > 1)
|
||||||
smt<?php echo $itemtype; ?>_interval = setInterval(item_drop, smt<?php echo $itemtype; ?>_time);
|
fx = setInterval(item_drop, settings.interval);
|
||||||
});
|
});
|
||||||
|
|
||||||
function item_drop() {
|
function item_drop() {
|
||||||
|
$smt.each(function(index) {
|
||||||
|
if($(this).is(":visible")) {
|
||||||
|
o_idx = index;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
delay = 0;
|
delay = 0;
|
||||||
$smt<?php echo $itemtype; ?>.eq(smt<?php echo $itemtype; ?>_o_idx).css("display", "none");
|
|
||||||
$smt<?php echo $itemtype; ?>.eq(smt<?php echo $itemtype; ?>_o_idx).find("div").css("top", "-"+$smt<?php echo $itemtype; ?>_height+"px");
|
|
||||||
|
|
||||||
smt<?php echo $itemtype; ?>_c_idx = (smt<?php echo $itemtype; ?>_o_idx + 1) % smt<?php echo $itemtype; ?>_count;
|
$smt.eq(o_idx).css("display", "none");
|
||||||
|
$smt.eq(o_idx).find("div").css("top", "-"+height+"px");
|
||||||
|
|
||||||
$smt<?php echo $itemtype; ?>.eq(smt<?php echo $itemtype; ?>_c_idx).css("display", "block");
|
c_idx = (o_idx + 1) % count;
|
||||||
$smt<?php echo $itemtype; ?>.eq(smt<?php echo $itemtype; ?>_c_idx).find("div").each(function() {
|
|
||||||
|
$smt.eq(c_idx).css("display", "block");
|
||||||
|
$smt.eq(c_idx).find("div").each(function() {
|
||||||
$(this).delay(delay).animate(
|
$(this).delay(delay).animate(
|
||||||
{ top: "+="+$smt<?php echo $itemtype; ?>_height+"px" }, smt<?php echo $itemtype; ?>_a_time
|
{ top: "+="+height+"px" }, settings.duration
|
||||||
);
|
);
|
||||||
|
|
||||||
delay += smt<?php echo $itemtype; ?>_delay;
|
delay += settings.delay;
|
||||||
});
|
});
|
||||||
smt<?php echo $itemtype; ?>_o_idx = smt<?php echo $itemtype; ?>_c_idx;
|
|
||||||
|
o_idx = c_idx;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
$(function() {
|
||||||
|
$("#smt_<?php echo $this->type; ?>").itemDrop();
|
||||||
|
// 기본 설정값을 변경하려면 아래처럼 사용
|
||||||
|
//$("#smt_<?php echo $this->type; ?>").itemDrop({ interval: 6000, duration: 800, delay: 300 });
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<!-- } 상품진열 50 끝 -->
|
<!-- } 상품진열 50 끝 -->
|
||||||
Reference in New Issue
Block a user