Skip to content

Instantly share code, notes, and snippets.

@captDaylight
Created June 24, 2013 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save captDaylight/5850330 to your computer and use it in GitHub Desktop.
Save captDaylight/5850330 to your computer and use it in GitHub Desktop.
MADPRESS.About = {
init: function(data, callback) {
},
index: function(data, callback) {
var scrolling = false;
$('#about-side-nav').localScroll({ duration: 1000, onAfter: function() {
scrolling = false;
}});
$(window).stellar({ horizontalScrolling: false });
$('#slide-one, #slide-two, #slide-three, #slide-four, #slide-five').waypoint(function(direction) {
if(!scrolling){
var id = $(this).attr('id').split('-')[1];
$('.about-nav-select, .about-nav-text').removeClass('selected');
$('#nav-'+ id+ ', #nav-text-'+id).addClass('selected');
}
});
$('#yellow-bubble').waypoint(function(direction){
$('#yellow-bubble-trigger').fadeIn(750,function(){
$('#red-bubble-trigger').fadeIn(750,function(){
$('#blue-bubble-trigger').fadeIn(750,function(){
$('#green-bubble-trigger').fadeIn(750);
});
});
});
});
$('.about-nav-select').click(function(){
$('.about-nav-select, .about-nav-text').removeClass('selected');
var id = $(this).attr('id').split('-')[1];
$(this).addClass('selected');
$('#nav-text-'+id).addClass('selected');
scrolling = true;
});
$('.bubble').mouseenter(function(){
if(!$(this).hasClass('animating')){
var width = 0;
var height = 0;
if($(this).hasClass('small')){
var width = 100;
var height = 100;
}else if($(this).hasClass('medium')){
var width = 140;
var height = 140;
}else{
var width = 180;
var height = 180;
}
var that = this;
$(this).find('.bubble-text').animate({
'width': width,
'height': height,
'margin-top':-width/2,
'margin-left':-width/2
},100,function(){
if(!$(that).hasClass('animating')){
$(this).find('p').css({
'display':'table-cell'
});
}
});
}
}).mouseleave(function(){
$(this).addClass('animating');
$(this).find('.bubble-text p').css({
'display':'none'
});
var that = this;
$(this).find('.bubble-text').animate({
'width':0,
'height':0,
'margin-top':0,
'margin-left':0
},100,function(){
$(that).find('p').css({
'display': 'none'
});
$(that).removeClass('animating');
}).find('p').css({
'display': 'none'
});
});
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment