Team:Vanderbilt/Buttons
From 2014.igem.org
(Difference between revisions)
m |
|||
Line 1: | Line 1: | ||
- | + | document.getElementById("igem_header").innerHTML = "reached before buttons creation"; | |
+ | |||
function Buttons(p) | function Buttons(p) | ||
{ | { | ||
Line 9: | Line 10: | ||
/**@description These functions cause the Buttons on the page to change the SubPage when clicked.**/ | /**@description These functions cause the Buttons on the page to change the SubPage when clicked.**/ | ||
+ | |||
leftButton.onclick=function(){ | leftButton.onclick=function(){ | ||
page.turnPage(-1); | page.turnPage(-1); | ||
Line 35: | Line 37: | ||
rightButton.style.visibility = "visible"; | rightButton.style.visibility = "visible"; | ||
} | } | ||
- | } | + | }; |
} | } |
Revision as of 21:10, 25 January 2015
document.getElementById("igem_header").innerHTML = "reached before buttons creation";
function Buttons(p) {
var leftButton = document.getElementById("left_button"); var rightButton = document.getElementById("right_button"); var page = p;
document.getElementById("igem_header").innerHTML = "reached inside buttons creation";
/**@description These functions cause the Buttons on the page to change the SubPage when clicked.**/
leftButton.onclick=function(){
page.turnPage(-1); updateButtons(page.getSubPageNum());
};
rightButton.onclick=function(){
document.getElementById("igem_header").innerHTML = "reached rightbutton on click"; page.turnPage(1); updateButtons(page.getSubPageNum());
};
this.updateButtons function(subPageNum) {
document.getElementById("igem_header").innerHTML = "reached updateButtons"; if(subPageNum == 1) { leftButton.style.visibility = "hidden"; rightButton.style.visibility = "visible"; } else if(subPageNum == thisPage.getMaxSubPage()) { leftButton.style.visibility = "visible"; rightButton.style.visibility = "hidden"; } else { leftButton.style.visibility = "visible"; rightButton.style.visibility = "visible"; }
}; }