The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Transition on show/hide JQ

View previous topic View next topic Go down

Solved Transition on show/hide JQ

Post by Kami-sama on December 10th 2016, 1:25 am

Hello!

So have made a simple show/hide event with JQ. Example:

Code:
$(document).ready(function(){
    $(".mz2psl").hide();
    $(".mz3psl").hide();
    $(".mz1").click(function(){
        $(".mz1psl").show();
         $(".mz2psl").hide();
         $(".mz3psl").hide();
    });
});
$(document).ready(function(){
    $(".mz2").click(function(){
        $(".mz2psl").show();
         $(".mz1psl").hide();
         $(".mz3psl").hide();
    });
});
$(document).ready(function(){
    $(".mz3").click(function(){
        $(".mz3psl").show();
         $(".mz2psl").hide();
         $(".mz1psl").hide();
    });
});

Works perfectly! But I want it to have transition.
Is that even possible?
What's the best way to add it? To JQ or main code?
Tried to add it to CSS - no go.

Thank you in advance!
Forum version : #phpBB2
Position : Founder
Concerned browser(s) : Google Chrome
Who the problem concerns : Yourself


Last edited by Kami-sama on December 10th 2016, 11:50 am; edited 1 time in total
avatar
Kami-sama
Forumember

Female Posts : 317
Reputation : 7
Language : English, Russian, German, Lithuanian
Location : Lithuania

http://hogas.huhohi.com/

Back to top Go down

Solved Re: Transition on show/hide JQ

Post by Draxion on December 10th 2016, 1:53 am

You simply add CSS via JavaScript like this...

Code:
.css('transition', '500ms');

Or you can add the transition time in the parenthesis like this.
Code:
.show(500)

Means it would have a 500 milliseconds transition.
avatar
Draxion
Support Moderator
Support Moderator

Male Posts : 1846
Reputation : 230
Language : English
Location : USA

http://www.draxionsgameden.com/

Back to top Go down

Solved Re: Transition on show/hide JQ

Post by Kami-sama on December 10th 2016, 11:50 am

Oh, great! Thank you.
RESOLVED
avatar
Kami-sama
Forumember

Female Posts : 317
Reputation : 7
Language : English, Russian, German, Lithuanian
Location : Lithuania

http://hogas.huhohi.com/

Back to top Go down

Solved Re: Transition on show/hide JQ

Post by Nemo on December 10th 2016, 12:16 pm

Problem solved & topic archived.
Please read our forum rules: ESF General Rules
avatar
Nemo
Active Poster

Male Posts : 1201
Reputation : 119
Language : Greek, English, French

http://www.helpgr.forumgreek.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum