I am wondering if you might ever include some kind of jquery animation effects when switching quicktabs -- like a slider or a fade in/out?

Or is there a way to add this kind of functionality to quicktabs through another module?

I had a hard time deciding between using the Slider module and using Quicktabs for my main content area, but went with Quicktabs because of how easy it is... but I would love a way to animate between tabs...

I would buy someone a beer (or more), if they could help me get this done...

thank you

Comments

pasqualle’s picture

Status: Active » Closed (duplicate)
pasqualle’s picture

If you are eager to get such functionality, then

in quicktabs.js change

tab.tabpage.show();

to

tab.tabpage.fadeIn("slow");
tchopshop’s picture

wow! thank you! how can i buy you that beer?

RikiB’s picture

I was hoping this would work and got all excited. However I think the code has been changed and I not longer see where to change this. Could you be kind to update this idea for the current code? Thanks!!!

drupaledmonk’s picture

yes me too!! I have two tabs with rotor items in them and the text gets overlapped for a second when I change between tabs and then corrects itself. I thought this transition effect would solve my problem. So if anyone can help me out as to where the transition occurs. I think it takes place somewhere around line 150, but I'm not sure how to get it work for me.

ram4nd’s picture

Drupal.quicktabs.clickHandler = function(event) {
  var tab = event.data.tab;
  var element = this;
  // Set clicked tab to active.
  $(this).parents('li').siblings().removeClass('active');
  $(this).parents('li').addClass('active');

  // Hide all tabpages.
  tab.container.children().fadeOut(750);
  
  if (!tab.tabpage.hasClass("quicktabs-tabpage")) {
    tab = new Drupal.quicktabs.tab(element);
  }

  tab.tabpage.fadeIn(1000);

  return false;
}

You also have to use absolute position so the content of the tabs would be on top of each other. It still is a hack. Would be cool if it would be implemented as feature.

theohawse’s picture

Title: animation? » Provide simple default transitions so we don't have to hack core
Version: 6.x-2.0-rc3 » 6.x-3.x-dev
Status: Closed (duplicate) » Needs review
StatusFileSize
new924 bytes

this worked for me, but there were a few issues using both fade in and fade out without absolute positioning:
-js loads too slow and causes the tabs to freakout on pageloads and while hiding.
the following css helped fix the messy transitions:

html.js .quicktabs_tabpage{display:none;}
.quicktabs_main .quicktabs-hide{display:none!important;}

-the first rule hides the content until js loads and then adds the inline style="display:block"
-second rule hides the overflowing tabpages (mid-transition) that stretch the page.

attached is a patch (including js fades), please review.

theohawse’s picture

StatusFileSize
new924 bytes

Whoops, tested with ajax style and the first css line wasn't being overwritten by js.

should be: html.js .quicktabs_tabpage{display:block;}

attached is fixed up patch

theohawse’s picture

StatusFileSize
new673 bytes

alright, this has to be the one, fading-out just has too many theme related bugs to handle for me. simple fadeout does it, with one css fix.
subtle, but definitely an improvement over having no effect at all.

avpaderno’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

I am closing this issue, since it's for a Drupal version no longer supported.