Advanced Search

Results 1 to 10 of 10

Thread: Smooth navigational Menu javascript error

  1. #1
    Join Date
    Mar 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Smooth navigational Menu javascript error

    1) Script Title: Smooth Navigational Menu (v1.3)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...smoothmenu.htm

    3) Describe problem: I have installed the smooth navigational menu on a website. I am getting this javascript error:

    $mainmenu.parent().get(0) is undefined

    in both IE and Firefox. I can see the menu and the dropdowns are working, but it won't click to other pages. In fact, there is an iframe in the main body area and it is not displaying the content even on the home page.

    Is this because it is .asp? I have tried using an external file for the menu and that removed the dropdowns.

    Link: http://98.160.138.134:8155/default.asp

  2. #2
    Join Date
    Aug 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I am getting the same error here:

    http://174.133.84.88

    I hope there is a solution.....

    Dalmuti

  3. #3
    Join Date
    May 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I am too getting this error.

    In FF 3.0.10 the menu works but shows this error in the error console

    Error: $mainmenu.parent().get(0) is undefined
    Source File: http://localhost/New/js/ddsmoothmenu.js
    Line: 47

    -----------------------------------------------------------
    In IE8 the yellow error triangle appears in the bottom left of the browser window. Looking at the error it shows this


    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30618)
    Timestamp: Tue, 19 May 2009 19:58:23 UTC


    Message: 'parent().get(...)' is null or not an object
    Line: 47
    Char: 2
    Code: 0
    URI: http://localhost/New/js/ddsmoothmenu.js

  4. #4
    Join Date
    May 2009
    Posts
    2
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    has anyone figured out why this error is happening or if there is a fix? thanks!

    tony

  5. #5
    Join Date
    May 2009
    Posts
    2
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default FIX for this is easy.

    the fix for this is ridiculously easy. all you have to do is remove
    the extraneous .init function. if you are using ONLY the horizontal
    menu, remove the "v" one. if not, remove the "h" one. simple as that.

    wow, what a silly mistake!

    Code:
    <script type="text/javascript">
    
    ddsmoothmenu.init({
    	mainmenuid: "smoothmenu1", //menu DIV id
    	orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
    	classname: 'ddsmoothmenu', //class added to menu's outer DIV
    	//customtheme: ["#1c5a80", "#18374a"],
    	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
    })
    
    ddsmoothmenu.init({
    	mainmenuid: "smoothmenu2", //Menu DIV id
    	orientation: 'v', //Horizontal or vertical menu: Set to "h" or "v"
    	classname: 'ddsmoothmenu-v', //class added to menu's outer DIV
    	//customtheme: ["#804000", "#482400"],
    	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
    })
    
    </script>
    Last edited by Snookerman; 05-21-2009 at 05:15 AM. Reason: added [code] tags

  6. The Following User Says Thank You to rastafari For This Useful Post:

    mlerley (08-07-2009)

  7. #6
    Join Date
    Jul 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    unfortunately, this fix isn't working for me. i had already removed the init for the horizontal menu. i didn't experience any errors until i upgraded to IE8 and now i'm getting the following...

    Line: 47
    Error: 'parent().get(...)' is null or not an object

    any ideas?

  8. #7
    Join Date
    Aug 2009
    Posts
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Thumbs up

    FWIW, I had the same issue and removing the extra init call worked for me. Thanks rastafari!!

  9. #8
    Join Date
    May 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I am also having the same problem and I realised that the error is coming because I am not using the smooth menu on some pages but the init function is defined in the template. so this is causing it, I am not using the navigation on some pages but as the function init is included in the template.......is there any fix for this...

  10. #9
    Join Date
    Jan 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default if you are using this with joomla....

    hi guys

    if you are using this with joomla then you should make sure generated menu code doesnt has any style to it

    here is an example
    normally menu include looks like this

    <jdoc:include type="modules" name="top-menu" style="xhtml" />

    inorder to use this with joomla it should be

    <jdoc:include type="modules" name="top-menu" style="none" />

    hope this helps

    salman

  11. #10
    Join Date
    Nov 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    rastafari's answer above worked for me

    had the "null or is not an object" error in IE

    I was only using the horizontal menu so got rid of the vertical menu code in the JS and its now resolved.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •