We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5527
    • 7 Posts
    I’m working on the website on which I have some jQuery animations (slideshow and accordion). Now when I added the AjaxSearch to the site, neither those animations or AjaxSearch (which seems to use mootools) work properly. With my rather poor coding skills I assumed that commands in jQuery and Mootools must somehow overlap and cause the dysfunction. Is there any solution for that problem?

    Thank you for any help.
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      Got a link for us to check it out? smiley


      What has happened to me also is QuickManager messing up. When you include jQuery yourself, and then view the front-end while being logged in on the back-end it includes another jQuery and all jQ stops working. That can easily be fixed by disabling QuickManager: Elements -> Plugins -> QuickManager -> $show = FALSE;


      If the problem is indeed Mootools vs jQuery, you can also choose to use jQuery for AjaxSearch:
      &jScript

      Choose between Mootools (1.11 or 1.2) or jQuery. (optional) Set this to jquery if you would like to include the jquery library rather than mootools

      As you’ve already included the jQuery lib, you can the use this parameter to get rid of another one being included:
      &addJscript

      If you want the mootools library added to the header of your pages automatically set this to 1. (optional)

      Set to 0 if you do not want them included automatically.
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 5527
        • 7 Posts
        I tried both of the above options:

        1. Setting &jSript to `jQuery` didn’t seem to effect at all. It still brought the mootools.
        2. Settind &addJscript to `0` did work in means of getting rid of the mootools, but as a result the AjaxSearch didn’t work anymore.

        The original version, without either of the above applied, can be found at

        http://www.scancool.fi/hem.html
          • 18373 ☆ A M B ☆
          • 3,141 Posts
          I think it’s ’jquery’, no capital Q

          And if the wrong lib is being used (still Mootools cause it didn’t recognize jQuery), then removing the JS would indeed break it.
            Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

            Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
            • 5527
            • 7 Posts
            Quote from: Mark at Jun 17, 2010, 08:03 AM

            I think it’s ’jquery’, no capital Q

            And if the wrong lib is being used (still Mootools cause it didn’t recognize jQuery), then removing the JS would indeed break it.

            Actually I tried with both capital and lower case as I was unsure, but neither didn’t work.
            I now added again &jScript=`jquery` just for the reference.
            Still at
            http://www.scancool.fi/hem.html

              • 18373 ☆ A M B ☆
              • 3,141 Posts
              There seems to be an error in the slideSwitch function

              function slideSwitch() {
              var $active = $('#case li.active');
              
              if ( $active.length == 0 ) $active = $('#case li:last');


              It returns $active == null, cause it can’t find $(’#case li.active’)

              If I look in the page source, I can’t find it either :p

              The .active class, how were they supposed to be added?


              (AjaxSearch works fine though it is using Mootools still)
                Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                • 5527
                • 7 Posts
                I used somekind of jQuery tutorial as base for that script, and I was under the impression that the script adds and removes the classes to and from the li-elements. Those classes in turn gives the elements different z-index to display them on top of each other.
                I’m by no means jQuery expert, but it seems to work when the AjaxSearch is removed, as in the english site that is live:

                http://www.scancool.fi/home.html

                You’re rigth some browsers display the AjaxSearch properly despite the problem, but (surprise) windows IE doesn’t.

                Big thanks for your help so far!
                  • 18373 ☆ A M B ☆
                  • 3,141 Posts
                  Mmmm that’s odd.

                  At this moment, I have no idea what could be the problem...

                  I’ll see if I can dig into the ajaxsearch code tonight to check out the javascript parameters to see if they’re doing what the docs say they should.



                  As a temp fix/workaround: do you need the ajax approach for ajaxsearch? In my production sites I’d rather use non-ajax, but that’s just me.
                    Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                    Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                    • 5527
                    • 7 Posts
                    You are absolutely right, it doesn’t need the ajax functionality. To be honest I had no idea, that one can turn off the ajax in the AjaxSearch call! I suppose I should go home and study the parameters.

                    Many thanks!