View Full Version : Smooth Navigational Menu - First Item/Anchor Tag Fires on Page Load.

05-03-2012, 04:03 PM
1) Script Title: Smooth Navigational Menu (v1.5)

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

3) Describe problem: First menu item/anchor tag fires upon page load.

I define my navigational menu postion/structure, as you see here:

<div id="smoothmenu1" class="ddsmoothmenu" style="position:absolute;left:0px;top:0px;width:100%;">
<li><a href="#" onclick="sub_form('app/welcome.fex'); return false;">Home</a></li>
<li><a href="#">Reports</a>
<li><a href="#" onclick="sub_form('app/report1.fex'); return false;">Report 1</a></li>
<li><a href="#" onclick="sub_form('app/report2.fex'); return false;">Report 2</a></li>
<br style="clear: left" />
My problem is that the first menu item anchor tag (Home) fires the sub_form JavaScript function upon a page load.

This scenario occurs on a sporadic basis.

I know that this is happening, because I can see the results of the execution of the function in Fiddler2.

Is there some issue with how I've created the menu items?

Does Smooth Menu have a feature of automatically running the first item, that I am unintentially setting?

Thanks you for your assistance,

05-04-2012, 05:24 AM
Do you have a live link so we can check out the problematic page?

The fact that it's only happening sometimes suggests an external factor.....

05-04-2012, 08:35 PM
Thank you for your comment.

You are correct, it was something external, outside of the page itself.

The browser was firing off a cached copy of the url, created in a prior run of the menu page, upon page load.

We now prevent this from happening, and all is well.

Thanks again,