473,326 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

MM_swapImgRestore() not working on Mozilla

I am using using MM_swapImgRestore() fiunction for highlighting the selected tab.
but this is working fine on IE and not working on mozilla .

Onmouseout oif tabs im calling this function.

Expand|Select|Wrap|Line Numbers
  1. function MM_swapImgRestore()
  2. {   //v3.0 
  3.  
  4.    var i,x,a=document.MM_sr;
  5.      for(i=0; a&&i<a.length&&(x=a[i])&&x.oSrc;i++) 
  6.    { 
  7.         switch(document.topPanelForm.tabval.value)
  8.        {
  9.             case 1:
  10.                 document.topPanelForm.tabval.value="";
  11.                 x.src=x.src;
  12.                  break;
  13.             case 2:
  14.                 document.topPanelForm.tabval.value="";
  15.                 x.src=x.src;
  16.                  break;
  17.             case 3:
  18.                 document.topPanelForm.tabval.value="";
  19.                 x.src=x.src;
  20.                 break;
  21.             case 4:
  22.                 document.topPanelForm.tabval.value="";
  23.                 x.src=x.src;
  24.                  break;
  25.             case 5:
  26.                 document.topPanelForm.tabval.value="";
  27.                 x.src=x.src;
  28.                 break;
  29.             default:x.src=x.oSrc;
  30.                  break;
  31.  
  32.        }
  33.  
  34.    }
  35. }
  36.  
Please help me out
Nov 12 '08 #1
4 3609
gits
5,390 Expert Mod 4TB
you are lucky that it is not working in mozilla ;) ... download the firebug extension or have a look at the JavaScript-error-console of MOZ/FF and tell us what error occurs ... may be you see for yourself what to do when you see the error-message

kind regards
Nov 12 '08 #2
you are lucky that it is not working in mozilla ;) ... download the firebug extension or have a look at the JavaScript-error-console of MOZ/FF and tell us what error occurs ... may be you see for yourself what to do when you see the error-message

kind regards
I have checked for errors in "mozilla" with fiebug.Its not giving any errors.I have given alerts in the to trace the execution of fun.but it simply not not entering in the for loop.Dont know why?
Nov 12 '08 #3
gits
5,390 Expert Mod 4TB
then check where document.MM_sr is set ... may be that fails for FF? you may alert it in the posted script and it could be that document.MM_sr.length is 0?

kind regards
Nov 12 '08 #4
gits
5,390 Expert Mod 4TB
btw. by looking at your code it seems that this switch could be shortened to:

Expand|Select|Wrap|Line Numbers
  1. var value = document.topPanelForm.tabval.value;
  2. switch(value) {
  3.     case 1:
  4.     case 2:
  5.     case 3:
  6.     case 4:
  7.     case 5:
  8.         value = '';
  9.         x.src = x.src;
  10.         break;
  11.     default:
  12.         x.src = x.oSrc;
  13.         break;
  14. }
  15.  
or even better with an if as there are just 2 cases:

Expand|Select|Wrap|Line Numbers
  1. var value = document.topPanelForm.tabval.value;
  2. if (value in { 1:1, 2:1, 3:1, 4:1, 5:1 }) {
  3.     value = '';
  4.     x.src = x.src;
  5. } else {
  6.     x.src = x.oSrc;
  7. }
  8.  
kind regards
Nov 12 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: wylbur37 | last post by:
I normally use Mozilla 1.4 on Windows XP Pro. As I was developing some test webpages, I discovered that the SRC parameter doesn't seem to work when a path is used with the filename. In one...
2
by: David | last post by:
After getting some help working through my bugs, I have what seems to be a robust, working word counter script. I post it here to benefit others that might want this in the future and so that if I...
10
by: Markus Ernst | last post by:
Hi I have a strange problem with vertical-align. The case can be viewed at http://www.brainput.info/geschichte.html. HTML code: <div id="bild"><img src="geschichte.gif" width="274"...
2
by: schieco | last post by:
The following code always prints the debug lines inside the conditional if statement before and after the alert statement when the session has timed out, but the alert and redirect only appear/work...
8
by: lawrence | last post by:
I'm a beginner with Javascript and especially cross-browser Javascript. I got this working in IE, but not in Netscape 7. It seems like, in Netscape, every time I click on a button, the focus shifts...
3
by: Eli | last post by:
Hello all, I have just added a small piece of JavaScript code to a basic HTML page of mine. At the end of the page (after the closing </HTML>) I added: <SCRIPT LANGUAGE="JavaScript">...
49
by: Atul Chaturvedi | last post by:
If we use ASP.NET 2.0 Login Control, we are unable to click on Login and Reset Buttons on Safari running on Apple Mac OS X Version 10.3.2 . How can i resolve the problem.
1
by: ajaysoniji | last post by:
Hi, I am using this code to read the option values from a select option. I am getting the reference of that select option in arg1. Its working fine with mozilla firefox but not with Internet...
6
pravinda
by: pravinda | last post by:
Hi, I got a problem please check http://www.technocreative.com/ both in the iexplore and mozilla(firefox). it is working well in explore but problem in mozilla i am get big problem so please do...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.