$('#ntc_next_btn').click(function(){
$('.ntc_bar .ntc_ul').stop().animate({
top: -15
},function(){
$('.ntc_bar .ntc_ul').css({
top: 0
}).find('li').first().appendTo('.ntc_bar .ntc_ul');
})
})
var auto = setInterval(function(){
$('#ntc_next_btn').trigger('click')
},3000);
/*//공지사항 자동넘기기*/
/*메인 공지사항 넘기기*/
$('.notice_ntc_li .ntc_span').click(function(){
autoSlideNews();
});
function autoSlideNews(){
$('.ntc_li .slide_group').stop().animate({
top: -30.67
},function(){
$('.ntc_li .slide_group').css({
top: 0
}).find('.ntc_p').first().appendTo('.ntc_li .slide_group');
});
}
/*메인 공지사항 넘기기*/
$('.ntc_li .ntc_span').click(function(){
var thisSlidegroup = $(this).next('.slide_group');
var slideHeight = $('.ntc_ul .ntc_li .ntc_p').outerHeight();
thisSlidegroup.stop().animate({
top: -slideHeight
},function(){
thisSlidegroup.css({top:0}).find('.ntc_p').first().appendTo(thisSlidegroup);
});
//alert(slideHeight);
//autoSlideNotice();
});
// $('.news_ntc_li .ntc_span').click(function(){
//
// autoSlideNews();
//
// });
function autoSlideNotice(){
$('.notice_ntc_li .slide_group').stop().animate({
top: -30.67
},function(){
$('.notice_ntc_li .slide_group').css({
top: 0
}).find('.ntc_p').first().appendTo('.notice_ntc_li .slide_group');
});
}
function autoSlideNews(){
$('.news_ntc_li .slide_group').stop().animate({
top: -30.67
},function(){
$('.news_ntc_li .slide_group').css({
top: 0
}).find('.ntc_p').first().appendTo('.news_ntc_li .slide_group');
});
}
'pusblishing > JQuery' 카테고리의 다른 글
[header 구현] click이벤트로 슬라이드 메뉴 간단하게 구현하기 (0) | 2018.07.08 |
---|