1
hydrO
Problem with Javascripts in Newbb in IE
  • 2006/3/26 12:14

  • hydrO

  • Not too shy to talk

  • Posts: 105

  • Since: 2004/1/8 8


Hi.

I am developing 3 column based theme using CSS. I have a javascript in my theme.html which adjusts the height of the layout inorder to make the footer visible only at the bottom.

Here is the particular Javascript :

<script type="text/javascript" src="<{$xoops_url}>/themes/mytheme/x.js"></script>
<script type="text/javascript">
function adjustLayout()
{
// Get natural heights
var cHeight = xHeight("content");
var lHeight = xHeight("leftside");
var rHeight = xHeight("rightside");

// Find the maximum height
var maxHeight =
Math.max(cHeight, Math.max(lHeight, rHeight));

// Assign maximum height to all columns
xHeight("content", maxHeight);
xHeight("left", maxHeight);
xHeight("right", maxHeight);

// Show the footer
xShow("footer");
}



window.onload = function()
{
xAddEventListener(window, "resize",
adjustLayout, false);
adjustLayout();
}
</script>


However everything works fine except when it comes to viewing Newbb module in IE. The drop down CSS menus in Newbb fails to show up in IE.

I have figured out that this problem in IE is caused by the javascript that I am using to adjust the layout. When I remove this script from the theme.html, the drop down menus in Newbb2 does appear.

But I definitely would need that javascript to be included in the theme file for all the other modules. I would like to see if there is a way I can come around with this problem.

Perhaps with a PHP or a Javascript code that can disable this particular script when Newbb2 loads?

Would be great if someone can show me a way to get around with this.
Download Dhivehi mp3s
[size=x-small]www.gnatoll.com[/size]

2
m0nty
Re: Problem with Javascripts in Newbb in IE
  • 2006/3/26 12:31

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


FAQ section on theme design would help you a lot..

make sure you have <{$xoops_module_header}> in the head tag of your theme

3
hydrO
Re: Problem with Javascripts in Newbb in IE
  • 2006/3/26 12:44

  • hydrO

  • Not too shy to talk

  • Posts: 105

  • Since: 2004/1/8 8


Hi I have searched through the whole website and I could't find a solution to this problem. I don't even think anyone else had mentioned about this problem in the forum.

I have included XOOPS module header in my theme, and everything works pretty fine in Firefox. The only thing is that this Javascript is causing some conflicts with Newbb2 contents in IE. (atleast thats what I could think of).

Right now I am just looking for a way to perhaps disable this script when it comes to Newbb2...
Download Dhivehi mp3s
[size=x-small]www.gnatoll.com[/size]

4
hydrO
Re: Problem with Javascripts in Newbb in IE
  • 2006/3/30 6:45

  • hydrO

  • Not too shy to talk

  • Posts: 105

  • Since: 2004/1/8 8


If anyone was looking for this info, I worked it out using PHP If function.

Here is what i did.

Before putting the script on my header I added a statement to check if the selected module is Newbb( forum)and, end the <head> tag if its the Forum.


<{if $xoops_pagetitle|truncate:5:""=="Forum" }>
</head>

<{else}>
..{java script goes here}...

</script>
</head>
<{/if}>
Download Dhivehi mp3s
[size=x-small]www.gnatoll.com[/size]

5
hydrO
Re: Problem with Javascripts in Newbb in IE
  • 2006/4/5 9:54

  • hydrO

  • Not too shy to talk

  • Posts: 105

  • Since: 2004/1/8 8


Does anyone know if it is possible to detect IE using php? if so please let me know. I want to disable those javascripts strictly for IE Only.
Download Dhivehi mp3s
[size=x-small]www.gnatoll.com[/size]

Login

Who's Online

207 user(s) are online (147 user(s) are browsing Support Forums)


Members: 0


Guests: 207


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits