JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 4th, 2005, 12:16 PM
wyclef wyclef is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2005
Posts: 8 wyclef User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 16 sec
Reputation Power: 0
Conflicting Javascripts - Help Please

Hi, i've got 2 scripts that work perfectly fine independently but when you merge them together Mac IE 5.2.3 does not like. Something about the Toggle Object changing the height of the layout and interacting with the Center Object does not mesh well together for Mac IE 5.2.3. onResize everything is fine so I'm thinking if there is a clever way to utilize the setContent(); function after onClick or something that would probably do the trick. But let me know if you notice anything that stands out. Thanks.

Code:
/*--------------------------------------------------
	Center Object
--------------------------------------------------*/
<!--
function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}
function setContent() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			var contentElement = document.getElementById('content');
			//var contentHeight = contentElement.offsetHeight;
			var contentHeight =
				document.getElementById('header').offsetHeight +
				document.getElementById('info').offsetHeight +
				document.getElementById('footer').offsetHeight; 
			if (windowHeight - contentHeight > 0) {
				contentElement.style.position = 'relative';
				contentElement.style.top = ((windowHeight / 2) - (contentHeight / 2)) + 'px';
			
			//rules for IE Mac
				
			if(navigator.appVersion.indexOf("MSIE") != -1){var IE = true}else{ var IE = false;}
			if(navigator.appVersion.toLowerCase().indexOf("mac") != -1){var Mac = true}else{ var Mac = false;}
			
			if(Mac && IE) {
				//get the height of header
				var headH = document.getElementById('header').offsetHeight;
				//set position of INFO based on that height
				document.getElementById('info').style.position = 'absolute';
				document.getElementById('info').style.top = headH +'px';
			
				//get the height of INFO
				var infoH = document.getElementById('info').offsetHeight;
				//set position of Footer based on that height
				document.getElementById('footer').style.position = 'absolute';
				document.getElementById('footer').style.top = (infoH + headH)  +'px';
			}
			}
			else {
				contentElement.style.position = 'static';
			}
		}
	}
}
/*--------------------------------------------------
	Toggle Object
--------------------------------------------------*/
<!--
init = function () {
	var table = document.getElementsByTagName("table");
	for (var i=0; i<20; i++) {
		var caption = table[i].getElementsByTagName("caption");
		caption[0].thead = table[i].getElementsByTagName("thead");
		caption[0].tbody = table[i].getElementsByTagName("tbody");
		// hide thead and tbody
		caption[0].thead[0].style.display = 'table-header-group';
		caption[0].tbody[0].style.display = 'table-header-group';
		caption[0].onclick = function () {
			this.thead[0].style.display = this.thead[0].style.display == 'none' ? '' : 'none';
			this.tbody[0].style.display = this.tbody[0].style.display == 'none' ? '' : 'none';
			setContent();
		} 
	}
}
window.onload = function() {
	init();
	setContent();
}
window.onresize = function() {
	setContent();
}
//-->

Reply With Quote
  #2  
Old June 30th, 2006, 04:43 PM
colton22's Avatar
colton22 colton22 is offline
\ ^_^ / - *Local Friend*
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Location: near chicago, Illinois
Posts: 475 colton22 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 1 h 36 m 37 sec
Reputation Power: 5
Send a message via AIM to colton22 Send a message via MSN to colton22 Send a message via Yahoo to colton22
what error message are you getting, line exc. plz list that eather on a post or in a txt file, and zip me the files, ill take a look at it

colton22

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Conflicting Javascripts - Help Please


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.


© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek