댓글 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-;
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 6730 |
|
11년 전 | 1109 | |
| 6729 | 11년 전 | 565 | ||
| 6728 |
|
11년 전 | 579 | |
| 6727 | 11년 전 | 2424 | ||
| 6726 | 11년 전 | 598 | ||
| 6725 |
네모웹에이전시
|
11년 전 | 442 | |
| 6724 |
네모웹에이전시
|
11년 전 | 886 | |
| 6723 | 11년 전 | 1020 | ||
| 6722 | 11년 전 | 962 | ||
| 6721 | 11년 전 | 648 | ||
| 6720 | 11년 전 | 1977 | ||
| 6719 | 11년 전 | 2199 | ||
| 6718 | 11년 전 | 1103 | ||
| 6717 |
|
11년 전 | 660 | |
| 6716 | 11년 전 | 2311 | ||
| 6715 | 11년 전 | 7580 | ||
| 6714 | 11년 전 | 2049 | ||
| 6713 | 11년 전 | 782 | ||
| 6712 |
geektoo
|
11년 전 | 1158 | |
| 6711 | 11년 전 | 900 | ||
| 6710 |
sirzzang
|
11년 전 | 2130 | |
| 6709 |
bewitched
|
11년 전 | 1801 | |
| 6708 |
levin
|
11년 전 | 570 | |
| 6707 | 11년 전 | 768 | ||
| 6706 | 11년 전 | 1798 | ||
| 6705 | 11년 전 | 992 | ||
| 6704 |
|
11년 전 | 758 | |
| 6703 | 11년 전 | 417 | ||
| 6702 | 11년 전 | 1100 | ||
| 6701 | 11년 전 | 806 | ||
| 6700 | 11년 전 | 1721 | ||
| 6699 | 11년 전 | 716 | ||
| 6698 |
이박사친구
|
11년 전 | 730 | |
| 6697 | 11년 전 | 1219 | ||
| 6696 | 11년 전 | 620 | ||
| 6695 |
Header
|
11년 전 | 707 | |
| 6694 | 11년 전 | 1164 | ||
| 6693 |
|
11년 전 | 1115 | |
| 6692 | 11년 전 | 1151 | ||
| 6691 | 11년 전 | 1289 | ||
| 6690 |
|
11년 전 | 717 | |
| 6689 | 11년 전 | 896 | ||
| 6688 | 11년 전 | 935 | ||
| 6687 | 11년 전 | 535 | ||
| 6686 |
RGB255
|
11년 전 | 964 | |
| 6685 |
|
11년 전 | 640 | |
| 6684 | 11년 전 | 720 | ||
| 6683 | 11년 전 | 387 | ||
| 6682 | 11년 전 | 1131 | ||
| 6681 | 11년 전 | 1420 | ||
| 6680 | 11년 전 | 454 | ||
| 6679 |
RGB255
|
11년 전 | 397 | |
| 6678 | 11년 전 | 1352 | ||
| 6677 |
|
11년 전 | 444 | |
| 6676 | 11년 전 | 1018 | ||
| 6675 |
디자이너필이
|
11년 전 | 827 | |
| 6674 | 11년 전 | 1242 | ||
| 6673 | 11년 전 | 1315 | ||
| 6672 | 11년 전 | 6031 | ||
| 6671 | 11년 전 | 1340 | ||
| 6670 |
하프의정령
|
11년 전 | 573 | |
| 6669 | 11년 전 | 414 | ||
| 6668 |
공부하고가겠슴다
|
11년 전 | 452 | |
| 6667 |
하프의정령
|
11년 전 | 550 | |
| 6666 | 11년 전 | 790 | ||
| 6665 | 12년 전 | 1414 | ||
| 6664 | 12년 전 | 930 | ||
| 6663 | 12년 전 | 1157 | ||
| 6662 | 12년 전 | 412 | ||
| 6661 |
basketball
|
12년 전 | 507 | |
| 6660 | 12년 전 | 2510 | ||
| 6659 | 12년 전 | 1612 | ||
| 6658 |
|
12년 전 | 1336 | |
| 6657 |
|
12년 전 | 3160 | |
| 6656 | 12년 전 | 566 | ||
| 6655 |
프로프리랜서
|
12년 전 | 2334 | |
| 6654 |
프로프리랜서
|
12년 전 | 1912 | |
| 6653 |
프로프리랜서
|
12년 전 | 1746 | |
| 6652 |
프로프리랜서
|
12년 전 | 1831 | |
| 6651 |
|
12년 전 | 784 | |
| 6650 | 12년 전 | 1317 | ||
| 6649 | 12년 전 | 1318 | ||
| 6648 | 12년 전 | 813 | ||
| 6647 | 12년 전 | 3162 | ||
| 6646 | 12년 전 | 471 | ||
| 6645 | 12년 전 | 966 | ||
| 6644 |
BBAYOUNG
|
12년 전 | 1380 | |
| 6643 | 12년 전 | 1793 | ||
| 6642 | 12년 전 | 643 | ||
| 6641 | 12년 전 | 1333 | ||
| 6640 | 12년 전 | 707 | ||
| 6639 | 12년 전 | 2321 | ||
| 6638 |
jasmin2
|
12년 전 | 753 | |
| 6637 |
geektoo
|
12년 전 | 447 | |
| 6636 | 12년 전 | 667 | ||
| 6635 |
프로프리랜서
|
12년 전 | 2235 | |
| 6634 |
프로프리랜서
|
12년 전 | 1743 | |
| 6633 |
프로프리랜서
|
12년 전 | 4060 | |
| 6632 |
프로프리랜서
|
12년 전 | 1348 | |
| 6631 |
프로프리랜서
|
12년 전 | 1783 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기