jQuery , ,
. , Velocity.js Greensock, . , , CSS (3).
jQuery- CSS, CSS3 transition jQuery, :
jsBin demo
.section {height: 80px;}
.trigger {cursor: pointer;}
.content { opacity: 0; transition: opacity 1s; }
.CSS3fadeIn{opacity: 1;}
var $fullpage = $("#fullpage");
var $sections = $fullpage.find(".section");
var $content = $sections.find(".content");
var $visible = null;
$sections.on("click", ".trigger", function(){
if($visible) $visible.removeClass("CSS3fadeIn");
$visible = $(this).next(".content");
$visible.addClass("CSS3fadeIn");
});
, CSS3 . , , . ( , jQuery ofc, CSS3 ).
, (... ) - :
$(".partyBrakers").remove();
, (, ), .
setInterval( letsDance, 800 );
function letsDance() {
$(".dancer").fadeToggle();
}
var $dancers = $(".dancer");
setInterval( letsDance, 800 );
function letsDance() {
$dancers.fadeToggle();
}
.
, , : .
- , , - :
var $danceFloor = $("#danceFloor");
var $dancers = $danceFloor.find(".dancer");
$dancers.on("click", function(){
$(this).addClass("tiredDancer");
});
$("#button_kickTiredDancers").on("click", function() {
$danceFloor.find(".tiredDancer").remove();
});
, , #danceFloor , .tiredDancer.
listOfTiredDancers :
var listOfTiredDancers = [];
$dancers.on("click", function(){
listOfTiredDancers.push( this );
});
push (this) , :
$("#button_kickTiredDancers").on("click", function() {
$( listOfTiredDancers ).remove();
});
" , " (, ).