943,169 Members | Top Members by Rank

Ad:
Sep 1st, 2010
0

div overflow:auto not working in div innerhtml

Expand Post »
good day! when i click a button, this codes will be executed (tested, its working)

var cart=document.getElementById('cart');
cart.innerHTML=cart.innerHTML + document.getElementById('name'+cartNum).innerHTML + "(" + qty + ")" + "<br>";

this is the style of my cart

}
#cart {
overflow:auto;
border:solid;
height:500;
margin-left:10px;
margin-right:10px;
margin-top:20px;
margin-bottom:0;
font-size: 12px;
text-align: left;
font-family: Verdana, Geneva, sans-serif;
background-image:url(images/side.gif);
background-repeat:no-repeat;
}


my problem is, the overflow which i set to auto is not working. the div keeps on enlarging its height everytime i click the button. seems like it has a conflict with innerhtml? please help me. replies are REALLY appreciated.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
jjemphoung is offline Offline
33 posts
since Aug 2008
Sep 1st, 2010
0
Re: div overflow:auto not working in div innerhtml
You forgot to add the unit to the value and your CSS is not entirely correct, use the following:

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. #cart {
  2. overflow:auto;
  3. border:1px solid red;
  4. height:500px;
  5. margin-left:10px;
  6. margin-right:10px;
  7. margin-top:20px;
  8. margin-bottom:0px;
  9. font-size: 12px;
  10. text-align: left;
  11. font-family: Verdana, Geneva, sans-serif;
  12. background-image:url('images/side.gif');
  13. background-repeat:no-repeat;
  14. }

~G
Reputation Points: 82
Solved Threads: 74
Posting Pro in Training
Graphix is offline Offline
400 posts
since Aug 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: Javascript unable to create href in div and unable to apply second mouseover function
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: Unable to open link in parent with slideIt() script





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC