Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-10-2011, 05:07 PM   PM User | #1
Dooh
New to the CF scene

 
Join Date: Jun 2011
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Dooh is an unknown quantity at this point
Exclamation PIE.htc hidden DIV IE background issues

I am using a HideContent, ShowContent JS to reveal a div tag (with rounded corners). Shows up and works great in all browsers but IE. Content does show - but the background and the borders do not. If I remove the PIE.htc file, background and borders do show up, but not styled correctly.

Please help - I just need the div to show correctly and I can move on with my sad little life.

CSS:
.rounded_modemdetails{
z-index: 999;
background-color: #fafafa;
background: #fafafa;
position: absolute;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
-khtml-border-radius: 10px;
border-radius: 10px;
behavior: url(PIE.htc);
background: #fafafa;
border: 1px solid #f0f0f0;
padding: 10px;
width: 315px;

JS:
<script type="text/javascript" language="JavaScript"><!--
function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "block";
}
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
if(document.getElementById(d).style.display == "none")
{ document.getElementById(d).style.display = "block"; }
else { document.getElementById(d).style.display = "none"; }
}
//--></script>

Html:
<div class="rounded_modemdetails" id="modemdetails" style="height:345px; display:none; clear:both;">
<p class="prod_subhead_features">Modem Details: <a href="javascript:HideContent('modemdetails')">Close</a></p>
<table width="100%" border="0" cellspacing="0" cellpadding="10" style="margin-top:-15px">
<p class="prod_body_features" >Content Here</p>
</div>
Dooh is offline   Reply With Quote
Old 06-10-2011, 05:30 PM   PM User | #2
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,697
Thanks: 5
Thanked 875 Times in 850 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
This is because IE generates a new, separate “element” (made of proprietary and deprecated VML) and places it behind the content to make it look like a styled box. Modifying the actual content element with JS doesn’t modify the additional VML. I’m not sure if it’s possible to modify the VML element with JS, too, but after all, it’s easier to not change elements that have the HTC behavior but rather a wrapper without such.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Users who have thanked VIPStephan for this post:
Dooh (06-10-2011)
Old 06-10-2011, 05:47 PM   PM User | #3
Dooh
New to the CF scene

 
Join Date: Jun 2011
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Dooh is an unknown quantity at this point
You are a hero!

I took your advice and put the content in a DIV and and left the background as is. Adjusted the JS to hide/show content. Worked like a charm.

The only negative side is that I wasted a day trying to figure it out myself.

Now go put your cape on and fly around making whooshing noises!
Dooh is offline   Reply With Quote
Old 06-10-2011, 06:00 PM   PM User | #4
teedoff
Senior Coder

 
Join Date: Aug 2010
Location: High Point, NC
Posts: 3,325
Thanks: 5
Thanked 363 Times in 360 Posts
teedoff is on a distinguished road
Quote:
Originally Posted by Dooh View Post
I took your advice and put the content in a DIV and and left the background as is. Adjusted the JS to hide/show content. Worked like a charm.

The only negative side is that I wasted a day trying to figure it out myself.

Now go put your cape on and fly around making whooshing noises!
Well a negative can be a positive if you learn something from it...
__________________
Teed
teedoff is offline   Reply With Quote
Reply

Bookmarks

Tags
background, div, explorer, hidden, pie.htc

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:33 AM.


Advertisement
Log in to turn off these ads.