469,592 Members | 1,891 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,592 developers. It's quick & easy.

Scrolling DIV's not working in Firefox!!!!

Hi All,

I need a scrolling DIV is a to display my dynamic tree in left frame.
In my jsp , Div overflow is set to "auto"
[HTML]<DIV id=divScroller style="overflow:auto;height:200px">
<!-- stuff goes here -->
</DIV
[/HTML]
I'm using beleow function to set the height ..

Expand|Select|Wrap|Line Numbers
  1. function resizeVerticalDiv(oDiv, oBottomNeighbor) {
  2.       var iMinHeight = 100;    //DIV won't get smaller than this
  3.       var iClientHeight = document.body.clientHeight;
  4.          //the browser's viewable area
  5.  
  6.       // find the absolute top coordinate
  7.       var iAbsoluteYTop = oDiv.offsetTop;
  8.       var oParent = oDiv.offsetParent;
  9.       while (oParent.tagName.toUpperCase()!= "BODY") {
  10.          iAbsoluteYTop += oParent.offsetTop;
  11.          oParent = oParent.offsetParent;
  12.       }
  13.  
  14.       // find the absolute bottom coordinate
  15.       var iAbsoluteYBottom;
  16.       if (oBottomNeighbor != null) {
  17.          var iNeighborTop = oBottomNeighbor.offsetTop;
  18.          oParent = oBottomNeighbor.offsetParent;
  19.          while (oParent.tagName.toUpperCase()!= "BODY") {
  20.             iNeighborTop += oParent.offsetTop;
  21.             oParent = oParent.offsetParent;
  22.          }
  23.          iAbsoluteYBottom = document.body.scrollHeight - iNeighborTop
  24.       } else {
  25.          iAbsoluteYBottom = 0
  26.       }
  27.  
  28.       var iNewHeight = document.body.clientHeight - iAbsoluteYTop -
  29.          iAbsoluteYBottom;
  30.       oDiv.style.posHeight = (iNewHeight >= iMinHeight ? iNewHeight :
  31.          iMinHeight);
  32.    }

Calling this fun ction on BODY onLoad and passing my scrolling DIV as the first argument and the ID of the first object below the DIV as the second argument.

This function is not working Firefox. In IE it's working fine.Can anyone please help me to solve this problem??

Thanks,
Geetha.
Jan 16 '08 #1
3 3996
acoder
16,027 Expert Mod 8TB
Calling this fun ction on BODY onLoad and passing my scrolling DIV as the first argument and the ID of the first object below the DIV as the second argument.
If you pass the ID of the object, it won't become an object unless you use document.getElementById(oBottomNeighbor).
Jan 16 '08 #2
If you pass the ID of the object, it won't become an object unless you use document.getElementById(oBottomNeighbor).

Hi,

Solved pbm by adujusting the stlye property of <div> tag... :-)


Thanks,
Geetha.
Jan 18 '08 #3
acoder
16,027 Expert Mod 8TB
Glad you got it working. Post again if you have any more questions and hopefully someone should be around to answer them.
Jan 18 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Hugh Dickinson | last post: by
8 posts views Thread by gpbmike | last post: by
1 post views Thread by Mickey | last post: by
5 posts views Thread by gregmercer | last post: by
5 posts views Thread by Spondishy | last post: by
8 posts views Thread by knoxautoguy | last post: by
2 posts views Thread by Jan Doggen | last post: by
3 posts views Thread by AngryHank | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.