Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

getElementbyID now working in FF on cflayout

Avatar of judsonmusic
judsonmusicFlag for United States of America asked on
JavaScriptCSSColdFusion Language
2 Comments1 Solution477 ViewsLast Modified:
in my code, I am changing the width of the cflayout tag using get element by id.

in IE, it seems to assume the ID as the name attribute. YOU CANNOT PUT AN ID on the CFLAYOUT itself.

everything works fine in ie, everytime you resize the window it resizes the cflayout to fill up the width.

The problem is that in FF and SAFARI, it says that ID is null. Can someone please tell me a workaround for this??

I basically have a div on the left that ios 150px wide and am floating the CFLAYOUT LEFT against it but want it to fill up the rest of the screen.

Thanks

Judson
<cflayout name="thelayout" type="border" style="height:500px;">
<cflayoutarea name="messageList" position="top" size="150" splitter="true" style="height:100%" source="dd_MessageList.cfm?path=#session.path#&folder=#trim(session.currentfolder)#"></cflayoutarea>
<cflayoutarea name="message" position="center" style="height:100%">Click message to view</cflayoutarea>
</cflayout>
</cfoutput>

<script language="Javascript">
window.init=changewidth();
function changewidth(){
	browser_detect = navigator.userAgent.toLowerCase();
	if 		((browser_detect.indexOf("safari") + 1)) 		{x = 'safari'; 	winW =+ window.innerWidth}
	else if ((browser_detect.indexOf("firefox") + 1)) 		{x = 'firefox'; winW =+ 200}
	else if ((browser_detect.indexOf("chrome") + 1)) 		{x = 'chrome'; 	winW =+ document.body.offsetWidth - 153}
	else if ((navigator.appName.indexOf("Microsoft")!=-1))  {x ='Microsoft'; winW =+ document.body.offsetWidth - 153}
	alert(x);	
	document.getElementById("thelayout").style.width =winW;
	alert(document.getElementById("thelayout").style.width=winW)
	}
	
	document.body.onresize = function (){
	changewidth()
	}
</script>
ASKER CERTIFIED SOLUTION
Avatar of Tom Beck
Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answers