»
AnglaisFran�aisVietnamien

Imprimer - Basic Afficher/Masquer Demo - JavaScriptBank.com

Version compl�te: jsB@nk » Form » Table » Basic Afficher/Masquer Demo
URL: https://www.javascriptbank.com/crossbrowser-basic-show-hide-demo.html

Basic Afficher/Masquer Demo © JavaScriptBank.comCette petite démo rapide illustre cacher/montrer des panneaux "lorsque certains élément déclencheur est moused plus. Tous les éléments peuvent être utilisés comme des «déclencheurs». La démo de déclenchement sont des éléments dans la colonne de droite de cette page. Les panneaux sont affichés dans le centre de la page.

Version compl�te: jsB@nk » Form » Table » Basic Afficher/Masquer Demo
URL: https://www.javascriptbank.com/crossbrowser-basic-show-hide-demo.html



CSS
<style type="text/css">.trigger {  width:60px;  height:30px;  color:#000;  background:#963;  text-align:center;  margin:8px 0;  padding:2px;}.panel {  position:absolute;  overflow:hidden;  visibility:hidden;  width:300px;  height:200px;  margin:0;  padding:20px;  color:#000;  background:#963;  border:1px solid #000;}</style><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


JavaScript
<script type="text/javascript">window.onload = function(){    if (window.winOnLoad) window.winOnLoad();}</script><script type="text/javascript">function winOnLoad(){  setup();}function setup(){  var ele, i = 1;  do {    ele = xGetElementById('trigger' + i);    if (ele) {      ele.panelId = 'panel' + i++;      ele.onmouseover = tOnMouseover;      ele.onmouseout = tOnMouseout;    }  } while(ele);}function tOnMouseover(){  var panel = xGetElementById(this.panelId);  if (panel) {    var x = xScrollLeft() + (xClientWidth() - xWidth(panel)) / 2;    var y = xScrollTop() + (xClientHeight() - xHeight(panel)) / 2;    xMoveTo(panel, x, y);    xShow(panel);  }}function tOnMouseout(){  xHide(this.panelId);}</script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<div class="collapsible"><p>Mouse over the following elements:</p><div id="trigger1" class="trigger">Panel 1</div><div id="trigger2" class="trigger">Panel 2</div><div id="trigger3" class="trigger">Panel 3</div></div><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


Files
http://javascriptbank.com/javascript/form/crossbrowser/x_core.js