Hello,

I just started using jquery and have been really impressed with it so
far.  I have been able to get it to do everything that I want with the
exception of getting having two different buttons toggle the divs.

I want them to be independently able to be used but if one is active
and the button is clicked, then it will become inactive.

This is the code that I have so far.  It changes the classes of the
divs on click and it works very well.  This is that last this on my
list of to do's for this project.

Any help would be greatly appreciated.



<a href="#" id="themeToggle" class="themeclassChanger">Change Theme</
a>|<a href="#" id="searchToggle" class="searchclassChanger">Search</a>


                                $("#themeToggle").click(function () {
                                        var $this = $(this);
                                        if( 
$this.is('.themeclasschangerActive') ){
                                                        
$("#themeChange").toggle("slide", { direction: "up" },
500);  // This moves the entire div
                                                        
$(this).removeClass("themeclasschangerActive");
                                                        
$(this).addClass("themeclassChanger");
                        }
                        else {
                                                        
$("#themeChange").toggle("slide", { direction: "up" },
500);  // This moves the entire div
                                                        
$(this).removeClass("themeclassChanger");
                                                        
$(this).addClass("themeclasschangerActive");
                        }
                        return false;
                                });

                                $("#searchToggle").click(function () {
                                        var $this = $(this);
                                        if( 
$this.is('.searchclasschangerActive') ){
                                                        
$("#hiddenSearch").toggle("slide", { direction: "up" },
500);  // This moves the entire div
                                                        
$(this).removeClass("searchclasschangerActive");
                                                        
$(this).addClass("searchclassChanger");
                        }
                        else {
                                                        
$("#hiddenSearch").toggle("slide", { direction: "up" },
500);  // This moves the entire div
                                                        
$(this).removeClass("searchclassChanger");
                                                        
$(this).addClass("searchclasschangerActive");
                        }
                        return false;
                                });

Reply via email to