views:

442

answers:

2

How can I hide an element in html on Pocket Internet Explorer running on a Windows Mobile 6 device. The following code does not work even though it apears to be setting the values correctly.

function ShowCollapseElement(sLinkId, sContentId)
 {
 var oLinkElement;
 var oContentElement;

 //Get the elements
 oLinkElement = document.getElementById(sLinkId);
 oContentElement = document.getElementById(sContentId);

 //Toggle the visibility of the content
 oContentElement.style.display = (oContentElement.style.display != 'none' ? 'none' : 'inline');

 //Set the link text
 oLinkElement.innerText = (oContentElement.style.display != 'none' ? '-' : '+');
 }
+1  A: 

I've just discovered that the code works when the element is a div, but not with a table row. I will have to settle for using a div.

A: 

Indeed, you cannot show/hide TR's and TGROUP's in Pocket Internet Explorer. I ran into the same problem (and more) when I created a Company phonelist XML/XSLT example from which I wanted users to be able to click on a name which would show the detailed information about a person.

I created this page to demonstrate how you can dial from a webpage (at the moment Dutch only but a documented .zip can be downloaded and has English comments).

This example takes an XML file as input and then creates a phonelist via XSLT. I tested the page in IE7, FF2 and Pocket IE for Windows Mobile 6 as described). Since there were more issues in different browsers and Pocket IE I thought I'd refer to it from here.

Mackaaij