We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39559
    • 34 Posts
    I just tested on a base install on another modx test site, and it is working properly. like i said, this is a problem with my current setup. i would hate to have to mow it down and start over for this one little issue, but i will if i have to
      • 39559
      • 34 Posts
      so, it looks like the problem was stemming from this:
      http://rtfm.modx.com/display/revolution20/Named+Anchor

      at some point over the last several days, during troubleshooting this issue, i implemented that (this is why you dont drink and work)

      the REASON I implemented that has come back to me now....because when i click on the tab, it will load the tab, then immediately kick me back to the start page. (renders as http://domain.com/#contactForm instead of http://domain.com/subpage#contactForm (when it renders this, it acts the same as having the named anchor on page render...)

      again, kids, dont drink and work on MODx!

      NOW I just need to figure out the reload problem. when i add
       [[~[[*id]]]]
      to the class it refuses to work, (same problem as mentioned earlier, which is why i had that namedanchor thing to begin with)


      vicious ugly cycle
        • 39559
        • 34 Posts
        Foundation by ZURB ‏@foundationzurb
        We just pushed 3.2.2. This patch fixes an issue that prevented tabs from working in some cases.

        From their Twitter feed yesterday.

        My tabs are now working with no change on my end aside from updating....

        I knew I wasn't crazy...
          • 9674
          • 170 Posts
          Hi,

          For those looking for the solution, first use the following code in your page :
          					<dl class="tabs mobile">
          						<dd class="active"><a href="[[~[[*id]]]]#simple1">Tab1</a></dd>
          						<dd><a href="[[~[[*id]]]]#simple2">Tab2</a></dd>
          						<dd><a href="[[~[[*id]]]]#simple3">Tab3</a></dd>
          					</dl>
          
          					<ul class="tabs-content">Contenu de Tab1</li>
          						<li id="simple2Tab">Contenu de Tab2</li>
          						<li id="simple3Tab">Contenu de Tab3</li>
          					</ul>

          Then use this code for jquery.foundation.tabs.js

          ;(function ($, window, document, undefined) {
            'use strict';
          
            var settings = {
                  callback: $.noop,
                  deep_linking: true,
                  init: false
                },
          
                methods = {
                  init : function (options) {
                    settings = $.extend({}, settings, options);
          
                    return this.each(function () {
                      if (!settings.init) methods.events();
          
                      if (settings.deep_linking) methods.from_hash();
                    });
                  },
          
                  events : function () {
                    $(document).on('click.fndtn', '.tabs a', function (e) {
                      methods.set_tab($(this).parent('dd, li'), e);
                    });
          
                    settings.init = true;
                  },
          
                  set_tab : function ($tab, e) {
          
                    var $activeTab = $tab.closest('dl, ul').find('.active'),
                        href = $tab.children('a').attr("href"),
                        target = href.substring(href.indexOf('#')),
                        base = $('base'),
                        hasHash = /^#/.test(target),
                        $content = $(target + 'Tab');
          
                    if (hasHash && $content.length > 0) {
                      // Show tab content
                      if (e && !settings.deep_linking) e.preventDefault();
                      if (e && base.length > 0 && settings.deep_linking) {
                        window.location.hash = target;
                        e.preventDefault();
                      }
                      $content.closest('.tabs-content').children('li').removeClass('active').hide();
                      $content.css('display', 'block').addClass('active');
                    }
          
                    // Make active tab
                    $activeTab.removeClass('active');
                    $tab.addClass('active');
          
                    settings.callback();
                  },
          
                  from_hash : function () {
                    var hash = window.location.hash,
                        $tab = $('a[href="' + hash + '"]');
          
                    $tab.trigger('click.fndtn');
                  }
                }
          
            $.fn.foundationTabs = function (method) {
              if (methods[method]) {
                return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
              } else if (typeof method === 'object' || !method) {
                return methods.init.apply(this, arguments);
              } else {
                $.error('Method ' + method + ' does not exist on jQuery.foundationTabs');
              }
            };
          }(jQuery, this, this.document));
          


          It should fix the problem for foundation 3.2.whatever ....

          Long live to modx !

          Philippe