473,386 Members | 1,694 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,386 software developers and data experts.

hideDiv, ShowDiv - Javescript ie issue

techtherapy
Hello all,

This ones a little different as I'm using some flash actionscript to control the swaping.

The following page uses a hideDiv, ShowDiv Javascript that is working flawlessly in Firefox/PC, Firefox/Mac, Safari/PC, and Safari/Mac but not ie6 or 7. They both have the same issue. They will swap divs once but afterwards all divs are set to hide. Please view the page below and hopefully it will clarify what I mean:

http://nailinc.com/New/web/flash.html

Heres the embeded js:

Expand|Select|Wrap|Line Numbers
  1. <script language=javascript type='text/javascript'> 
  2. function hideDiv(pass) { 
  3. var divs = document.getElementsByTagName('div'); 
  4. for(i=0;i<divs.length;i++){ 
  5. if(divs[i].id.match(pass)){//if they are 'see' divs 
  6. if (document.getElementById) // DOM3 = IE5, NS6 
  7. divs[i].style.visibility="hidden";// show/hide 
  8. else 
  9. if (document.layers) // Netscape 4 
  10. document.layers[divs[i]].display = 'hidden'; 
  11. else // IE 4 
  12. document.all.hideShow.divs[i].visibility = 'hidden'; 
  13. }
  14.  
  15. function showdiv(pass) { 
  16. var divs = document.getElementsByTagName('div'); 
  17. for(i=0;i<divs.length;i++){ 
  18. if(divs[i].id.match(pass)){ 
  19. if (document.getElementById) 
  20. divs[i].style.visibility="visible"; 
  21. else 
  22. if (document.layers) // Netscape 4 
  23. document.layers[divs[i]].display = 'visible'; 
  24. else // IE 4 
  25. document.all.hideShow.divs[i].visibility = 'visible'; 
  26. </script>
  27.  

Now the related actionscript, for those who care, looks like this:

Expand|Select|Wrap|Line Numbers
  1. onClipEvent (load) {
  2.     this.onRelease = function() {
  3. getURL("javascript:showdiv('bob')");
  4. getURL("javascript:hideDiv('swap');hideDiv('steve');hideDiv('john');hideDiv('tim')");
  5. };
  6. }
(obviously this is just an example of one instance of the function)

Although I think the issue lies with the JS, as it is the thing I am the least familiar with.

Any thoughts would be excellent and much appreciated!

Thanks!
Jul 29 '08 #1
5 3645
Sorry neglected two things-

one- I apologize for not wrapping the code in [code] tags. obviously I realized my folly as soon as I hit submit!

two- I did read this related post:
http://bytes.com/forum/thread707179.html

But unsure of where/if I should be changing onclick to onchange

thanks!!
Jul 29 '08 #2
RamananKalirajan
608 512MB
Hello Dude, the basic idea behind hiding and showing a component in Javascript is with the use of following two codes.

[HTML] document.getElementById('myTable').style.display = 'none'[/HTML] ---> This code to hide a table with id 'myTable';

[HTML] document.getElementById('myTable').style.display = 'block'[/HTML] ---> This code to show a hidden table with id 'myTable';

Make use of it. If you have any doubts post back it.

Regards
Ramanan Kalirajan
Jul 30 '08 #3
Hi Ramanan,

Thanks for looking at the code.

So my new javascript code at the top of the doc looks like this:

Expand|Select|Wrap|Line Numbers
  1. <script language=javascript type='text/javascript'> 
  2. function hideDiv(id)
  3. {
  4.    document.getElementById(id).style.display = 'none';
  5. }
  6. function showdiv(id)
  7. {
  8.    document.getElementById(id).style.display = 'block';
  9. }
  10. </script>
  11.  
So it still works fine in the browers I was checking in except ie6 and ie7. I still get one show/hide, but after the initial show/hide none will work. Heres a link to the updated page:

http://nailinc.com/New/web/flash2.html

Do we think it code be the actionscripting I'm using in flash?

example:
Expand|Select|Wrap|Line Numbers
  1. onClipEvent (load) {
  2.     this.onRollOver = function() {
  3.         this.gotoAndPlay("over");
  4.     };
  5.     this.onRollOut = function() {
  6.         this.gotoAndPlay("out");
  7.     };
  8.     this.onRelease = function() {
  9. getURL("javascript:showdiv('swap')");
  10. getURL("javascript:hideDiv('bob');hideDiv('steve');hideDiv('john');hideDiv('tim')");
  11. };
  12. }
  13.  
I thought it was the JS, but it might be a flash issue, if so I should post this in that forum.

Thanks for any thoughts/help!

-T
Jul 30 '08 #4
RamananKalirajan
608 512MB
OK. No Probs. All the best to finish up your work. Any Probs post it in the forum.

Regards
Ramanan Kalirajan
Jul 31 '08 #5
acoder
16,027 Expert Mod 8TB
One thing you could try is have the divs set to display:none initially in the CSS.

Another thing to try is to make JavaScript calls only without any Flash. That should probably work without problems thus confirming that it is indeed the Actionscript which is causing the problem.
Jul 31 '08 #6

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

Similar topics

3
by: Paul Mateer | last post by:
Hi, I have been running some queries against a table in a my database and have noted an odd (at least it seems odd to me) performance issue. The table has approximately 5 million rows and...
7
by: George Hester | last post by:
Please take a look at this google artcle: http://groups.google.com/groups?hl=en&lr=&frame=right&th=55d6f4b50f5f9382&seekm=411f370d%241%40olaf.komtel.net#link9 The op was having trouble with...
2
by: Anthony Cuttitta Jr. | last post by:
We have an application that outputs several different graphs from data downloaded from our AS400. The application has worked without (this) issue for several months now, but just recently, the...
0
by: Kevin Spencer | last post by:
Hi all, I am working on a service that uploads METAR weather information to the National Weather Service FTP site. The service I'm authoring is hosted on a Windows 200 server, and the NWS FTP...
2
by: Ben Rush | last post by:
Hello World, Okay, I have spent the day browsing the newsgroups and reading up on article after article concerning ViewState corruption and so forth, and I have a couple questions. We...
5
by: Robert | last post by:
I have a series of web applications (configured as separate applications) on a server. There is a main application at the root and then several virtual directories that are independant...
0
by: Charles Leonard | last post by:
I am having yet another issue with Windows Server 2003. This time, the web service (a file import web service) appears to run except for one odd message: "ActiveX component can't create object". ...
4
by: Paul | last post by:
Hi, I've been struggling with this today, I'm developing a DotNet2.0 website in C# that needs to call a long running data query. Obviously this is a good candidate for an Asynchronous call, so...
13
by: SAL | last post by:
Hello, I'm trying to include a popup in the ItemTemplate of a gridview row. The ItemTemplate for the field contains a textbox and when the user clicks in the textbox I want a popup panel to show...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.