I have 2 sections called .about-us and .price-list. With 2 buttons that activates them .prices and .about-us-btn. The 2 sections both are hidden by default with JQuery and have a .slideToggle event for each, if one is visible though, it'll slide up if I click the other button for it.
Now I figured, instead of sliding back up, they can do a fadeOut event. It works, but only if the .price-list is visible first, then click on .prices. (both sections are in the same position, but only one are visible when I click a button). If .about-us is visible first, then if I click on the .prices button, the .about-us will slideUp instead of fading out.
Will anyways. Hope you understand and can help me out!. Heres my JQuery Code:
$(document).ready(function(e){
// Price-list & About-us are hidden by Javascript
$("aside.price-list, aside.about-us").hide();
// Create a slide for the price-list
$("button.prices").click(function(){
$("aside.about-us").fadeOut(300);
$("aside.price-list").slideToggle(300);
});
// Create a slide for the about-us
$("button.about-btn").click(function(e){
$("aside.about-us").slideToggle(300);
$("aside.price-list").fadeOut(300);
});
});