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

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 4142
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

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

Similar topics

2
by: Hugh Dickinson | last post by:
Does anybody know whether the netscape 7+ browsers support afunction similar to the internet explorer doScroll() function, this has the effect of pressing the scrollbar button, but can be scripted...
0
by: nina | last post by:
Hi all, I've been working on a site that involves content in multiple scrolling DIVs on a page which is loaded inside multiple framesets. the layout is cramped as all hell but I'm not going to...
8
by: gpbmike | last post by:
I'm wondering if anyone else has had this problem before. Every now and then a div on my page will overlap with another. Thi only happens in firefox (vs. IE and Safari) and it corrects itself whe...
1
by: Mickey | last post by:
Hi, I have a script which works in both IE but is sluggish in Firefox. The script is a simple text scroller. It works perfectly in IE however in Firefox, the text scroll slower and eventually...
5
by: gregmercer | last post by:
I have the following html sample, where I'd like to have a show and hide two divs, one replacing the other. Following these two divs is a third div (the bluediv) which I would like to have placed...
5
by: Spondishy | last post by:
Hi, I am using the following in my stylesheet to center divs in firefox. html>body { font-size: 13px; } div.centerdiv {
8
by: knoxautoguy | last post by:
This problem has consumed a lot of my time, and I'm aftraid someone will tell me that my whole approach to this objective is wrong; however, I would like to know if there is a way to do this. I...
2
by: Jan Doggen | last post by:
Hello, The following code displays the name for all three elements in IE, but fails for the1st and 3rd in Firefox. What could be going on? I tried SPAN instead of DIV doesn;t work either....
3
by: AngryHank | last post by:
I am sure I am not typing the correct question in Google or this group to find the answer to my question. So, I have to ask. I have a scrolling div that I am changing text color and background...
0
by: tequilamala | last post by:
I have an Iframe in one of the pages i am developing... the iframe is suppose to scroll up and down and the links target the iframe. the problem is that the iframe scrolls side to side on internet...
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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.