COMING SOON 🚀

다이나믹한 화면움직임

 
이런화면.. css로 꾸미는거맞나요?
 
아니면 다이나믹 코드로 입힌건가요?
 
저런 소스좀 구하고싶어요. 좀 알려주세요
|

댓글 2개

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);
jquery 부분을 제외하면 대부분 css에서 컨트롤 하지만 모던브라우저가 아니면 표현하지 못합니다.
css media 부분이 가로폭에 따라 대응하는 스타일이죠~

저도 자주 쓰긴 합니다만, ie7, 8같이 표현 못하는 경우는 걍 min-width로 고정시켜버리면 문제는 끝...이라...-0-;
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
12년 전 조회 1,999
12년 전 조회 6,379
12년 전 조회 7,436
12년 전 조회 2,304
12년 전 조회 2,074
12년 전 조회 1,703
12년 전 조회 2,236
12년 전 조회 2,103
12년 전 조회 2,087
12년 전 조회 1,897
12년 전 조회 2,153
12년 전 조회 2,604
12년 전 조회 2,726
12년 전 조회 1,994
12년 전 조회 3,103
12년 전 조회 1,920
12년 전 조회 2,213
12년 전 조회 2,931
12년 전 조회 3,184
12년 전 조회 2,991
12년 전 조회 3,104
12년 전 조회 3,666
12년 전 조회 2,275
12년 전 조회 2,794
12년 전 조회 4,915
12년 전 조회 2,754
12년 전 조회 2,834
12년 전 조회 2,597
12년 전 조회 2,233
12년 전 조회 2,484
12년 전 조회 2,377
12년 전 조회 2,552
12년 전 조회 3,207
12년 전 조회 2,765
12년 전 조회 2,618
12년 전 조회 5,188
12년 전 조회 2,821
12년 전 조회 2,098
12년 전 조회 2,800
12년 전 조회 1,909
12년 전 조회 2,148
12년 전 조회 2,572
12년 전 조회 2,430
12년 전 조회 6,436
12년 전 조회 3,788
12년 전 조회 3,083
12년 전 조회 1,826
12년 전 조회 3,353
12년 전 조회 2,017
12년 전 조회 2,313
12년 전 조회 2,070
12년 전 조회 4,601
12년 전 조회 1,952
12년 전 조회 4,833
12년 전 조회 2,554
12년 전 조회 2,802
12년 전 조회 3,441
12년 전 조회 3,506
12년 전 조회 1,751
12년 전 조회 1,839
12년 전 조회 2,492
12년 전 조회 1,846
12년 전 조회 1,989
12년 전 조회 7,793
12년 전 조회 1,760
12년 전 조회 2,047
12년 전 조회 1,689
12년 전 조회 1,724
12년 전 조회 1,973
12년 전 조회 1,958
12년 전 조회 2,925
12년 전 조회 2,959
12년 전 조회 2,549
12년 전 조회 6,418
12년 전 조회 2,708
12년 전 조회 2,800
12년 전 조회 2,181
12년 전 조회 3,183
12년 전 조회 2,579
12년 전 조회 4,277
12년 전 조회 3,747
12년 전 조회 3,103
12년 전 조회 3,585
12년 전 조회 3,027
12년 전 조회 2,859
12년 전 조회 2,198
12년 전 조회 2,327
12년 전 조회 6,760
12년 전 조회 3,825
12년 전 조회 4,292
12년 전 조회 2,940
12년 전 조회 2,652
12년 전 조회 2,023
12년 전 조회 3,003
12년 전 조회 2,144
12년 전 조회 2,652
12년 전 조회 3,897
12년 전 조회 3,521
12년 전 조회 2,870
12년 전 조회 7,796