PDA

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



DBriars
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%;">
<ul>
<li><a href="#" onclick="sub_form('app/welcome.fex'); return false;">Home</a></li>
<li><a href="#">Reports</a>
<ul>
<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>
</ul>
</li>
</ul>
<br style="clear: left" />
</div>
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,
Dave

keyboard
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.....

DBriars
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,
Dave