상품리스트 페이지 jQuery load 로 불러오기
jQuery로 상품 목록을 불러 올 수 있도록 수정했습니다.
좌측의 상품카테고리 영역과 상품리스트의 페이징 링크에 반응 하도록 되어있습니다.
skin/shop/스킨명/boxcategory.skin.php 에 아래 스크립트를 추가합니다.
[code]
<script>
$(function() {
$('#gnb a, a.pg_page').live('click', function(e) {
if(this.href.match(/list\.php/g)) {
e.preventDefault();
var page_title = $(this).text() + ' 상품리스트';
var link = this.href;
if(!this.href.match(/page/))
document.title = page_title + ' | <?php echo $config['cf_title'];?>';
else $('html,body').animate({scrollTop:0},'fast');
var loading = '<div class="loading"> 상품목록을 불러오는 중입니다 </div>';
var i = 0;
var load = setInterval(function() {
$('.loading').append('.').prepend('.');
i++;
if(i == 20) {
i = 0;
$('.loading').html('상품목록을 불러오는 중 오류가 발생하여 다시 시도 중입니다. 잠시만 기다려 주십시오.<br /><br /><a href="'+link+'">바로 이동하기</a>');
location.href = link;
clearInterval(load);
}
}, 500);
$('#container').prepend(loading).load(link + '&load=true', function() {
$('#container').prepend('<div id="wrapper_title">'+ page_title +'</div>');
clearInterval(load);
});
return false;
}
});
});
</script>
[/code]
skin/shop/스킨명/style.css 에 아래 클래스를 추가합니다.
[code]
.loading {position:absolute; left:0; top:0; width:100%; height:100%; text-align:center; font-size:15px; font-weight:bold; background:url('/shop/img/loading.gif') 50% 120px rgba(255,255,255,0.5) no-repeat; z-index:1; padding:50px 0 0;}
[/code]
/shop/list.php 를 아래와 같이 수정합니다.
[code]
if ($ca['ca_include_head'])
@include_once($ca['ca_include_head']);
else
include_once('./_head.php');
-------------------->>>>>---------------------
if ($ca['ca_include_head'])
@include_once($ca['ca_include_head']);
else
if(!$_GET['load']) include_once('./_head.php');
//////////////////////////////////////////////
if ($ca['ca_include_tail'])
@include_once($ca['ca_include_tail']);
else
include_once('./_tail.php');
-------------------->>>>>----------------------
if ($ca['ca_include_tail'])
@include_once($ca['ca_include_tail']);
else
if(!$_GET['load']) include_once('./_tail.php');
[/code]
좌측의 상품카테고리 영역과 상품리스트의 페이징 링크에 반응 하도록 되어있습니다.
skin/shop/스킨명/boxcategory.skin.php 에 아래 스크립트를 추가합니다.
[code]
<script>
$(function() {
$('#gnb a, a.pg_page').live('click', function(e) {
if(this.href.match(/list\.php/g)) {
e.preventDefault();
var page_title = $(this).text() + ' 상품리스트';
var link = this.href;
if(!this.href.match(/page/))
document.title = page_title + ' | <?php echo $config['cf_title'];?>';
else $('html,body').animate({scrollTop:0},'fast');
var loading = '<div class="loading"> 상품목록을 불러오는 중입니다 </div>';
var i = 0;
var load = setInterval(function() {
$('.loading').append('.').prepend('.');
i++;
if(i == 20) {
i = 0;
$('.loading').html('상품목록을 불러오는 중 오류가 발생하여 다시 시도 중입니다. 잠시만 기다려 주십시오.<br /><br /><a href="'+link+'">바로 이동하기</a>');
location.href = link;
clearInterval(load);
}
}, 500);
$('#container').prepend(loading).load(link + '&load=true', function() {
$('#container').prepend('<div id="wrapper_title">'+ page_title +'</div>');
clearInterval(load);
});
return false;
}
});
});
</script>
[/code]
skin/shop/스킨명/style.css 에 아래 클래스를 추가합니다.
[code]
.loading {position:absolute; left:0; top:0; width:100%; height:100%; text-align:center; font-size:15px; font-weight:bold; background:url('/shop/img/loading.gif') 50% 120px rgba(255,255,255,0.5) no-repeat; z-index:1; padding:50px 0 0;}
[/code]
/shop/list.php 를 아래와 같이 수정합니다.
[code]
if ($ca['ca_include_head'])
@include_once($ca['ca_include_head']);
else
include_once('./_head.php');
-------------------->>>>>---------------------
if ($ca['ca_include_head'])
@include_once($ca['ca_include_head']);
else
if(!$_GET['load']) include_once('./_head.php');
//////////////////////////////////////////////
if ($ca['ca_include_tail'])
@include_once($ca['ca_include_tail']);
else
include_once('./_tail.php');
-------------------->>>>>----------------------
if ($ca['ca_include_tail'])
@include_once($ca['ca_include_tail']);
else
if(!$_GET['load']) include_once('./_tail.php');
[/code]
게시판 목록
영카트5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 41 | 11년 전 | 9172 | ||
| 40 | 11년 전 | 3403 | ||
| 39 | 11년 전 | 8910 | ||
| 38 | 11년 전 | 13312 | ||
| 37 | 11년 전 | 4757 | ||
| 36 | 11년 전 | 6877 | ||
| 35 | 11년 전 | 7037 | ||
| 34 | 11년 전 | 9902 | ||
| 33 |
restime
|
11년 전 | 8255 | |
| 32 | 11년 전 | 10307 | ||
| 31 | 11년 전 | 8957 | ||
| 30 |
사악한천사☆
|
11년 전 | 5911 | |
| 29 |
|
11년 전 | 7682 | |
| 28 | 11년 전 | 6995 | ||
| 27 | 11년 전 | 6063 | ||
| 26 | 11년 전 | 13601 | ||
| 25 | 11년 전 | 4863 | ||
| 24 |
sahara
|
11년 전 | 7288 | |
| 23 | 11년 전 | 22876 | ||
| 22 | 11년 전 | 6218 | ||
| 21 | 11년 전 | 8757 | ||
| 20 |
|
11년 전 | 11293 | |
| 19 | 11년 전 | 8887 | ||
| 18 | 11년 전 | 9506 | ||
| 17 | 11년 전 | 8228 | ||
| 16 |
Lemios
|
11년 전 | 7931 | |
| 15 | 11년 전 | 10661 | ||
| 14 | 11년 전 | 7532 | ||
| 13 | 11년 전 | 6134 | ||
| 12 | 11년 전 | 7431 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기