Skip to content

Commit

Permalink
condenses the face-click code; closes issue #50
Browse files Browse the repository at this point in the history
  • Loading branch information
rjmk committed May 16, 2015
1 parent b775599 commit bee681f
Showing 1 changed file with 5 additions and 65 deletions.
70 changes: 5 additions & 65 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,6 @@
$('#Anni').click(function(){
$('#DanielProfile').addClass('hidden');
$('#MinaProfile').addClass('hidden');
$('#RafeProfile').addClass('hidden');
$('#AnniProfile').toggleClass('hidden');
});

$('#Daniel').click(function(){
$('#DanielProfile').toggleClass('hidden');
$('#MinaProfile').addClass('hidden');
$('#RafeProfile').addClass('hidden');
$('#AnniProfile').addClass('hidden');
});

$('#Mina').click(function(){
$('#DanielProfile').addClass('hidden');
$('#MinaProfile').toggleClass('hidden');
$('#RafeProfile').addClass('hidden');
$('#AnniProfile').addClass('hidden');
});

$('#Rafe').click(function(){
$('#DanielProfile').addClass('hidden');
$('#MinaProfile').addClass('hidden');
$('#RafeProfile').toggleClass('hidden');
$('#AnniProfile').addClass('hidden');
});
$('.face').click(function(){
$('.profile').toggleClass('hidden');
})

$('#hamburger').click(function(){
$('#navigation').toggleClass('hidden');
Expand Down Expand Up @@ -58,41 +34,5 @@ filterMethod.call(filterMethod.call(document.getElementById('blog-carousel').chi
}).children , function(element){
return element.className === 'right-arrow';
}).forEach(function(element){
element.addEventListener("click",carouselShift(1, element))
})

// var start;
// var stop;
// var variables = {
// startX: 0,
// ev: undefined
// }
// var start = function(ev,elem){
// return function(){
// variables.startX = ev.pageX;
// variables.ev = ev;
// }
// }

// var stop = function(ev,elem){
// var distX = ev.pageX - variables.startX;
// console.log(distX);
// if (distX > 100){
// this.carouselShift(-1);
// }
// if (distX < -100){
// this.carouselShift(1);
// }
// }

// filterMethod.call(document.getElementsByClassName('carousel')[0].children, function(element){
// return element.className === 'mini-blog' || element.class === 'projects';
// }).forEach(function(element){element.addEventListener("touchstart",function(ev){
// start(ev,element);
// })});

// filterMethod.call(document.getElementsByClassName('carousel')[0].children, function(element){
// return element.className === 'mini-blog' || element.class === 'projects';
// }).forEach(function(element){element.addEventListener("touchend",function(ev){
// stop(ev,element);
// })});
element.addEventListener("click",carouselShift(1, element));
});

1 comment on commit bee681f

@rjmk
Copy link
Contributor Author

@rjmk rjmk commented on bee681f May 16, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! Doesn't quite.

Please sign in to comment.