댓글 2개
가오가이거
12년 전
jQuery 로 구동되는것이구요.
코드는 대충 저 사이트에서 js 파일만 뽑아보니 다음과 같습니다.
(function($) {
var NivoSlider = function(element, options){
//Defaults are below
var settings = $.extend({}, $.fn.nivoSlider.defaults, options);
//Useful variables. Play carefully.
var vars = {
currentSlide: 0,
currentImage: '',
totalSlides: 0,
running: false,
paused: false,
stop: false
};
//Get this slider
var slider = $(element);
slider.data('nivo:vars', vars);
slider.css('position','relative');
slider.addClass('nivoSlider');
//Find our slider children
var kids = slider.children();
kids.each(function() {
var child = $(this);
var link = '';
if(!child.is('img')){
if(child.is('a')){
child.addClass('nivo-imageLink');
link = child;
}
child = child.find('img:first');
}
//Get img width & height
var childWidth = child.width();
if(childWidth == 0) childWidth = child.attr('width');
var childHeight = child.height();
if(childHeight == 0) childHeight = child.attr('height');
//Resize the slider
if(childWidth > slider.width()){
slider.width(childWidth);
}
if(childHeight > slider.height()){
slider.height(childHeight);
}
if(link != ''){
link.css('display','none');
}
child.css('display','none');
vars.totalSlides++;
});
//If randomStart
if(settings.randomStart){
settings.startSlide = Math.floor(Math.random() * vars.totalSlides);
}
//Set startSlide
if(settings.startSlide > 0){
if(settings.startSlide >= vars.totalSlides) settings.startSlide = vars.totalSlides - 1;
vars.currentSlide = settings.startSlide;
}
//Get initial image
if($(kids[vars.currentSlide]).is('img')){
vars.currentImage = $(kids[vars.currentSlide]);
} else {
vars.currentImage = $(kids[vars.currentSlide]).find('img:first');
}
//Show initial link
if($(kids[vars.currentSlide]).is('a')){
$(kids[vars.currentSlide]).css('display','block');
}
//Set first background
slider.css('background','url("'+ vars.currentImage.attr('src') +'") no-repeat');
//Create caption
slider.append(
$('<div class="nivo-caption"><p></p></div>').css({ display:'none', opacity:settings.captionOpacity })
);
// Cross browser default caption opacity
$('.nivo-caption', slider).css('opacity', 0);
// Process caption function
var processCaption = function(settings){
var nivoCaption = $('.nivo-caption', slider);
if(vars.currentImage.attr('title') != '' && vars.currentImage.attr('title') != undefined){
var title = vars.currentImage.attr('title');
if(title.substr(0,1) == '#') title = $(title).html();
if(nivoCaption.css('opacity') != 0){
nivoCaption.find('p').stop().fadeTo(settings.animSpeed, 0, function(){
$(this).html(title);
$(this).stop().fadeTo(settings.animSpeed, 1);
});
} else {
nivoCaption.find('p').html(title);
}
nivoCaption.stop().fadeTo(settings.animSpeed, settings.captionOpacity);
} else {
nivoCaption.stop().fadeTo(settings.animSpeed, 0);
}
}
//Process initial caption
processCaption(settings);
//In the words of Super Mario "let's a go!"
var timer = 0;
if(!settings.manualAdvance && kids.length > 1){
timer = setInterval(function(){ nivoRun(slider, kids, settings, false); }, settings.pauseTime);
}
//Add Direction nav
if(settings.directionNav){
slider.append('<div class="nivo-directionNav"><a class="nivo-prevNav" title="Prev"></a><a class="nivo-nextNav" title="Next"></a></div>');
//Hide Direction nav
if(settings.directionNavHide){
$('.nivo-directionNav', slider).hide();
slider.hover(function(){
$('.nivo-directionNav', slider).show();
}, function(){
$('.nivo-directionNav', slider).hide();
});
}
$('a.nivo-prevNav', slider).live('click', function(){
if(vars.running) return false;
clearInterval(timer);
코드는 대충 저 사이트에서 js 파일만 뽑아보니 다음과 같습니다.
(function($) {
var NivoSlider = function(element, options){
//Defaults are below
var settings = $.extend({}, $.fn.nivoSlider.defaults, options);
//Useful variables. Play carefully.
var vars = {
currentSlide: 0,
currentImage: '',
totalSlides: 0,
running: false,
paused: false,
stop: false
};
//Get this slider
var slider = $(element);
slider.data('nivo:vars', vars);
slider.css('position','relative');
slider.addClass('nivoSlider');
//Find our slider children
var kids = slider.children();
kids.each(function() {
var child = $(this);
var link = '';
if(!child.is('img')){
if(child.is('a')){
child.addClass('nivo-imageLink');
link = child;
}
child = child.find('img:first');
}
//Get img width & height
var childWidth = child.width();
if(childWidth == 0) childWidth = child.attr('width');
var childHeight = child.height();
if(childHeight == 0) childHeight = child.attr('height');
//Resize the slider
if(childWidth > slider.width()){
slider.width(childWidth);
}
if(childHeight > slider.height()){
slider.height(childHeight);
}
if(link != ''){
link.css('display','none');
}
child.css('display','none');
vars.totalSlides++;
});
//If randomStart
if(settings.randomStart){
settings.startSlide = Math.floor(Math.random() * vars.totalSlides);
}
//Set startSlide
if(settings.startSlide > 0){
if(settings.startSlide >= vars.totalSlides) settings.startSlide = vars.totalSlides - 1;
vars.currentSlide = settings.startSlide;
}
//Get initial image
if($(kids[vars.currentSlide]).is('img')){
vars.currentImage = $(kids[vars.currentSlide]);
} else {
vars.currentImage = $(kids[vars.currentSlide]).find('img:first');
}
//Show initial link
if($(kids[vars.currentSlide]).is('a')){
$(kids[vars.currentSlide]).css('display','block');
}
//Set first background
slider.css('background','url("'+ vars.currentImage.attr('src') +'") no-repeat');
//Create caption
slider.append(
$('<div class="nivo-caption"><p></p></div>').css({ display:'none', opacity:settings.captionOpacity })
);
// Cross browser default caption opacity
$('.nivo-caption', slider).css('opacity', 0);
// Process caption function
var processCaption = function(settings){
var nivoCaption = $('.nivo-caption', slider);
if(vars.currentImage.attr('title') != '' && vars.currentImage.attr('title') != undefined){
var title = vars.currentImage.attr('title');
if(title.substr(0,1) == '#') title = $(title).html();
if(nivoCaption.css('opacity') != 0){
nivoCaption.find('p').stop().fadeTo(settings.animSpeed, 0, function(){
$(this).html(title);
$(this).stop().fadeTo(settings.animSpeed, 1);
});
} else {
nivoCaption.find('p').html(title);
}
nivoCaption.stop().fadeTo(settings.animSpeed, settings.captionOpacity);
} else {
nivoCaption.stop().fadeTo(settings.animSpeed, 0);
}
}
//Process initial caption
processCaption(settings);
//In the words of Super Mario "let's a go!"
var timer = 0;
if(!settings.manualAdvance && kids.length > 1){
timer = setInterval(function(){ nivoRun(slider, kids, settings, false); }, settings.pauseTime);
}
//Add Direction nav
if(settings.directionNav){
slider.append('<div class="nivo-directionNav"><a class="nivo-prevNav" title="Prev"></a><a class="nivo-nextNav" title="Next"></a></div>');
//Hide Direction nav
if(settings.directionNavHide){
$('.nivo-directionNav', slider).hide();
slider.hover(function(){
$('.nivo-directionNav', slider).show();
}, function(){
$('.nivo-directionNav', slider).hide();
});
}
$('a.nivo-prevNav', slider).live('click', function(){
if(vars.running) return false;
clearInterval(timer);
12년 전
jquery 부분을 제외하면 대부분 css에서 컨트롤 하지만 모던브라우저가 아니면 표현하지 못합니다.
css media 부분이 가로폭에 따라 대응하는 스타일이죠~
저도 자주 쓰긴 합니다만, ie7, 8같이 표현 못하는 경우는 걍 min-width로 고정시켜버리면 문제는 끝...이라...-0-;
css media 부분이 가로폭에 따라 대응하는 스타일이죠~
저도 자주 쓰긴 합니다만, ie7, 8같이 표현 못하는 경우는 걍 min-width로 고정시켜버리면 문제는 끝...이라...-0-;
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 6630 |
차가운바람
|
12년 전 | 1174 | |
| 6629 | 12년 전 | 1172 | ||
| 6628 |
put777
|
12년 전 | 654 | |
| 6627 |
|
12년 전 | 708 | |
| 6626 | 12년 전 | 1622 | ||
| 6625 |
|
12년 전 | 729 | |
| 6624 |
미켈란젤로의왼손
|
12년 전 | 496 | |
| 6623 |
|
12년 전 | 1056 | |
| 6622 | 12년 전 | 1405 | ||
| 6621 |
차가운바람
|
12년 전 | 645 | |
| 6620 | 12년 전 | 747 | ||
| 6619 |
|
12년 전 | 983 | |
| 6618 | 12년 전 | 1754 | ||
| 6617 | 12년 전 | 647 | ||
| 6616 |
차가운바람
|
12년 전 | 907 | |
| 6615 | 12년 전 | 2861 | ||
| 6614 | 12년 전 | 624 | ||
| 6613 |
강명구베드로
|
12년 전 | 536 | |
| 6612 |
|
12년 전 | 435 | |
| 6611 | 12년 전 | 1216 | ||
| 6610 | 12년 전 | 1036 | ||
| 6609 | 12년 전 | 3687 | ||
| 6608 |
|
12년 전 | 835 | |
| 6607 | 12년 전 | 702 | ||
| 6606 | 12년 전 | 570 | ||
| 6605 | 12년 전 | 462 | ||
| 6604 | 12년 전 | 980 | ||
| 6603 |
geektoo
|
12년 전 | 715 | |
| 6602 | 12년 전 | 851 | ||
| 6601 | 12년 전 | 375 | ||
| 6600 | 12년 전 | 423 | ||
| 6599 | 12년 전 | 574 | ||
| 6598 | 12년 전 | 957 | ||
| 6597 | 12년 전 | 954 | ||
| 6596 | 12년 전 | 440 | ||
| 6595 | 12년 전 | 797 | ||
| 6594 | 12년 전 | 4579 | ||
| 6593 | 12년 전 | 2584 | ||
| 6592 | 12년 전 | 837 | ||
| 6591 | 12년 전 | 599 | ||
| 6590 |
|
12년 전 | 1410 | |
| 6589 | 12년 전 | 781 | ||
| 6588 |
GINUSSOFT
|
12년 전 | 5136 | |
| 6587 | 12년 전 | 6223 | ||
| 6586 | 12년 전 | 1058 | ||
| 6585 | 12년 전 | 816 | ||
| 6584 | 12년 전 | 477 | ||
| 6583 |
|
12년 전 | 993 | |
| 6582 | 12년 전 | 884 | ||
| 6581 | 12년 전 | 859 | ||
| 6580 | 12년 전 | 627 | ||
| 6579 |
알랑가몰라
|
12년 전 | 944 | |
| 6578 | 12년 전 | 1341 | ||
| 6577 | 12년 전 | 1515 | ||
| 6576 |
경dragon
|
12년 전 | 786 | |
| 6575 | 12년 전 | 1899 | ||
| 6574 | 12년 전 | 699 | ||
| 6573 | 12년 전 | 1002 | ||
| 6572 |
|
12년 전 | 1683 | |
| 6571 |
CTOMAN
|
12년 전 | 1979 | |
| 6570 | 12년 전 | 1744 | ||
| 6569 | 12년 전 | 1902 | ||
| 6568 | 12년 전 | 2415 | ||
| 6567 | 12년 전 | 1037 | ||
| 6566 |
lainfox
|
12년 전 | 1542 | |
| 6565 | 12년 전 | 3667 | ||
| 6564 |
제주프라이스
|
12년 전 | 1545 | |
| 6563 | 12년 전 | 1580 | ||
| 6562 |
프로프리랜서
|
12년 전 | 1362 | |
| 6561 |
프로프리랜서
|
12년 전 | 983 | |
| 6560 |
프로프리랜서
|
12년 전 | 1242 | |
| 6559 |
프로프리랜서
|
12년 전 | 1153 | |
| 6558 |
프로프리랜서
|
12년 전 | 1367 | |
| 6557 |
프로프리랜서
|
12년 전 | 1990 | |
| 6556 |
프로프리랜서
|
12년 전 | 1533 | |
| 6555 |
프로프리랜서
|
12년 전 | 1377 | |
| 6554 |
프로프리랜서
|
12년 전 | 3901 | |
| 6553 |
프로프리랜서
|
12년 전 | 1523 | |
| 6552 | 12년 전 | 859 | ||
| 6551 |
왕초보sasa
|
12년 전 | 1553 | |
| 6550 |
왕초보sasa
|
12년 전 | 649 | |
| 6549 |
왕초보sasa
|
12년 전 | 919 | |
| 6548 | 12년 전 | 1311 | ||
| 6547 | 12년 전 | 1206 | ||
| 6546 | 12년 전 | 5173 | ||
| 6545 | 12년 전 | 2529 | ||
| 6544 |
AnnieK
|
12년 전 | 1794 | |
| 6543 |
베르무트7
|
12년 전 | 661 | |
| 6542 |
오늘도망했다
|
12년 전 | 2244 | |
| 6541 | 12년 전 | 825 | ||
| 6540 | 12년 전 | 1149 | ||
| 6539 | 12년 전 | 859 | ||
| 6538 |
senseme
|
12년 전 | 3384 | |
| 6537 | 12년 전 | 786 | ||
| 6536 | 12년 전 | 3675 | ||
| 6535 | 12년 전 | 1361 | ||
| 6534 | 12년 전 | 1632 | ||
| 6533 | 12년 전 | 2257 | ||
| 6532 |
냐옹이사범
|
12년 전 | 2315 | |
| 6531 | 12년 전 | 576 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기