You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

How to add fade effect to tabs/panes? Created Jun 12, 2009

This thread is solved

Views: 6247     Replies: 6     Last reply Apr 15, 2010  
You must login first before you can use this feature

paradise

Posts: 4

Registered:
Jun 12, 2009

How to add fade effect to tabs/panes?

Posted: Jun 12, 2009

First thank you for such a wonderful resource!

My skills with javascript are really poor but I've been attempting to add a fade in/out effect to the panes when one of the tabs are selected. It's not going well and I was hoping you guys could tell me what I'm doing wrong.

I had started out with the original script and modified it to this, which doesn't work at all:

<script>
$(function() {
$("ul.tabs").tabs("div.panes > div","div.panes", {
effect: "fade"
});
});
</script>

I've linked to the jquery.tools.min.js and the tools.tabs.js.

paradise

Posts: 4

Registered:
Jun 12, 2009

» How to add fade effect to tabs/panes?

Posted: Jun 12, 2009

Reply to: How to add fade effect to tabs/panes?, from paradise
aha! Got it figured out. Duh.

$(function() {
$("ul.tabs").tabs("div.panes > div",{current: 'active',effect: "fade" });

});

Does anyone know where I can control the speed of the fade?

Tero
Author of jQuery Tools and this website + JavaScript developer of Flowplayer.

Posts: 1867

Registered:
Nov 16, 2007

» » How to add fade effect to tabs/panes?

Posted: Jun 12, 2009

Reply to: » How to add fade effect to tabs/panes?, from paradise
yes. I have now added a new configuration option: fadeInSpeed.

paradise

Posts: 4

Registered:
Jun 12, 2009

» » » How to add fade effect to tabs/panes?

Posted: Jun 12, 2009

Reply to: » » How to add fade effect to tabs/panes?, from tipiirai
So....like this?

$(function() {
$("ul.tabs").tabs("div.panes > div",{current: 'active',effect: "fade", fadeInSpeed: "slow" });

Do I use fast, normal, slow? Or is there a way to control it in seconds?

paradise

Posts: 4

Registered:
Jun 12, 2009

» » » » How to add fade effect to tabs/panes?

Posted: Jun 12, 2009

Reply to: » » » How to add fade effect to tabs/panes?, from paradise
I'm sorry, I have another question! I'm trying to show an overlay when the mouse is hovered over a link, but I want the overlay to disappear when the mouse is removed. Sort of like the tooltip but I'm using the tabs function for it because I found it difficult to make the overlay appear where I wanted. It works great but I don't know how to tell it to hide the overlay when the mouse is moved away from the link.

$(function() {
$("ul.readmore").tabs("div.overlay > div",{current: 'active',event: "mouseover",effect: "fade", fadeInSpeed: "slow"});

});

<ul class="readmore">
  • read more...

  • <div class="overlay">
    <div></div>
    <div><img src="i/overlay.png"></div>
    </div>

    I threw an empty div in there because I don't want the overlay shown when the page loads (probably not the best way to do that huh?)

    Thanks for all your help!

    lakey

    Posts: 2

    Registered:
    Apr 15, 2010

    » » » » How to add fade effect to tabs/panes?

    Posted: Apr 15, 2010

    Reply to: » » » How to add fade effect to tabs/panes?, from paradise
    Thanks for this post paradise, worked as i wanted it.

    CrazySerb

    Posts: 1

    Registered:
    Aug 10, 2009

    » » How to add fade effect to tabs/panes?

    Posted: Aug 10, 2009

    Reply to: » How to add fade effect to tabs/panes?, from paradise
    How/where would I add it in this code though (I am trying without luck here):

    
    $(function() {
    	$("ul.tabs").tabs("div.panels > div", function(i) {
    		// get the panel to be opened
    		var pane = this.getPanes().eq(i);
    		// if it is empty ..
    		if (pane.is(":empty")) {
    			// load it with a page specified in the tab's href attribute
    			pane.load(this.getTabs().eq(i).attr("href"));
    		}
    	});
    });