Log in

View Full Version : Smooth Navigational Menu Ajax call not working consistently



revdunstan
08-21-2013, 09:05 AM
Script Title: Smooth Navigational Menu

Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/ddsmoothmenu.htm


This is a fabulous script. I've developed a new set of pages on an existing site using it. These pages seem to work completely perfectly on my Windows 7 machine running IE10. However, my Vista machine running IE9 doesn't like it (though it runs your example site perfectly). I can only assume I've introduced some weird coding error but cannot see it for looking. Please help!

The first failure I noted and corrected was not using a relative reference for my menu file (I was using a full http:// absolute ref). When I corrected that, the menu actually appeared (until then, there was just a blank line on my page). However, there are now two problems:
1. The arrows indicating drop down sub-menus don't all appear (there should be three, only the first appears), and
2. The drop down function doesn't work anyway.

Having checked on a third machine (XP with IE8), I find two different problems:
1. It displays the whole menu (with all three drop-downs correctly visible), and drops down the first sub-menu levels for all options, but doesn't produce the sub-sub-menu levels!
2. Once the second and third drop-downs have been activated (hovered-over and dropped down), a strange "hole" appears in the page below the menu options. It looks like a hole (same colour as the page background) but it is actually in the foreground, so that it hides the first letter of the third drop-down menu when it is activated a second time.

If you can shed any light on why this would be, that would be great - I don't want a site which works on only some computers!

(I have updated the .js and .css files to the most recent versions. This has made no difference.)

My site using the pages:
www.hwwchurch.org.uk/holidayclub This shows how I originally coded the menu options (works completely fine on my IE10, Windows 7 machine but not at all on the others!)
www.hwwchurch.org.uk/wareside This shows the adapted relative reference. I also changed "smoothmenu" file so it was just the DIV tag including the menu options like your example (the holidayclub menu file is more than this and included pretty much all of the coding from your page including all of the <script> ddsmoothmenu.init bits!)
www.hwwchurch.org.uk/ws A further development trying to fix the problem, making a couple of the other references "relative" instead of absolute (hasn't changed anything).

Thanks for any help you can offer here. (I'm new here, so please let me know if you need anything else!)

Mark

Beverleyh
08-21-2013, 10:43 AM
The markup at the top of your web pages is incorrectly formatted - looks like this;
<html>
<head>
<!DOCTYPE html>

It should look like this;
<!DOCTYPE html>
<html lang="en">
<head>

Correct the markup and hopefully that will improve things, but let us know if not

revdunstan
08-21-2013, 05:55 PM
Thanks Beverley,
That's sorted it completely! I would never have imagined the solution was something so simple. :)
In my defence... I did exactly what the instructions said and inserted the relevant code (including the <!DOCTYPE> tag) into the <head> section of my code. I learned from "Teach yourself HTML in 24hrs" and don't know any better, I'm afraid! Should I include <!DOCTYPE html> at the start of all my pages? And should I also put the attribute 'lang="en"' in the <html> tag every time?

Thanks so much for your help.
Mark

Beverleyh
08-21-2013, 07:14 PM
;)

Yes you should declare a DOCTYPE right at the very top of all your web pages. There are different sorts - this one is for HTML5 - and they help a web browser understand the content that follows so it can display/process it in a predictable way. Not using any DOCTYPE can make a web browser interpret things differently/awkwardly (as you've discovered)

I'm not 100% sure about the language declaration. Lots or sources say is *should* be used, but I'm not sure if that's because its critical or just good practice. Its good practice any way though so I would say to use it rather than leave it.