Results 1 to 7 of 7

Thread: Anylink CSS Menu Demo 1 - Javascript Conflict

  1. #1
    Join Date
    Aug 2013
    Location
    Brisbane, Australia
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Anylink CSS Menu Demo 1 - Javascript Conflict

    1) Script Title: AnyLink CSS Menu v2.3

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

    3) Describe problem: I am successfully running this Dropmenu on all of my http://www.powerpinochle.com pages, except for two of my pages that have some custom javascript/ajax that I created myself. The error is presented by the dropmenu instantly vanishing when I mouseout of the dropmenu anchor. Is anyone else experiencing this? Is this a conflict with my javascript variables/functions and the jquery scripts? I wouldn't know where to start debugging this as I am not proficient in jquery.

    I am running this on top of MyBB software, which is where the other codes come from.

    To replicate the error, mouseover the Basics link in the navmenu, then try to mouse to one of the three options in the list.

    The two pages require login, but they are here:
    1. MeldTraining
    2. MeldTest


    Head Section: MeldTrainingHEAD.txt
    Head Section: MeldTestHEAD.txt

    TIA
    mickmackusa
    Last edited by jscheuer1; 08-28-2013 at 09:50 AM. Reason: Format

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,935
    Thanks
    43
    Thanked 3,192 Times in 3,155 Posts
    Blog Entries
    12

    Default

    Do you mean we have to log on to see the problem? If not, it's fine in Chrome, so which browser(s) are giving you the problem? If so, how about setting up a guest account for us to test in?

    In any case, anylink doesn't use jQuery or any other script library. So if it's a conflict with jQuery, it's an odd one.

    More likely some unseen element is covering the menu.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Aug 2013
    Location
    Brisbane, Australia
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Pages For Non-Member Viewing

    If you do not login, the page is auto-redirected to the registration page.
    Going to:
    http://www.powerpinochle.com/forum/meldtest.php
    Redirects to:
    http://www.powerpinochle.com/forum/member.php?action=register
    Which works properly.

    I am experiencing this error, while using Firefox.
    Yup, no jquery, sorry to mention that.

    I am going to temporarily provide new pages that don't redirect non-members.
    http://www.powerpinochle.com/forum/meldtrainingDebug.php
    http://www.powerpinochle.com/forum/meldtestDebug.php


    As I mentioned before, other pages do not have this issue.
    Last edited by jscheuer1; 08-28-2013 at 03:04 PM. Reason: Format

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,935
    Thanks
    43
    Thanked 3,192 Times in 3,155 Posts
    Blog Entries
    12

    Default

    Ah the wonders of PHP . . . I don't know why it's happening (includes probably) but there are three of these in the served source code of the page:

    Code:
    <link rel="stylesheet" type="text/css" href="http://www.powerpinochle.com/css/anylinkcssmenu.css" />
    <script type="text/javascript" src="http://www.powerpinochle.com/js/anylinkcssmenu.js">
    /***********************************************
    * AnyLink CSS Menu script v2.0-  Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Project Page at http://www.dynamicdrive.com/dynamicindex1/anylinkcss.htm for full source code
    ***********************************************/
    </script>
    <script type="text/javascript">
    //anylinkcssmenu.init("menu_anchors_class") ////Pass in the CSS class of anchor links (that contain a sub menu)
    anylinkcssmenu.init("anchorclass")
    </script>
    Other code is repeated as well I believe. I didn't look into that part too deeply. You need to look at the template for the page for it's includes/requires or otherwise imported content, and any includes/requires or otherwise imported content on them, as well as any code on the template(s)/imported content for the page to see where all that repetition is coming from.

    To see the problem hit ctrl-U (view source) and ctrl-F (find) and count the number of:

    Code:
    anylinkcssmenu.init("anchorclass")
    there are. There are three. On the working pages, only one.

    Note: I only checked meldtrainingDebug.php, the other is probably similar though.

    Once you fix this:

    The browser cache may need to be cleared and/or the page refreshed to see changes.

    And the server cache might need to be flushed as well at points during the process to see if you're making any progress on the served source code. You can always periodically check that using the browser's "View Source" again.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Aug 2013
    Location
    Brisbane, Australia
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I have solved the replication of code.
    I was echoing $headerinclude which is what all the other pages use (successfully) AND rewriting the lines in the two faulty pages. I simply deleted the extra lines on the faulty pages.

    The dropmenu works when I do not echo $headerinclude inside the <head>, however I obviously can't use this as a solution because $headerinclude includes other vital bits.

    I've cleared the cache -- error persists.
    I've tried on Firefox and Chrome -- error persists.

    $headerinclude & dropmenu still works on all other pages.
    meldtrainingDebug & meldtestDebug dropmenus are still vanishing.

    This is going to be one of those tiny syntax things that will cause me to smack my forehead when it is discovered.

    Any other suggestions?
    Last edited by jscheuer1; 08-29-2013 at 12:46 AM. Reason: unneeded quoting

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,935
    Thanks
    43
    Thanked 3,192 Times in 3,155 Posts
    Blog Entries
    12

    Default

    I find it hard to believe that you cannot control what appears in the served source code of the pages. That's just a sloppy use of PHP. If you cannot figure out why it's being included multiple times, try changing include to include_once:

    http://www.php.net/manual/en/function.include-once.php

    If all else fails, javascript code can be added to prevent multiple inits. Anywhere you have this:

    Code:
    <link rel="stylesheet" type="text/css" href="http://www.powerpinochle.com/css/anylinkcssmenu.css" />
    <script type="text/javascript" src="http://www.powerpinochle.com/js/anylinkcssmenu.js">
    /***********************************************
    * AnyLink CSS Menu script v2.0-  Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Project Page at http://www.dynamicdrive.com/dynamicindex1/anylinkcss.htm for full source code
    ***********************************************/
    </script>
    <script type="text/javascript">
    //anylinkcssmenu.init("menu_anchors_class") ////Pass in the CSS class of anchor links (that contain a sub menu)
    anylinkcssmenu.init("anchorclass")
    </script>
    Make it like so:

    Code:
    <script type="text/javascript">
    /***********************************************
    * AnyLink CSS Menu script v2.0-  Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Project Page at http://www.dynamicdrive.com/dynamicindex1/anylinkcss.htm for full source code
    ***********************************************/
    if(typeof anylinkcssmenu === 'undefined'){
    	document.write('<link rel="stylesheet" type="text/css" href="http://www.powerpinochle.com/css/anylinkcssmenu.css" />\n' +
    	'<script type="text/javascript" src="http://www.powerpinochle.com/js/anylinkcssmenu.js"><\/script>\n');
    }
    </script>
    <script type="text/javascript">
    //anylinkcssmenu.init("menu_anchors_class") ////Pass in the CSS class of anchor links (that contain a sub menu)
    if(!anylinkcssmenu.anchorclass){
    	anylinkcssmenu.init("anchorclass");
    	anylinkcssmenu.anchorclass = true;
    }
    </script>
    The browser cache may need to be cleared and/or the page refreshed to see changes.

    And the server cache may need to be cleared as well.
    Last edited by jscheuer1; 08-29-2013 at 02:24 AM. Reason: fix code
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Aug 2013
    Location
    Brisbane, Australia
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Found the head-slapping part of my code.
    I was still echoing $headerinclude, just not were I suspected.
    You mentioned 3 occurrences (2 extras), but I only removed the one in the <head> as I didn't see the other.
    The 3rd was in the <body>.
    Definitely all my fault.
    I removed it and all is well now.

    Thanks!
    Solved.

Similar Threads

  1. Help Needed with Anylink CSS Menu Demo 1
    By slspinler in forum CSS
    Replies: 4
    Last Post: 05-15-2013, 10:17 PM
  2. javascript conflict for menu and slideshow
    By herbyderby in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 08-11-2010, 03:01 AM
  3. Anylink drop down menu - Demo #3 (sub menus drop to the right of anchor):
    By pjdcreative in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 06-17-2010, 02:54 AM
  4. Replies: 2
    Last Post: 08-03-2006, 01:56 PM
  5. Advanced Gallery Script conflict with Anylink DropDown Menu
    By JMax in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 09-29-2005, 03:20 PM

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
  •