function rollingNotice() {
var $element = $('#noticeList');
var speed = 3000;
var timer = setInterval(moveNextSlide, speed);
var move = $element.children().outerHeight();
var lastChild;
lastChild = $element.children().eq(-1).clone(true);
lastChild.prependTo($element);
$element.children().eq(-1).remove();
if($element.children().length==1) {
$element.css('top','0px');
}
else {
$element.css('top','-'+move+'px');
}
$element.find('>a').bind({
'mouseenter': function(){
clearInterval(timer);
},
'mouseleave': function(){
timer = setInterval(moveNextSlide, speed);
}
});
function moveNextSlide() {
$element.each(function(idx){
var firstChild = $element.children().filter(':first-child').clone(true);
firstChild.appendTo($element);
$element.children().filter(':first-child').remove();
$element.css('top','0px');
$element.animate({'top':'-'+move+'px'},'normal');
});
}
}
<dl class="notice" style="position:relative;overflow:hidden;">
<dt><a href="" title="공지사항 바로가기" rel="nosublink">[공지사항]</a></dt>
<dd id="noticeList">
<a href="" class="hiddenOverflow" style="display:block;width:200px;height:27px" rel="nosublink">item.TITLE</a>
</dd>
</dl>
dl.notice {float:left;padding-top:9px;width:325px;height:23px}
dl.notice dt {float:left;padding-right:6px;font-weight:bold;color:#ff4948}
dl.notice dt a {color:#ff4948;vertical-align:top}
dl.notice dd {float:left;padding-right:7px;font-size:12px}
dl.notice dd a {color:#444;vertical-align:top}
댓글 없음:
댓글 쓰기