Team:Concordia/JS/Base

From 2013.igem.org

(Difference between revisions)
Line 34: Line 34:
window.onload = function(){
window.onload = function(){
 +
    //Remove mediaWiki's markup
 +
    $("body").append(function(){ return $("#myContent",this); });
 +
    $("#globalWrapper").addClass("invisible");
 +
   
     $(".slice").hover( setBackgroundOnHover, setBackgroundDefault );
     $(".slice").hover( setBackgroundOnHover, setBackgroundDefault );
-
    if($(".meny").length > 0) {
+
/*    if($(".meny").length > 0) {
var meny = Meny.create({
var meny = Meny.create({
menuElement: document.querySelector('.meny'),
menuElement: document.querySelector('.meny'),
Line 44: Line 48:
touch: true
touch: true
});
});
-
     }
+
     }*/
     $(".closeAvgrund").click(hideAvgrund);
     $(".closeAvgrund").click(hideAvgrund);
     $(".team-member").click(showAvgrund);
     $(".team-member").click(showAvgrund);
};
};

Revision as of 20:31, 22 September 2013

var background_image_map = {

   "Project" : "project",
   "Notebook" : "notebook"

};

function setBackgroundOnHover(ev){

   var el = $('.contents');
   el.removeClass();
   el.addClass(background_image_map[this.firstChild.innerHTML]);
   el.addClass('contents');

};

function setBackgroundDefault(){

   var el = $('.contents');
   el.removeClass();
   el.addClass('contents');

};

function showAvgrund(ev) {

   $(".avgrund-popup").removeClass("invisible");
   var className = Array.prototype.filter.call(

ev.currentTarget.classList, function(el){ return el !== 'team-member' && el !== "col-md-3" })[0];

   $("h1").scrollTop();
   Avgrund.show("#"+className+"-modal");

}

function hideAvgrund(ev){

   $(".avgrund-popup").addClass("invisible");
   Avgrund.hide(ev);

};

window.onload = function(){

   //Remove mediaWiki's markup
   $("body").append(function(){ return $("#myContent",this); });
   $("#globalWrapper").addClass("invisible");
   
   $(".slice").hover( setBackgroundOnHover, setBackgroundDefault );

/* if($(".meny").length > 0) { var meny = Meny.create({ menuElement: document.querySelector('.meny'), contentsElement: document.querySelector('.contents'), position: 'left', width: 260, mouse: true, touch: true });

   }*/
   $(".closeAvgrund").click(hideAvgrund);
   $(".team-member").click(showAvgrund);

};