Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Client Side Scripting
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 08-21-2007, 08:41 PM
  #1
tbonem91
Hero (Level 10)
 
Join Date: Jun 2002
Posts: 100
iTrader: (0)
tbonem91 is on a distinguished road
expanding div inside scrolling div problem

I'm having a bit of a problem with an expanding div inside of another that is set to scroll. This is only tested in IE7 because it will only ever be used with IE7 (Air Force) and I need to find a solution asap.

The behavior is unusual so the easiest way to see it is to copy the code locally and click on the "read more" links - watch the space around the scrolling div expand in addition to the content inside of it... I've tried so many different things and I can't get it to stop happening.

Below is a very stripped down version of the page with enough in it to show the problem.

Help?

HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title></title>
    <style type="text/css">
    td { 
        font-family: Tahoma;
        font-size: 8pt;
        border: 1px solid blue; 
    }
    </style>
    <script type="text/javascript">
    function toggle(sender, item)
    {
      if (item.style.display == "none")
      {
          item.style.display = "";
          sender.innerHTML = "[Read Less]";
      }
      else
      {
          item.style.display = "none";
          sender.innerHTML = "[Read More]";
      }
    } 
    </script>
</head>
<body>

<table>
    <tr>
        <td style="width:100px; height:100px"> &nbsp; </td>
        <td style="width:300px;"> &nbsp; </td>
        <td style="width:100px;"> &nbsp; </td>
    </tr>
    <tr>
        <td style="height:160px"> &nbsp; </td>
        <td>
            <div style="width:386px; height:150px; overflow:scroll; border:1px solid red;"> 
                <table cellspacing="2" cellpadding="3" align="center" border="0">
                    <tr align="center">
                        <td align="center" valign="top" style="width:70px;">
                            <span>21 Aug 2007</span> 
                        </td>
                        <td align="left" style="width:295px;">
                            <div style="padding-bottom:5px;">
                                <span>This is a test! Yay!</span>
                            </div>
                            <div style="float:left;">
                                <a onclick="toggle(this, more_1);" style="color: #4c5a7f;" href="#">[Read More]</a>
                            </div>
                            <div style="float:right"> 
                                -<span>Last, First</span>
                            </div>
                            <div id="more_1" style="display:none; clear:both; padding: 5px">
                                <span>
                                    Developers… <br />
                                    Please Help <br />
                                    me figure out <br />
                                    my crazy expanding <br />
                                    Ghost Problem<br />
                                    <br />
                                    <br />
                                    Please!<br />
                                    
                                    Developers… <br />
                                    Please Help <br />
                                    me figure out <br />
                                    my crazy expanding <br />
                                    Ghost Problem<br />
                                    <br />
                                    <br />
                                    Please!<br />
                                    
                                    Developers… <br />
                                    Please Help <br />
                                    me figure out <br />
                                    my crazy expanding <br />
                                    Ghost Problem<br />
                                    <br />
                                    <br />
                                    Please!<br />
                                </span> 
                            </div>
                        </td>
                    </tr>
                    
                    
                    
                    <tr align="center">
                        <td align="center" valign="top" style="width:70px;">
                            <span>21 Aug 2007</span> 
                        </td>
                        <td align="left" style="width:295px;">
                            <div style="padding-bottom:5px;">
                                <span>This is a test! Yay!</span>
                            </div>
                            <div style="float:left;">
                                <a onclick="toggle(this, more_2);" style="color: #4c5a7f;" href="#">[Read More]</a>
                            </div>
                            <div style="float:right"> 
                                -<span>Last, First</span>
                            </div>
                            <div id="more_2" style="display:none; clear:both; padding: 5px">
                                <span>
                                    Developers… <br />
                                    Please Help <br />
                                    me figure out <br />
                                    my crazy expanding <br />
                                    Ghost Problem<br />
                                    <br />
                                    <br />
                                    Please!<br />
                                    
                                    Developers… <br />
                                    Please Help <br />
                                    me figure out <br />
                                    my crazy expanding <br />
                                    Ghost Problem<br />
                                    <br />
                                    <br />
                                    Please!<br />
                                    
                                    Developers… <br />
                                    Please Help <br />
                                    me figure out <br />
                                    my crazy expanding <br />
                                    Ghost Problem<br />
                                    <br />
                                    <br />
                                    Please!<br />
                                </span> 
                            </div>
                        </td>
                    </tr>
                    
                    
                </table>
            </div>
        </td>
        <td> &nbsp; </td>
    </tr>


    <tr>
        <td style="height:100px"> &nbsp; </td>
        <td> &nbsp; </td>
        <td> &nbsp; </td>
    </tr>

</table>
</body>
</html>
tbonem91 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-21-2007, 09:04 PM
  #2
BillyGalbreath
Lord (Level 16)
 
BillyGalbreath's Avatar
 
Join Date: Feb 2006
Location: Houston, Texas
Posts: 719
iTrader: (0)
BillyGalbreath is on a distinguished road
You need to set a height to your scrollable div - if there is no defined height, it will grow to fit the contents.
__________________
-Billy
"Traditional software is like witchcraft. In history, witchcraft just died out. The same will happen in software. When problems get serious enough, you can't have one person or one company guarding their secrets. You have to have everybody share in knowledge." --- Linus Torvalds
I am using Linux every day to up my productivity - so up yours!
BillyGalbreath is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-21-2007, 09:07 PM
  #3
tbonem91
Hero (Level 10)
 
Join Date: Jun 2002
Posts: 100
iTrader: (0)
tbonem91 is on a distinguished road
Quote:
Originally Posted by BillyGalbreath View Post
You need to set a height to your scrollable div - if there is no defined height, it will grow to fit the contents.
there is: 150px

the scrolling div isn't growing. Somehow the contents inside of it that are expanding are affecting the area outside of the scrolling div.
tbonem91 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-21-2007, 09:11 PM
  #4
BillyGalbreath
Lord (Level 16)
 
BillyGalbreath's Avatar
 
Join Date: Feb 2006
Location: Houston, Texas
Posts: 719
iTrader: (0)
BillyGalbreath is on a distinguished road
http://billy.pl3x.net/tests/tbonem91.html <- give that a test for me (i don't have IE7 readily avail to test in, but this works in Firefox).

Comments on this post
tbonem91 agrees: fixed my issue and super fast too!
__________________
-Billy
"Traditional software is like witchcraft. In history, witchcraft just died out. The same will happen in software. When problems get serious enough, you can't have one person or one company guarding their secrets. You have to have everybody share in knowledge." --- Linus Torvalds
I am using Linux every day to up my productivity - so up yours!
BillyGalbreath is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-21-2007, 09:15 PM
  #5
tbonem91
Hero (Level 10)
 
Join Date: Jun 2002
Posts: 100
iTrader: (0)
tbonem91 is on a distinguished road
Quote:
Originally Posted by BillyGalbreath View Post
http://billy.pl3x.net/tests/tbonem91.html <- give that a test for me (i don't have IE7 readily avail to test in, but this works in Firefox).
that works! Thanks Billy! I see what you changed... but don't really understand why that would fix things.... IE never ceases to amaze me.
tbonem91 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-21-2007, 09:16 PM
  #6
BillyGalbreath
Lord (Level 16)
 
BillyGalbreath's Avatar
 
Join Date: Feb 2006
Location: Houston, Texas
Posts: 719
iTrader: (0)
BillyGalbreath is on a distinguished road
glad I could help!
__________________
-Billy
"Traditional software is like witchcraft. In history, witchcraft just died out. The same will happen in software. When problems get serious enough, you can't have one person or one company guarding their secrets. You have to have everybody share in knowledge." --- Linus Torvalds
I am using Linux every day to up my productivity - so up yours!
BillyGalbreath is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-22-2007, 11:17 AM
  #7
tbonem91
Hero (Level 10)
 
Join Date: Jun 2002
Posts: 100
iTrader: (0)
tbonem91 is on a distinguished road
an update of sorts... at home on IE7 that fixed the issue. At work, on presumably a different version of IE7, it persists

not sure what version I have at home (will check tonight) but at work we have 7.0.5730.11 -- I'm wondering if theres a patch we havent recieved yet or something...?
tbonem91 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart



 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 01:49 AM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.