|
|
Line 3: |
Line 3: |
| <head> | | <head> |
| <link href="https://2014.igem.org/Template:Team:Macquarie_Australia/css/global?action=raw&ctype=text/css" rel="stylesheet"> | | <link href="https://2014.igem.org/Template:Team:Macquarie_Australia/css/global?action=raw&ctype=text/css" rel="stylesheet"> |
- | <script src="https://2014.igem.org/Team:Macquarie_Australia/js/banner?action=raw&ctype=text/javascript" type="text/javascript""></script> | + | <script src="https://2014.igem.org/Team:Macquarie_Australia/js/popup?action=raw&ctype=text/javascript" type="text/javascript""></script> |
| <style> | | <style> |
| #coverBack { | | #coverBack { |
Line 25: |
Line 25: |
| } | | } |
| </style> | | </style> |
- | <script>
| |
- | document.getElementById("coverBack”).style.height = window.screen.height;
| |
- | // document.getElementById("coverBack”) finds an element with id cover
| |
- | // window.screen.height returns the height of the window.
| |
- | // So we set the height of cover div to height of window.
| |
- | var winW, winH;
| |
- | browserWindowSize();
| |
- |
| |
- | document.getElementById(“photoBox").style.left = winW/2-300;
| |
- | // we set the position of box from left to >> (center position of window) – (width of the box)
| |
- | // Value of winW is obtained by function browserWindowSize(); which is defined below
| |
- |
| |
- | // This function is taken from http://www.developersnippets.com/2007/05/13/cross-browser-snippet-for-finding-the-size-of-the-browser-window/
| |
- | function browserWindowSize() {
| |
- | var browserWinWidth = 0, browserWinHeight = 0;
| |
- | if( typeof( window.innerWidth ) == ‘number’ ) {
| |
- | //Non-IE
| |
- | browserWinWidth = window.innerWidth;
| |
- | browserWinHeight = window.innerHeight;
| |
- | } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
| |
- | //IE 6+ in ‘standards compliant mode’
| |
- | browserWinWidth = document.documentElement.clientWidth;
| |
- | browserWinHeight = document.documentElement.clientHeight;
| |
- | } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
| |
- | //IE 4 compatible
| |
- | browserWinWidth = document.body.clientWidth;
| |
- | browserWinHeight = document.body.clientHeight;
| |
- | }
| |
- | winW = browserWinWidth;
| |
- | winH = browserWinHeight;
| |
- | // alert( ‘Browser Window Width = ‘ + browserWinWidth +’ Browser Window Height = ‘+browserWinHeight);
| |
- | }
| |
- |
| |
- | function coverIt() {
| |
- | // Set the visiblity of cover to visible
| |
- | document.getElementById("coverBack”).style.visibility = "visible";
| |
- | // set the visibility of box to visible.
| |
- | document.getElementById(“photoBox").style.visibility = "visible";
| |
- | }
| |
- | // Call the function coverIt when somebody clicks on anything whose id it "initiator"
| |
- | document.getElementById(“init”).onclick = coverIt;
| |
- |
| |
- | function backToNormal() {
| |
- | // Set the visiblity of cover to hidden
| |
- | document.getElementById("coverBack”).style.visibility = "hidden";
| |
- | }
| |
- | // Call the function backToNormal() when somebody clicks on cover
| |
- | document.getElementById("coverBack”).onclick = backToNormal;
| |
- | </script>
| |
| </head> | | </head> |
| <body> | | <body> |