|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
javascript show and hide does not work with mozilla
Hi,
I have a code that works with IE but not with Mozilla. Div tags cannot be shown and hidden. Here are the most important parts: ... function MM_showHideLayers() { if(tp > 0 || bp > 0 || up > 0) return; var i,p,v,obj,args=MM_showHideLayers.arguments; for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2]; if (obj.style) { obj=obj.style; v=(v=='show')?'visible' v=='hide')?'hidden':v; }obj.visibility=v; obj.display=((v=='visible')?'' (v=='hidden')?'non e':v)); }} var tp=0, bp=0, up=0; function MM_stayShownLayer(imgName) { //v6.0 ClearSelection(); MM_showHideLayers(imgName,'','show'); if(imgName == 'i001'){ tp = 1; document.getElementById('frmSelection').txtSelecti on.value = "Tri-Point Series"; }else if(imgName == 'i002'){ bp = 1; document.getElementById('frmSelection').txtSelecti on.value = "Bi-Point Series"; }else if(imgName == 'i003'){ up = 1; document.getElementById('frmSelection').txtSelecti on.value = "Uni-Point Series"; } document.getElementById('frmSelection').txtImage.v alue = imgName; } ... <div id="i001" style="position:relative; width:200px; height:115px; z-index:1; left: 0; top: 0; visibility: hidden; display:none;"><img src="images/i001.jpg" width="487" height="287" border="0" usemap="#Map5"></div> <div id="i002" style="position:relative; width:200px; height:115px; z-index:2; left: 0; top: 0; visibility: hidden; display:none;"><img src="images/i002.jpg" width="487" height="287" border="0" usemap="#Map6"></div> <div id="i003" style="position:relative; width:200px; height:115px; z-index:3; left: 0; top: 0; visibility: hidden; display:none;"><img src="images/i003.jpg" width="487" height="287" border="0" usemap="#Map7"></div> ... <form id="frmSelection" action="step2.php" method="post"> <font face="Arial, Helvetica, sans-serif" size="2">Cabinet Style Selected</font> <input type="text" name="txtSelection" value="<?php echo ((isset($_SESSION['step1SelText'][$cabindex])) ? $_SESSION['step1SelText'][$cabindex] : 'not yet selected') ?>" readonly> <input type="hidden" name="txtImage" value="<?php echo ((isset($_SESSION['step1SelImg'][$cabindex])) ? $_SESSION['step1SelImg'][$cabindex] : '') ?>" readonly> <font face="Arial, Helvetica, sans-serif" size="2" color="#999999">(Click on icon to select)</font> </form> ... Thanks in advance! Nima |
|
#2
|
|||
|
|||
|
Maybe I should have clarified the issue more: On mouse over showing , and hiding on mouseout works, just that the form selection and the image stays on click doesn't work with mozilla.
|
|
#3
|
|||
|
|||
|
Try try using the "display" property rather than "visibility". Not sure if this will work, but worth a try.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > javascript show and hide does not work with mozilla |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|