I defy anyone to make this simpler (and work as well)!!!!!

 

A true 3 state button

 

http://www.whatbird.com/wwwroot/3statebutton_6.html

 

(document).ready(function(){

                 

                $("#showPic").hover(function() {

                                $("#hover").removeClass("hidden");

                }, function() {

                                $("#hover").addClass("hidden");

                }); 

                

                $("#showPic").mousedown(function() {

                                $("#hover").addClass("hidden");

                                $("#normal").addClass("hidden");

                });           

                                

                $("#showPic").mouseup(function() {

                                $("#normal").removeClass("hidden");

                });           

 

});  

 

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Mitchell Waite
Sent: Wednesday, July 25, 2007 7:34 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Toggling an objects visiblty without show and hide

 

Ok here is the skinny (I think I am getting this down)

 

http://www.whatbird.com/wwwroot/3statebutton_3.html (uses layers)

 

$(document).ready(function(){ 

                $("#showPic").hover(function() {

                                $("#normal").addClass("hidden");

                }, function() {

                                $("#normal").removeClass("hidden");

                }); 

});  

 

The hover button is under the normal button layer so all we have to do is
hide and unhide the normal button.

 

http://www.whatbird.com/wwwroot/3statebutton_4.html (no layers)

 

$(document).ready(function(){ 

                $("#showPic").hover(function() {

                                $("#hover").removeClass("hidden");

                                $("#normal").addClass("hidden");

                }, function() {

                                $("#hover").addClass("hidden");

                                $("#normal").removeClass("hidden");

                }); 

});  

 

Since both bottons are in the same div they can't both be on at the same ,
or you would see them side by side. So you hide and unhide both buttons.
More processing but less divs.

 

Mitch

 

 

Reply via email to