0

Have this: (and no idea where it's coming from)

    <script type="text/javascript">
       jQuery(document).ready(function()
            {
                jQuery('.hasTooltip').tooltip({"container": false});
            });
    </script>

And this:

 <script type="text/javascript">
    jQuery(document).ready(function() {
    jQuery(".deeper").addClass("has-dropdown");
    jQuery("ul li ul").addClass("dropdown");


    jQuery("ul").removeClass("nav");
     jQuery("ul").removeClass("menu");
  });
 </script>

I think they're causing conflict on something else on the page.

Since I have no idea how to remove the first one, how do I resolve it in the second one?

Like how to remove it?

Background: It's a template page in Joomla CMS. It renders fine. Except when you use the search button. Then the menu goes whacko.

Have gone through everything else over with a fine-tooth comb.

Halp?

If there's no enough info in this post, please let me know.

I'm really hoping that by the virtue of the fact if I'm able to remove the first jQuery, that it will solve the menu's problem.

EDIT

Ok, sorry for not being clearer.

First code quote, I have no idea where it came from, therefore, I can't remove it since it's auto-generated.

Second code quote is mine.

I was hoping for guidance in getting rid of the first one.

Any ideas how since it's auto-generated?

user273072545345
  • 1,536
  • 2
  • 27
  • 57
  • The first snippet is to do with Bootstrap which ia automatically imported with Joomla 3.x so I would not start trying to remove this as it would mean editing core files. The second snippet I believe is also to do with Bootstrap but not sure if it's core based or coming from the template. – Lodder Dec 24 '13 at 23:39
  • I would suggest that you combine the two by cutting and pasting the one useful line from the first script (jQuery('.hasTooltip').tooltip({"container": false});) and pasting it into the second script somewhere after the first line (jQuery(document).ready(function() {) – DOK Dec 24 '13 at 23:41
  • @DOK, Have edited my post so hopefully it's clearer where my hands are tied at. – user273072545345 Dec 25 '13 at 02:54
  • @Lodder, Have edited my post so hopefully it's clearer where my hands are tied at. – user273072545345 Dec 25 '13 at 02:54
  • Do you have any sample? I don't think they should cause any conflict, you can have multiple jquery ready calls, they will be served on first come first basis. If sequence is important then you need to combine them. – Raunak Kathuria Dec 25 '13 at 03:03
  • @RaunakKathuria mean that somehow the scripts aren't being read in the search results page? Then I thought, maybe it's those two code scripts ... (the ones in my post). Any insight would be appreciated! – user273072545345 Dec 25 '13 at 03:24
  • For context here, am deleting one of my comments so I can remove the link. Can't find a way to edit it, hence its removal. – user273072545345 Dec 25 '13 at 05:54

1 Answers1

0

Problem

When you are in index.php

jQuery('.hasTooltip') 

script section is not getting loaded, but when you search something

jQuery('.hasTooltip')

returns

<button name="Search" onclick="this.form.submit()" class="btn hasTooltip"
 title="Search"><span class="icon-search"></span></button>

so this has no method tooltip() that's why it prevents other document ready to not load

Solution

find the component that adds this code and remove or change it

or

Find the template, module or plugin that is loading the jQuery library and configure it to use the no-conflict mode,

or

Some component/Module/Plugin is calling the function JHTML::_('behavior.tooltip'). and that function add your code.

you can do:

The dirty way: go to libraries\cms\html\bootstrap.php and change the file at the method tooltip(). but remember it's a core file so upgrade can overide your changes.

Refer google group article they have described some preg_replace way to remove this

Reference

https://groups.google.com/forum/#!topic/joomla-dev-general/-8CUpPvt61M

Joomla 3.X - Remove tooltip script from header?

http://www.jevents.net/docs/jevents/item/popups-or-tooltips-do-not-work-in-the-frontend-of-joomla

Community
  • 1
  • 1
Raunak Kathuria
  • 3,185
  • 1
  • 18
  • 27
  • hey, thank you! I figured it where it came from (due to your answer) and deleted that line, and now the menu works! Of course, I still have a question about my search page, but I'll make it another post. Thank you so much for taking the time to help me to troubleshoot it! Merci! – user273072545345 Dec 25 '13 at 05:52
  • ugh! ok ... ran the search again, and guess what? it works (ie, menu stays intact) if i use a word that they can't find. **however**, if i use a word they can find, the menu still gets messed up! agh!!!! why does this happen based on the results???? – user273072545345 Dec 25 '13 at 05:58
  • In both the scenario check if any where there is any element with class hastooltip.. Did you tried the hacks, its some module fiddling with other. – Raunak Kathuria Dec 25 '13 at 07:13