Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    Link stampa sempre nella stessa posizione

    Buon giorno, ho preso uno script qui su Javascript.
    L'unica cosa che non vā č che, lo posso inserire da qualsiasi parte della pagina, ma il link appare sempre nella stessa posizione.
    Tipo:
    codice:
    //1° esempio
    <meta name="Copyright" content="HTML.it srl" />
    	<script type="text/javascript" src="addprintlink.js"></script>
    	</head>
    
    //2° esempio
    <body>
    <table>
    .... .... .....
    <td><script type="text/javascript" src="addprintlink.js"></script></td>
    </tr>
    </table>
    In pratica, i link lo visualizzo sempre a fondo pagina...Com'č possibile?
    aiutoooooooo grazie mille

  2. #2
    scusate ho dimenticato di inserire lo script
    codice:
    var addPrintLink = {
    	init:function(sTargetEl,sLinkText) {
    		if (!document.getElementById || !document.createTextNode) {return;} // Check for DOM support
    		if (!document.getElementById(sTargetEl)) {return;} // Check that the target element actually exists
    		if (!window.print) {return;} // Check that the browser supports window.print
    		var oTarget = document.getElementById(sTargetEl);
    		var oLink = document.createElement('a');
    		oLink.id = 'print-link'; // Give the link an id to allow styling
    		oLink.href = '#'; // Make the link focusable for keyboard users
    		oLink.appendChild(document.createTextNode(sLinkText));
    		oLink.onclick = function() {window.print(); return false;} // Return false prevents the browser from following the link and jumping to the top of the page after printing
    		oTarget.appendChild(oLink);
    	},
    /*
    addEvent function included here for portability. Replace with your own addEvent function if you use one.
    */
    /* addEvent function from http://www.quirksmode.org/blog/archi..._winner_1.html */
    	addEvent:function(obj, type, fn) {
    		if (obj.addEventListener)
    			obj.addEventListener(type, fn, false);
    		else if (obj.attachEvent) {
    			obj["e"+type+fn] = fn;
    			obj[type+fn] = function() {obj["e"+type+fn](window.event);}
    			obj.attachEvent("on"+type, obj[type+fn]);
    		}
    	}
    };
    addPrintLink.addEvent(window, 'load', function(){addPrintLink.init('articolo','[ Stampa questa pagina ]');});
    grazie ancora

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.