473,397 Members | 2,084 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,397 software developers and data experts.

I want to hide DIV place holder

This works fine in netscape but IE won't do it. I have a div which contains
some links and a thumbnail. What's supposed to happen is when you click the
thumbnail the links disapear and the now invisible div is resized moving
everything below it. In IE it only resizes as small as the size of the dive
plus the size of the links.

heres an example

<div class="relatedLinks" id="posix">
<h3>Posix (Linux,UNIX,BSD)</h3>
<img id ="posixDropdownButton" src="downarrow.gif" width="8" height="8"
onClick="showHideDropDown('posixSection','posixDro pdownButton','posixSection
','8px','112px')">
<div id="posixSection">
<a href="http://www.freshmeat.net" target="_top">Freshmeat</a>
<a href="http://www.redhat.com/" target="_top">RedHat Linux</a>
<a href="http://www.debian.org/" target="_top">Debian Linux</a>
<a href="http://www.novell.com/linux/suse/" target="_top">Suse
Linux</a>
<a href="http://www.slackware.com/" target="_top">Slackware
Linux</a>
<a href="http://www.freebsd.org/" target="_top">FreeBSD</a>
<a href="http://www.openbsd.org/" target="_top">OpenBSD</a>
</div>
</div>

the function for doiong the magic is

function showHideDropDown(tItem,tIcon,tParent,tMin,tMax)
{
var lItem=document.getElementById(tItem);
var lIcon=document.getElementById(tIcon);
var parentSection=document.getElementById(tParent);
if (lIcon.src.search("uparrow.gif")!=-1)
{
lIcon.src="downarrow.gif";
lItem.style.visibility="hidden";
parentSection.style.height=tMin;

}
else
{
lIcon.src="uparrow.gif";
lItem.style.visibility="visible";
parentSection.style.height=tMax;
}

}

It works terrific in netscape but it looks tacky in IE. Any ideas how to
make it work properly?

Thanks

Aug 15 '05 #1
2 1785
Hi Darren,
function showHideDropDown(tItem,tIcon,tParent,tMin,tMax)
{
var lItem=document.getElementById(tItem);
var lIcon=document.getElementById(tIcon);
var parentSection=document.getElementById(tParent);
if (lIcon.src.search("uparrow.gif")!=-1)
{
lIcon.src="downarrow.gif";
lItem.style.visibility="hidden";
parentSection.style.height=tMin;

}
else
{
lIcon.src="uparrow.gif";
lItem.style.visibility="visible";
parentSection.style.height=tMax;
}

}

It works terrific in netscape but it looks tacky in IE. Any ideas how to
make it work properly?


Instead of setting CSS-Visibilty to visible/hidden set Display to block/none:

if (lIcon.src.search("uparrow.gif")!=-1)
{
lIcon.src="downarrow.gif";
lItem.style.display="none";
parentSection.style.height=tMin;

}
else
{
lIcon.src="uparrow.gif";
lItem.style.display="block";
parentSection.style.height=tMax;
}

Greetings,

Martin
Aug 15 '05 #2

"Martin Kurz" <in**@martinkurz.in-berlin.de> wrote in message
news:11***************@elch.in-berlin.de...
Hi Darren,


Spot on Marten. That did the trick. Thanks so much.
Aug 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: David | last post by:
I attempted the following <div id="div" runat="server"> <tr><td></td></tr> <tr><td></td></tr> </div> This is to hide a group of rows depending on some business rules in my code behind.
5
by: andchoi | last post by:
I must be the dumbest ASP.NET 2.0 developer, because despite many different attempts, I am unable to resize a content place holder in the master page... Can anyone clue me in? It seems that the...
2
by: J-T | last post by:
I am constructing an HTML text which I need to render in my ASP.NET page. string rssOutput = Posts.listPosts(Constants.WeblogSectionID); rssOutput contains html code and text.Then I create a...
2
by: Brian | last post by:
Hello... I've created a master page in Visual Web Developer and it creates a content place holder. That's fine and all but I can't seem to resize it. Any suggestions? Thanks, Brian
0
by: MasterChief | last post by:
I have a content place holder that is showing the summary of a sale. Is there a way to create a button in the content place holder that the person can click on to print just what is in the content...
1
by: lamuerte451 | last post by:
Hi: I am a newbie to asp.net 2.0 and am building an app with VS 2005 that will allow users to update records via the web. I have created a master page and then have placed Gridview and details...
3
by: BB | last post by:
Hi, I am using repeater control.in my aspx page. one of the column of control displays images. Filenames of images are stored in table. Now when I run it and if display Image is blank. I see place...
0
by: arunpillai | last post by:
hi guys, My problem is i need to display different html page in content place holder just like how we will be doing in the frames. I have a menu control when ever the menu is clicked the particular...
3
chandru8
by: chandru8 | last post by:
Hi to all, i had a problem to place more than 60 text boxes in a form for that queen send me a code. but my boss insist me to put picture box as a place holder by using this we can...
2
by: greenMark | last post by:
Hi All, I'm relatively new to ASP.NET and Visual Web Developer 2008. I'm using a Master page with one content place holder. There is a Cascading Style Sheet file which is being refered by the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.