Sol barra

De wikiserver
La revisió el 13:40, 2 oct 2017 per Jnoguera (Discussió | contribucions) (Es crea la pàgina amb «<html> <head> <script type="text/javascript" > * Exercici scrollbars *: var win; var scrollbars = 'yes';...».)
(dif) ← Versió més antiga | Versió actual (dif) | Versió més nova → (dif)
Dreceres ràpides: navegació, cerca

<html> <head>

       <script type="text/javascript" >
           /*  * Exercici scrollbars *  */
           var win;
           var scrollbars = 'yes';
           var url = "";
           function hide_show() {
               // mostra o oculta les scrollbars
               scrollbars = (scrollbars == 'yes') ? 'no' : 'yes';
               // //si ens han mogut la finestra agafem el top i el left var x = win.screenX; 
              /* var x = win.screenX
               var y = win.screenY; //matem la finestra 
             */
               //matem la finestra 
               win.close();
               //la tornem a crear a la mateixa posició amb les noves scrollbars 
               openat(x, y);
           }
           function openPopUp() {
               openat(0, 0);
           }


           function openat(xx, yy) {
               win = window.open("http://www.google.es", "mou", "location=yes,menubar=yes,toolbar=yes,left=" + xx + ",top=" + yy + ",width=350,height=150,scrollbars=" + scrollbars);
               //creem dos div per tal de mostrar la informació sobre el location i el navigator     var div2 = win.document.createElement('div');     div2.setAttribute('id', 'location');  
               /*  div2.style.fontSize = '15px';
                win.document.body.insertBefore(div2, win.document.body.firstChild);
                var div = win.document.createElement('div');
                div.setAttribute('id', 'navigator');
                div.style.fontSize = '15px';
                win.document.body.insertBefore(div, win.document.body.firstChild);*/
               // obtenim les dades a mostrar   
               showDades();
           }
           function closePopUp() {
               win.close();
           }
           function reset() {
               closePopUp();
               openPopUp();
           }
           function showNavigator() {
               var data = "";
               data = data + "Informacio sobre el navegador : " + "
"; data = data + " appCodeName: " + win.navigator.appCodeName + "
"; data = data + " appName: " + win.navigator.appName + "
"; data = data + " appVersion: " + win.navigator.appVersion + "
"; data = data + " cookieEnabled: " + win.navigator.cookieEnabled + "
"; data = data + " onLine: " + win.navigator.onLine + "
"; data = data + " platform: " + win.navigator.platform + "
"; data = data + " userAgent: " + win.navigator.userAgent + "
"; document.getElementById("navigator").innerHTML = data; } function showHistory() { var data = ""; data = data + "Informacio sobre el historial : " + "
"; data = data + " numero de pagines visitades: " + window.history.length; document.getElementById("dades").innerHTML = data; } function showLocation() { var data = ""; data = data + "Informacio sobre la URL: " + "
"; data = data + " hash: " + win.location.hash + "
"; data = data + " host: " + win.location.host + "
"; data = data + " hostname: " + win.location.hostname + "
"; data = data + " href: " + win.location.href + "
"; data = data + " pathname: " + win.location.pathname + "
"; data = data + " port: " + win.location.port + "
"; data = data + " protocol: " + win.location.protocol + "
"; data = data + " search: " + win.location.search + "
"; document.getElementById("location").innerHTML = data; } function showDades() { showNavigator(); showHistory(); showLocation(); } </script>


       <style type="text/css"> 
           html {  font-family: "courier new"; }
       </style>
   </head> 
   <body >   
       <button onclick="openPopUp();">obrir</button>  
       <button onclick="reset();">reset</button>   
       <button onclick="closePopUp();">tancar</button>   

<button onclick="hide_show();">Mostra/amaga barres de desplaçament</button>

</body> </html>