1 lotek Oct 24, 2007 11:14
3 samredman Nov 01, 2007 19:49
On your main page (programs htm) you call the script with this
<script src="scripts/menuScript.js"></script>
It provides this code:
sfHover = function() {
var sfEls = document.getElementById("nav").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (document.all&&document.getElementById) window.onload=sfHover;
However, on your blog main.php, you don't use the script source (js file) link, but instead attempt to post the script (from that script file) directly on the page. That should work ok (normally), but it appears that the script you have on the page has commented out a major part of the code (see the highlights in red on the example following). Plus, that "CDATA" thing seems extraneous as well:
<script type="text/javascript"><!--//--><![CDATA[//><!--
sfHover = function() {
var sfEls = document.getElementById("nav").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls.onmouseover=function() {
this.className+=" sfhover";
}
sfEls.onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
//--><!]]></script>[/quote]
Hopefully, some comparisons will reveal the problems (if what I have mentioned doesn't give a clue).
I think maybe this might show your problem... and the solution perhaps will be apparent.
4 lotek Nov 02, 2007 02:34
Thanks guys, but those suggestions didn't seem to work. Still no IE drop downs on the menu.
Could it have anything to do with text encoding?
The code in the page is as follows:
<script type="text/javascript">
sfHover = function() {
var sfEls = document.getElementById("nav").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (document.all&&document.getElementById) window.onload=sfHover;
</script>
5 afwas Nov 02, 2007 02:55
hi,
A quick reply:
if javaScript is case sensitive, try changing LI in line 3 into li.
Both samredman and I hoped the code worked the way you put in your last post.
If you don't succeed I ask you to put a zipfile on your server with the complete skin (the folder and it's contents) so I can have a play with it.
Good luck
The obvious answer to your question is: 'I don't know'. But we can try to find the solution together.
First: try the same code in the blog as the code you used in the main page:
Second: try the javaScript without the comments:
in stead of:
and
in stead of:
Please report back to this topic.
Good luck