Solved

div tag height problem in firefox

Posted on 2007-04-09
5
585 Views
Last Modified: 2013-12-07
I am developing my site using css.no table tags are used .developed using div and ul ,li tags.
I have a site which is working perfectly fine in ie6 and ie 7 but it is not showing me proper layout in firefox.

I am increasing height of left side navigation using JavaScript on click of technology option in top menu.
Menu is display correctly in firefox. But when I am writing

document.getelementbyid("sidenav").style.height=465;

It is showing me error in firefox that

document.getElementById("sidenav") has no properties

How to adjust div tag height using JavaScript in firefox.

Below is the url of that page:

http://yourwebsitepreview.com/tickboxdb.com/newindex.asp

And footer div tag is coming in header..........

Is their any other way to do this...?
0
Comment
Question by:dotsandcoms
  • 2
  • 2
5 Comments
 
LVL 8

Assisted Solution

by:jawahar_prasad
jawahar_prasad earned 360 total points
ID: 18875192
Try this..

document.getelementbyid("sidenav").style="height:465";
0
 
LVL 8

Accepted Solution

by:
jawahar_prasad earned 360 total points
ID: 18875204
ignore that...

TRY THIS

<html>
<head>
<title>Untitled Document</title>
<script language="javascript">
function fn()
{
document.getElementById("sidenav").style.height="465";
}
</script>
</head>

<body>
<div id="sidenav" style="background-color:#000099;">asdasdasd</div>
<a href="#" onclick="fn()">Click</a>
</body>
</html>

"getelementbyid"  property is CASE SENSITIVE, It should be "getElementById"
0
 
LVL 28

Assisted Solution

by:TName
TName earned 20 total points
ID: 18875294
I can't find any "sidenav" element. There is a ul with the id "subNav".
You are trying repeatedly to access it with
document.getElementById("subnav") - all lower case...

but it should be

document.getElementById("subNav")    //  "subNav" with an uppercase "N"
0
 
LVL 21

Assisted Solution

by:Dale Burrell
Dale Burrell earned 120 total points
ID: 18875304
I believe that according to the standards it requires units e.g.

document.getElementById("sidenav").style.height='465px';
0
 
LVL 21

Assisted Solution

by:Dale Burrell
Dale Burrell earned 120 total points
ID: 18875316
And yes - definitely need to get the ID's correct as they are case sensitive - assume everything is case sensitive and you'll never have to worry.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Show confirmation alert in Jquery 14 42
Error in script 11 46
Change CSS to show Notification Bar 9 17
ms/access webbrowser address not valid  - 12 30
Several part series to implement Internet Explorer 11 Enterprise Mode
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now