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

    abilitare scrolling via javascript

    Ciao

    sapete come si può abilitare lo scrolling in una pagina utilizzando javascript?
    "durante i primi 5 miuti di pioggia nel bosco c'è ancora asciutto, poi quando smetterà di piovere nel bosco cadranno gocce per 5 minuti.....la natura ha un'ottima memoria..."

    http://www.kumbe.it

  2. #2
    Moderatore di JavaScript L'avatar di br1
    Registrato dal
    Jul 1999
    Messaggi
    19,998
    Chiarisci il concetto "abilitare lo scrolling"

    ciao
    Il guaio per i poveri computers e' che sono gli uomini a comandarli.

    Attenzione ai titoli delle discussioni: (ri)leggete il regolamento
    Consultate la discussione in rilievo: script / discussioni utili
    Usate la funzione di Ricerca del Forum

  3. #3
    ho un popup aperto con certe impostazioni, tra cui lo scrolling ad off (no barre di scorrimento vert e orizz)

    in base ad un determinato evento (ad esempio un click) vorrei invece abilitare lo scrolling (si barre di scorrimento vert e orizz).

    è possibile?
    "durante i primi 5 miuti di pioggia nel bosco c'è ancora asciutto, poi quando smetterà di piovere nel bosco cadranno gocce per 5 minuti.....la natura ha un'ottima memoria..."

    http://www.kumbe.it

  4. #4
    Utente di HTML.it L'avatar di Xinod
    Registrato dal
    Sep 2000
    Messaggi
    13,649
    no, a meno di chiudere e riaprire la popup con impostazioni diverse

    l' alternativa, se secondo te ne vale la pena, e' nascondere lo scrollbars via css nei singoli documenti aperti in popup, in quel caso puoi riabilitare l' overflow via javascript

    ciao

  5. #5
    Utente di HTML.it L'avatar di badaze
    Registrato dal
    Jun 2002
    residenza
    Lyon
    Messaggi
    5,372
    Codice che ho postato qui un paio di anni fa

    codice:
    <HTML>
    <HEAD>
    	<TITLE>Selezione da una lista digitando i caratteri in un TextBox</TITLE>
    <HEAD>
    <style type="text/css">
    <!--
    .inverted {color:white;background-color:navy} 
    -->
    </style>
    
    <SCRIPT>
    <!--
    var previousRow = null;
    function find() {
     if (previousRow != null) {
      previousRow.className = "";
     } // if (previousRow != null)
     stringToFind = document.getElementById('input1').value;
     stringToFind = stringToFind.toLowerCase();
     rows         = document.getElementById('stati').rows.length;
     for (i=0;i<rows;i++) {
      currentRow = document.getElementById('stati').rows.item(i)
      cells = currentRow.cells.length;
    	//------------ si assume che la colonna da controllare sia la prima ovvero (1 - 1) = 0
    	controlledCell = 0
    	for (j=0;j<cells;j++) {
    	 currentCell     = currentRow.cells.item(controlledCell);
    	 currentCellText = currentCell.innerHTML;
    	 currentCellText = currentCellText.toLowerCase();
    
    	 if (stringToFind <= currentCellText) {
    	  currentRow.className = "inverted";
    		previousRow          = currentRow;
    		document.getElementById('container').scrollTop = currentRow.offsetTop;
    		return;
    	 } // if (stringToFind <= currentCellText) 
    	} // for (j=0;j<cells;j++)
     } //  for (i=0;i<rows;i++
     alert("non trovato");
    } // function find()
    
    function gotoPrevious() {
     changeRow(-1);
    } // function gotoPrevious()
    
    function gotoNext() {
     changeRow(1);
    } // function gotoNext()
    
    function changeRow(vDirection) {
     canChange = false;
     if (vDirection == 1) {
      if (currentRow.rowIndex < document.getElementById('stati').rows.length-1) {
    	 canChange = true;
    	 newRow    = currentRow.rowIndex + 1;
      } // if (currentRow.rowIndex < document.getElementById('stati').rows.length-1)
     } else {
      if (currentRow.rowIndex > 0) {
    	 canChange = true;
    	 newRow    = currentRow.rowIndex - 1;	 
      } // if (currentRow.rowIndex > 0)
     } // if (vDirection == 1) 
     if (canChange) {
      gotoRow(newRow);
    	return;	
     } // if (currentRow.rowIndex > 0) 
    } // function changeRow(vDirection)
    
    function gotoRow(aRowNumber) {
     if (previousRow == null) {
      previousRow = document.getElementById('stati').rows.item(0);
      //currentRow  = document.getElementById('stati').rows.item(0);
     } // if (previousRow == null)
      previousRow.className = "";  
      currentRow           = document.getElementById('stati').rows.item(aRowNumber);
    	currentRow.className = "inverted";
    	previousRow          = currentRow;
      document.getElementById('container').scrollTop = currentRow.offsetTop;
    } // function gotoRow() 
    
    //==============================================================================
    // Scroll
    //==============================================================================
    var stopScrollUp   = true;
    var stopScrollDown = true;
    var scrollStep     = 5;
    
    function pippo() {
     if (! stopScrollUp) {
      scrollUp();
     } // if (! stopScrollUp)
     if (! stopScrollDown) {
      scrollDown();
     } // if (! stopScrollDown)
    } // function pippo()
    
    window.setInterval("pippo()",10);
    
    function scrollUp() {
     if (document.getElementById('container').scrollTop > 0) {
      document.getElementById('container').scrollTop -= scrollStep;
     } else {
      document.getElementById('container').scrollTop = 0;
    	return;
     } // if (document.getElementById('container').scrollTop > 0)
    } // function scrollUp()
    
    
    function scrollDown() {
     if (document.getElementById('container').scrollTop <= document.getElementById('stati').offsetHeight - document.getElementById('container').offsetHeight) {
      document.getElementById('container').scrollTop+= scrollStep;
     } else {
      document.getElementById('container').scrollTop = document.getElementById('stati').height;
    	alert('max');
    	return;
     } // if (document.getElementById('container').scrollTop < document.getElementById('stati').height)
    } // function scrollDown()
    
    function stopScroll() {
     stop = true;
    } // function stopScroll()
    
    //-->
    </SCRIPT>
    
    </HEAD>
    <BODY id="body" BGCOLOR="#ffffff" onmouseover="document.getElementById('status').innerHTML = window.event.srcElement.id;">
    <FORM NAME="modulo">
    <INPUT TYPE="text" NAME="input1" ID="input1" VALUE="Scrivi..." CLASS="" > 
    <INPUT TYPE="button"  VALUE="Cerca" onclick="find()" >
    
    
     <DIV ID="container" 
       STYLE="height:200px; width:150;z-index=100;font-family:verdana;font-size:9pt;overflow: hidden;">
    	<TABLE id="stati" NAME="stati" BORDER="1">
    <TR><TD>Albania</TD></TR>
    <TR><TD>Cayman Islands</TD></TR>
    <TR><TD>Central African Rep.</TD></TR>
    <TR><TD>Chad</TD></TR>
    <TR><TD>Chile</TD></TR>
    <TR><TD>China</TD></TR>
    <TR><TD>Christmas Island</TD></TR>
    <TR><TD>Gambia</TD></TR>
    <TR><TD>Georgia</TD></TR>
    <TR><TD>Germany</TD></TR>
    <TR><TD>Ghana</TD></TR>
    <TR><TD>Gibraltar</TD></TR>
    <TR><TD>Great Britain (UK)</TD></TR>
    <TR><TD>Greece</TD></TR>
    <TR><TD>Greenland</TD></TR>
    <TR><TD>Grenada</TD></TR>
    <TR><TD>Guadeloupe (Fr.)</TD></TR>
    <TR><TD>Guam (US)</TD></TR>
    <TR><TD>Guatemala</TD></TR>
    <TR><TD>Guinea</TD></TR>
    <TR><TD>Guinea Bissau</TD></TR>
    <TR><TD>Guyana</TD></TR>
    <TR><TD>Italy</TD></TR>
    <TR><TD>Ivory Coast</TD></TR>
    </TABLE>
    </div>
    <input type="button" id="up" value="Up" onmouseover="stopScrollUp=false" onmouseout="stopScrollUp=true">
    <input type="button" id="down" value="Down" onmouseover="stopScrollDown=false" onmouseout="stopScrollDown=true">
    <input type="button" id="previous" value="Previous" onclick="gotoPrevious()">
    <input type="button" id="next" value="Next" onclick="gotoNext()">
    
    
    <div id="status"></div>
    </FORM>
    <script language="JavaScript" type="text/javascript">
    <!--
    //---------------- Si posiziona sulla prima riga
    gotoRow(0);
    //-->
    </script>
    
    
    </BODY>
    </HTML>
    Ridatemi i miei 1000 posts persi !!!!
    Non serve a nulla ottimizzare qualcosa che non funziona.
    Cerco il manuale dell'Olivetti LOGOS 80B - www.emmella.fr

  6. #6
    Utente di HTML.it L'avatar di badaze
    Registrato dal
    Jun 2002
    residenza
    Lyon
    Messaggi
    5,372
    Beh ho visto che quello che ho postato non è proprio quello che era richiesto..... comunque puo' sempre essere utile.
    Ridatemi i miei 1000 posts persi !!!!
    Non serve a nulla ottimizzare qualcosa che non funziona.
    Cerco il manuale dell'Olivetti LOGOS 80B - www.emmella.fr

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 © 2025 vBulletin Solutions, Inc. All rights reserved.