댓글 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년 전 | 1172 | |
| 6629 | 12년 전 | 1169 | ||
| 6628 |
put777
|
12년 전 | 651 | |
| 6627 |
|
12년 전 | 706 | |
| 6626 | 12년 전 | 1621 | ||
| 6625 |
|
12년 전 | 728 | |
| 6624 |
미켈란젤로의왼손
|
12년 전 | 493 | |
| 6623 |
|
12년 전 | 1054 | |
| 6622 | 12년 전 | 1404 | ||
| 6621 |
차가운바람
|
12년 전 | 644 | |
| 6620 | 12년 전 | 745 | ||
| 6619 |
|
12년 전 | 982 | |
| 6618 | 12년 전 | 1753 | ||
| 6617 | 12년 전 | 647 | ||
| 6616 |
차가운바람
|
12년 전 | 905 | |
| 6615 | 12년 전 | 2861 | ||
| 6614 | 12년 전 | 623 | ||
| 6613 |
강명구베드로
|
12년 전 | 535 | |
| 6612 |
|
12년 전 | 435 | |
| 6611 | 12년 전 | 1215 | ||
| 6610 | 12년 전 | 1036 | ||
| 6609 | 12년 전 | 3686 | ||
| 6608 |
|
12년 전 | 835 | |
| 6607 | 12년 전 | 702 | ||
| 6606 | 12년 전 | 569 | ||
| 6605 | 12년 전 | 462 | ||
| 6604 | 12년 전 | 980 | ||
| 6603 |
geektoo
|
12년 전 | 712 | |
| 6602 | 12년 전 | 850 | ||
| 6601 | 12년 전 | 374 | ||
| 6600 | 12년 전 | 422 | ||
| 6599 | 12년 전 | 574 | ||
| 6598 | 12년 전 | 956 | ||
| 6597 | 12년 전 | 953 | ||
| 6596 | 12년 전 | 439 | ||
| 6595 | 12년 전 | 797 | ||
| 6594 | 12년 전 | 4579 | ||
| 6593 | 12년 전 | 2583 | ||
| 6592 | 12년 전 | 835 | ||
| 6591 | 12년 전 | 598 | ||
| 6590 |
|
12년 전 | 1409 | |
| 6589 | 12년 전 | 780 | ||
| 6588 |
GINUSSOFT
|
12년 전 | 5135 | |
| 6587 | 12년 전 | 6222 | ||
| 6586 | 12년 전 | 1055 | ||
| 6585 | 12년 전 | 815 | ||
| 6584 | 12년 전 | 475 | ||
| 6583 |
|
12년 전 | 990 | |
| 6582 | 12년 전 | 883 | ||
| 6581 | 12년 전 | 857 | ||
| 6580 | 12년 전 | 626 | ||
| 6579 |
알랑가몰라
|
12년 전 | 942 | |
| 6578 | 12년 전 | 1340 | ||
| 6577 | 12년 전 | 1514 | ||
| 6576 |
경dragon
|
12년 전 | 784 | |
| 6575 | 12년 전 | 1897 | ||
| 6574 | 12년 전 | 696 | ||
| 6573 | 12년 전 | 1000 | ||
| 6572 |
|
12년 전 | 1681 | |
| 6571 |
CTOMAN
|
12년 전 | 1976 | |
| 6570 | 12년 전 | 1743 | ||
| 6569 | 12년 전 | 1902 | ||
| 6568 | 12년 전 | 2415 | ||
| 6567 | 12년 전 | 1037 | ||
| 6566 |
lainfox
|
12년 전 | 1541 | |
| 6565 | 12년 전 | 3666 | ||
| 6564 |
제주프라이스
|
12년 전 | 1545 | |
| 6563 | 12년 전 | 1580 | ||
| 6562 |
프로프리랜서
|
12년 전 | 1361 | |
| 6561 |
프로프리랜서
|
12년 전 | 981 | |
| 6560 |
프로프리랜서
|
12년 전 | 1239 | |
| 6559 |
프로프리랜서
|
12년 전 | 1150 | |
| 6558 |
프로프리랜서
|
12년 전 | 1365 | |
| 6557 |
프로프리랜서
|
12년 전 | 1989 | |
| 6556 |
프로프리랜서
|
12년 전 | 1533 | |
| 6555 |
프로프리랜서
|
12년 전 | 1376 | |
| 6554 |
프로프리랜서
|
12년 전 | 3899 | |
| 6553 |
프로프리랜서
|
12년 전 | 1522 | |
| 6552 | 12년 전 | 858 | ||
| 6551 |
왕초보sasa
|
12년 전 | 1552 | |
| 6550 |
왕초보sasa
|
12년 전 | 647 | |
| 6549 |
왕초보sasa
|
12년 전 | 919 | |
| 6548 | 12년 전 | 1310 | ||
| 6547 | 12년 전 | 1205 | ||
| 6546 | 12년 전 | 5172 | ||
| 6545 | 12년 전 | 2528 | ||
| 6544 |
AnnieK
|
12년 전 | 1792 | |
| 6543 |
베르무트7
|
12년 전 | 659 | |
| 6542 |
오늘도망했다
|
12년 전 | 2243 | |
| 6541 | 12년 전 | 825 | ||
| 6540 | 12년 전 | 1148 | ||
| 6539 | 12년 전 | 857 | ||
| 6538 |
senseme
|
12년 전 | 3384 | |
| 6537 | 12년 전 | 786 | ||
| 6536 | 12년 전 | 3674 | ||
| 6535 | 12년 전 | 1360 | ||
| 6534 | 12년 전 | 1631 | ||
| 6533 | 12년 전 | 2256 | ||
| 6532 |
냐옹이사범
|
12년 전 | 2314 | |
| 6531 | 12년 전 | 576 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기