댓글 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년 전 | 1160 | |
| 6629 | 12년 전 | 1155 | ||
| 6628 |
put777
|
12년 전 | 642 | |
| 6627 |
|
12년 전 | 696 | |
| 6626 | 12년 전 | 1616 | ||
| 6625 |
|
12년 전 | 717 | |
| 6624 |
미켈란젤로의왼손
|
12년 전 | 481 | |
| 6623 |
|
12년 전 | 1043 | |
| 6622 | 12년 전 | 1384 | ||
| 6621 |
차가운바람
|
12년 전 | 631 | |
| 6620 | 12년 전 | 731 | ||
| 6619 |
|
12년 전 | 968 | |
| 6618 | 12년 전 | 1741 | ||
| 6617 | 12년 전 | 638 | ||
| 6616 |
차가운바람
|
12년 전 | 892 | |
| 6615 | 12년 전 | 2853 | ||
| 6614 | 12년 전 | 613 | ||
| 6613 |
강명구베드로
|
12년 전 | 529 | |
| 6612 |
|
12년 전 | 424 | |
| 6611 | 12년 전 | 1205 | ||
| 6610 | 12년 전 | 1021 | ||
| 6609 | 12년 전 | 3679 | ||
| 6608 |
|
12년 전 | 830 | |
| 6607 | 12년 전 | 692 | ||
| 6606 | 12년 전 | 565 | ||
| 6605 | 12년 전 | 453 | ||
| 6604 | 12년 전 | 972 | ||
| 6603 |
geektoo
|
12년 전 | 694 | |
| 6602 | 12년 전 | 836 | ||
| 6601 | 12년 전 | 359 | ||
| 6600 | 12년 전 | 401 | ||
| 6599 | 12년 전 | 538 | ||
| 6598 | 12년 전 | 936 | ||
| 6597 | 12년 전 | 932 | ||
| 6596 | 12년 전 | 416 | ||
| 6595 | 12년 전 | 787 | ||
| 6594 | 12년 전 | 4576 | ||
| 6593 | 12년 전 | 2579 | ||
| 6592 | 12년 전 | 826 | ||
| 6591 | 12년 전 | 584 | ||
| 6590 |
|
12년 전 | 1388 | |
| 6589 | 12년 전 | 759 | ||
| 6588 |
GINUSSOFT
|
12년 전 | 5125 | |
| 6587 | 12년 전 | 6210 | ||
| 6586 | 12년 전 | 1043 | ||
| 6585 | 12년 전 | 802 | ||
| 6584 | 12년 전 | 459 | ||
| 6583 |
|
12년 전 | 983 | |
| 6582 | 12년 전 | 871 | ||
| 6581 | 12년 전 | 841 | ||
| 6580 | 12년 전 | 617 | ||
| 6579 |
알랑가몰라
|
12년 전 | 921 | |
| 6578 | 12년 전 | 1328 | ||
| 6577 | 12년 전 | 1500 | ||
| 6576 |
경dragon
|
12년 전 | 768 | |
| 6575 | 12년 전 | 1880 | ||
| 6574 | 12년 전 | 681 | ||
| 6573 | 12년 전 | 978 | ||
| 6572 |
|
12년 전 | 1664 | |
| 6571 |
CTOMAN
|
12년 전 | 1954 | |
| 6570 | 12년 전 | 1728 | ||
| 6569 | 12년 전 | 1885 | ||
| 6568 | 12년 전 | 2403 | ||
| 6567 | 12년 전 | 1031 | ||
| 6566 |
lainfox
|
12년 전 | 1529 | |
| 6565 | 12년 전 | 3655 | ||
| 6564 |
제주프라이스
|
12년 전 | 1533 | |
| 6563 | 12년 전 | 1574 | ||
| 6562 |
프로프리랜서
|
12년 전 | 1345 | |
| 6561 |
프로프리랜서
|
12년 전 | 964 | |
| 6560 |
프로프리랜서
|
12년 전 | 1218 | |
| 6559 |
프로프리랜서
|
12년 전 | 1135 | |
| 6558 |
프로프리랜서
|
12년 전 | 1351 | |
| 6557 |
프로프리랜서
|
12년 전 | 1975 | |
| 6556 |
프로프리랜서
|
12년 전 | 1521 | |
| 6555 |
프로프리랜서
|
12년 전 | 1363 | |
| 6554 |
프로프리랜서
|
12년 전 | 3889 | |
| 6553 |
프로프리랜서
|
12년 전 | 1508 | |
| 6552 | 12년 전 | 843 | ||
| 6551 |
왕초보sasa
|
12년 전 | 1534 | |
| 6550 |
왕초보sasa
|
12년 전 | 628 | |
| 6549 |
왕초보sasa
|
12년 전 | 903 | |
| 6548 | 12년 전 | 1301 | ||
| 6547 | 12년 전 | 1190 | ||
| 6546 | 12년 전 | 5156 | ||
| 6545 | 12년 전 | 2514 | ||
| 6544 |
AnnieK
|
12년 전 | 1777 | |
| 6543 |
베르무트7
|
12년 전 | 627 | |
| 6542 |
오늘도망했다
|
12년 전 | 2232 | |
| 6541 | 12년 전 | 819 | ||
| 6540 | 12년 전 | 1134 | ||
| 6539 | 12년 전 | 849 | ||
| 6538 |
senseme
|
12년 전 | 3370 | |
| 6537 | 12년 전 | 779 | ||
| 6536 | 12년 전 | 3666 | ||
| 6535 | 12년 전 | 1349 | ||
| 6534 | 12년 전 | 1624 | ||
| 6533 | 12년 전 | 2242 | ||
| 6532 |
냐옹이사범
|
12년 전 | 2307 | |
| 6531 | 12년 전 | 568 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기