javascript - JQuery Button enable and disable CSS functionality upon Clicks -



javascript - JQuery Button enable and disable CSS functionality upon Clicks -

i'm trying figure out way create leaderboardbutton upon clicking alter div have bottom border radius. (it that). how can upon clicking again, have reset having no border radius. essentially. click once, border radius. click again, no border radius. click again, border radius come back. click 1 time again , border radius leave. etc. etc. , on/off of css radius functions.

here's code below.

$('#left-container').click(function(){ $('#leaderboard').slidetoggle( "slow", function(){ $('#leadeboardbutton').css({bordertopleftradius: 10, bordertoprightradius: 0, borderbottomleftradius: 10, borderbottomrightradius: 10, webkitbordertopleftradius: 10, webkitbordertoprightradius: 0, webkitborderbottomleftradius: 10, webkitborderbottomrightradius: 10, mozborderradius: 10 }), function(){ $('#leadeboardbutton').css({bordertopleftradius: 10, bordertoprightradius: 0, borderbottomleftradius: 0, borderbottomrightradius: 0, webkitbordertopleftradius: 10, webkitbordertoprightradius: 0, webkitborderbottomleftradius: 0, webkitborderbottomrightradius: 0, mozborderradius: 0 }); } });

i move border styling css. create sure have 1 class border (we'll phone call border). javascript much simpler.

$("#leftcontainer").click(function() { if ($("#leftcontainer").hasclass("border")) { $("#leftcontainer").removeclass("border"); } else { $("#leftcontainer").addclass("border"); } });

here's jsfiddle: http://jsfiddle.net/rrxcu/2/

javascript jquery css css3

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -