September 21, 2014 at 22:24 #1386
I’ve encountered a conflict between Smartmenus and Sphider search engine. I can get one or the other to work, but have had no luck getting them to work together. Note that “not working” for Sphider means nothing appears in the results, while “not working” for Smartmenus means the top level menu appears (and appears properly formatted) but no supbmenus appear when I mouse over (or click on) the top level menu items.
Both Smartmenus and Sphider are jQuery plug-ins, so I assume there is a conflict somewhere.
Here’s the smartmenus code:
I have added
after the jQuery call, with no improvement. Any suggestions?
Note: It looks like some of the code is not displaying the between the “pre” tags. Anybody know why?
JonSeptember 22, 2014 at 11:33 #1730
So I tried removing the jQuery calls from the Sphider code, leaving the Smartmenus jQuery call intact, figuring that this way there would be no jQuery conflict because everybody would be using the same library. Perversely, Sphider continued to work and Smartmenus continued to not work.
Thoughts/suggestions?September 24, 2014 at 06:06 #1736
Hi, it’s difficult to guess what exactly might be causing the issue without being able to test a complete live example so if possible, please post an URL to a live demo. It’s not clear from the code excerpts you’ve posted what might be the exact cause of the issue.
What you might want to double check are the paths to the JS files – make sure they are all properly loaded. I saw you are using relative paths so they might not work if you load pages in sub directories on your server. Another thing you might want to check is if your menu UL/LI/A structure is valid – if all tags are properly nested – this sometimes might cause the sub menus to not appear properly.September 24, 2014 at 09:52 #1739
Enter a word in the search box (“MODTRAN” will produce a nice set of results) and click Search. That will lead to a Search Results page that demonstrates the problem.
The menus work fine on every other page of the site, so I don’t think the UL/LI/A structure has a problem, but I will check it carefully to be sure.
I did use a little code that checks the jQuery version, so I know it is loaded enough to reveal its version number.
Thanks for your help.
JonSeptember 25, 2014 at 05:55 #1741
OK, it’s a path related issue. At the moment, on your search results page the following:
does not include jQuery correctly. Instead of linking to “jquery-loader.js” link directly to “jquery-2.1.1.js” – e.g.:
The loader script is used on the demo pages just to allow easy testing with different jQuery versions.
Cheers!September 25, 2014 at 09:11 #1743
Yes, I tried various versions of that line, including the one you suggested, with no difference. I have now changed it to the direct link you suggested and if you try it again you will see that the problem, unfortunately, remains as before.September 25, 2014 at 10:43 #1744
Ah, sorry, yes now I noticed there is another version of jQuery linked further in the source of your page. If you would like to keep both versions or you are forced to do so (you are not able to reorder the scripts easily, etc.), then you can use the following to avoid the issue:
I’ve added some comments in the code to make it clear what happens.
Please let me know if you still have any troubles.September 25, 2014 at 11:09 #1745
That did it! I had tried using $.noConflict() earlier but apparently had not implemented it correctly because it didn’t work. This does work. My client will be much happier.
Thanks again for your help.
JonSeptember 25, 2014 at 14:58 #1746
Np, at all! Cheers!
- You must be logged in to reply to this topic.