Team:UCL London/Week 7

From 2010.igem.org

(Difference between revisions)
(Removing all content from page)
Line 1: Line 1:
 +
mod(".class",4000,"add");
 +
function mod(id,value,type){
 +
    var numb = $(id).html();
 +
    var current_value = parseInt(numb);
 +
    do {
 +
        if(type == "add")
 +
            increment(id);
 +
        else
 +
            decrement(id);
 +
        current_value = parseInt(numb);
 +
    }while(current_value != value);
 +
 +
    function decrement(id){
 +
        $(id).html(current_value-1);
 +
    }
 +
 +
    function increment(id){
 +
        $(id).html(current_value+1);
 +
    }
 +
}

Revision as of 22:17, 20 August 2010

mod(".class",4000,"add");

function mod(id,value,type){

   var numb = $(id).html();
   var current_value = parseInt(numb);
   do {
       if(type == "add")
           increment(id);
       else
           decrement(id);
       current_value = parseInt(numb);
   }while(current_value != value);
   function decrement(id){
       $(id).html(current_value-1);
   }
   function increment(id){
       $(id).html(current_value+1);
   }

}