-
AuthorPosts
-
February 25, 2009 at 2:38 am #138526
Hi,
yet again, I have a problem with some of the code on my website
go to http://www.cfsconline.com and click “your choices”
when browsing with IE 7 or lower, the menu that’s supposed to be on the left is in the middle of the text, the text is formatted incorrectly, and it doesn’t float like it;s supposed to. It is fine in IE8, FF, and Safari.
here is the code for that menu, can someone please tell me what’s wrong? I know it is not really a joomla issue but I am pulling my hair out here!
Thanks
<html>
<HEAD><SCRIPT LANGUAGE=”JavaScript”>
<!– Begin
window.onerror = null;
var topMargin = 100;
var slideTime = 1200;
var ns6 = (!document.all && document.getElementById);
var ie4 = (document.all);
var ns4 = (document.layers);
function layerObject(id,left) {
if (ns6) {
this.obj = document.getElementById(id).style;
this.obj.left = left;
return this.obj;
}
else if(ie4) {
this.obj = document.all.style;
this.obj.left = left;
return this.obj;
}
else if(ns4) {
this.obj = document.layers;
this.obj.left = left;
return this.obj;
}
}
function layerSetup() {
floatLyr = new layerObject(‘floatLayer’, pageWidth * .5);
window.setInterval(“main()”, 10)
}
function floatObject() {
if (ns4 || ns6) {
findHt = window.innerHeight;
} else if(ie4) {
findHt = document.body.clientHeight;
}
}
function main() {
if (ns4) {
this.currentY = document.layers[“floatLayer”].top;
this.scrollTop = window.pageYOffset;
mainTrigger();
}
else if(ns6) {
this.currentY = parseInt(document.getElementById(‘floatLayer’).style.top);
this.scrollTop = scrollY;
mainTrigger();
} else if(ie4) {
this.currentY = floatLayer.style.pixelTop;
this.scrollTop = document.body.scrollTop;
mainTrigger();
}
}
function mainTrigger() {
var newTargetY = this.scrollTop + this.topMargin;
if ( this.currentY != newTargetY ) {
if ( newTargetY != this.targetY ) {
this.targetY = newTargetY;
floatStart();
}
animator();
}
}
function floatStart() {
var now = new Date();
this.A = this.targetY – this.currentY;
this.B = Math.PI / ( 2 * this.slideTime );
this.C = now.getTime();
if (Math.abs(this.A) > this.findHt) {
this.D = this.A > 0 ? this.targetY – this.findHt : this.targetY + this.findHt;
this.A = this.A > 0 ? this.findHt : -this.findHt;
}
else {
this.D = this.currentY;
}
}
function animator() {
var now = new Date();
var newY = this.A * Math.sin( this.B * ( now.getTime() – this.C ) ) + this.D;
newY = Math.round(newY);
if (( this.A > 0 && newY > this.currentY ) || ( this.A < 0 && newY < this.currentY )) {
if ( ie4 )document.all.floatLayer.style.pixelTop = newY;
if ( ns4 )document.layers[“floatLayer”].top = newY;
if ( ns6 )document.getElementById(‘floatLayer’).style.top = newY + “px”;
}
}
function start() {
if(ns6||ns4) {
pageWidth = innerWidth;
pageHeight = innerHeight;
layerSetup();
floatObject();
}
else if(ie4) {
pageWidth = document.body.clientWidth;
pageHeight = document.body.clientHeight;
layerSetup();
floatObject();
}
}
// End –>
</script></HEAD>
<BODY onLoad=”start()”>
<DIV id=”floatLayer” style=”position: absolute; height:500px; width:200px; left:30px; top:1px;z-index: 100″>
<br>
<br>
<h3> On This Page</h3>
<ol>
<li><a href=”#your_credit”>Your Credit</a>
<li><a href=”#do_it_yourself”>Do It Yourself</a>
<li><a href=”#debt_consolidation”>Debt Consolidation</a>
<li><a href=”#credit_counseling”>Credit Counseling</a>
<li><a href=”#bankruptcy”>Bankruptcy</a>
<li><a href=”#debt_negotiation”>Debt Negotiation</a>
<li><a href=”#credit_card_payment_calculator”>Credit Card Payment Calculator</a>
</DIV>
</BODY>
</html>Anonymous ModeratorJA Developer
- Join date:
- September 2014
- Posts:
- 9914
- Downloads:
- 207
- Uploads:
- 152
- Thanks:
- 1789
- Thanked:
- 2008 times in 1700 posts
February 25, 2009 at 10:51 am #293366Hi,
you find following block:
} else if(ie4) {
this.currentY = floatLayer.style.pixelTop;
this.scrollTop = document.body.scrollTop;
mainTrigger();
}and change to:
} else if(ie4) {
this.currentY = floatLayer.style.pixelTop;
this.scrollTop = document.documentElement.scrollTop;
mainTrigger();
}1 user says Thank You to JA Developer for this useful post
Anonymous ModeratorJA Developer
- Join date:
- September 2014
- Posts:
- 9914
- Downloads:
- 207
- Uploads:
- 152
- Thanks:
- 1789
- Thanked:
- 2008 times in 1700 posts
February 25, 2009 at 10:52 am #293368with IE, please change document.body to document.documentElement
February 25, 2009 at 6:39 pm #293408Hi,
Well that seems to have gotten the text in the right format and now it is scrolling (THANKS!). However, the module is still floating in the middle of the page.
Any idea how I can get it to align correctly as it is in firefox? (in the lefthand column)
(I will make sure to thank you and mark best answer but I don’t want to do it yet or no one will look at this post :/)
Anonymous ModeratorJA Developer
- Join date:
- September 2014
- Posts:
- 9914
- Downloads:
- 207
- Uploads:
- 152
- Thanks:
- 1789
- Thanked:
- 2008 times in 1700 posts
February 26, 2009 at 8:02 am #293495Hi solrac28,
Find following code:
else if(ie4) {
pageWidth = document.body.clientWidth;
pageHeight = document.body.clientHeight;
layerSetup();
floatObject();
}and change to:
else if(ie4) {
pageWidth = document.body.clientWidth;
pageWidth = pageWidth * 0.1;
pageHeight = document.body.clientHeight;
layerSetup();
floatObject();
} -
AuthorPosts
This topic contains 5 replies, has 2 voices, and was last updated by Anonymous 15 years, 10 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum