For jQuery versions lower than 1.9 (see https://api.jquery.com/toggle-event):
$('#user_button').toggle(function () { $("#user_button").css({borderBottomLeftRadius: "0px"}); }, function () { $("#user_button").css({borderBottomLeftRadius: "5px"}); });
Using classes in this case would be better than setting the css directly though, look at the addClass and removeClass methods alecwh mentioned.
$('#user_button').toggle(function () { $("#user_button").addClass("active"); }, function () { $("#user_button").removeClass("active"); });
Related Posts:
- CSS reset – What exactly does it do?
- When to use margin vs padding in CSS [closed]
- SVG center horizontal and vertical line
- Can I change Bootstrap button color?
- Is it bad practice to comment out single lines of CSS with //?
- How to draw a half circle (border, outline only) [closed]
- CSS Circle with border
- How to change CSS using jQuery?
- Remove class using jQuery
- Toggle show/hide on click with jQuery
- Set parent style via child
- What is the proper way to display a logo with CSS?
- How can I scroll to an element using jQuery?
- Responsive font size in CSS
- How to make a vertical line in HTML
- CSS Font Border?
- How do I change the background color with JavaScript?
- Why em instead of px?
- Vertical Align Center in Bootstrap
- Button Center CSS
- Centering a background image, using CSS
- How to change the cursor into a hand when a user hovers over a list item?
- not:first-child selector
- Bootstrap Dropdown menu is not working
- Change Background color (css property) using Jquery
- CSS: center element within a element
- Set timeout for ajax (jQuery)
- How to generate a simple popup using jQuery
- what is a parse error and how do I fix it
- Use images like checkboxes
- Adding images to a Bootstrap Carousel with AJAX
- JavaScript Loading Screen while page loads
- Bootstrap NavBar with left, center or right aligned items
- Bootstrap Dropdown menu is not working
- Setting background-image using jQuery CSS property
- Bootstrap Dropdown menu is not working
- What do curly braces in JavaScript mean?
- How to make the overflow CSS property work with hidden as value
- Click button copy to clipboard
- How to make a sticky footer in react?
- How to push a footer to the bottom of page when content is short or missing?
- Linking to a pdf file with html
- Can I add background color only for padding?
- Change TD border color with HTML or CSS
- How to make html table vertically scrollable
- jQuery Toggle Text?
- jQuery.addClass not working
- Uncaught TypeError: Cannot read property ‘top’ of undefined
- Why adding version number to CSS file path?
- Hide text using css
- Equivalent of jQuery .hide() to set visibility: hidden
- Changing the width of Bootstrap popover
- TypeError: $(…).modal is not a function with bootstrap Modal
- Why is the jquery script not working?
- jQuery change class name
- TypeError: $(…).DataTable is not a function
- CSS background color not working
- Change text on hover, then return to the previous text
- How to make Bootstrap carousel slider use mobile left/right swipe
- bootstrap 3 navbar collapse button not working
- How to center image in carousel
- Bootstrap transparent navbar
- Bootstrap throws Uncaught Error: Bootstrap’s JavaScript requires jQuery
- Can Twitter Bootstrap alerts fade in as well as out?
- Play/pause HTML 5 video using JQuery
- slideToggle JQuery right to left
- 100% DIV width is not really 100%
- Refresh/reload the content in Div using jquery/ajax
- CSS 3 slide-in from left transition
- CSS selectors ul li a {…} vs ul > li > a {…}
- How to get height of div in px dimension
- Bootstrap scrollable panel
- jQueryUI dialog width
- How to display raw JSON data on a HTML page
- CSS checkbox input styling
- Is there a CSS selector for elements containing certain text?
- How to place two divs next to each other?
- jQuery not working when used with wordpress menu
- :first-child applying to all links [closed]
- Like/Dislike Bar not working when updating
- Possible jquery / library conflict in plugin usage
- Combining fancybox with multiple thumbnail plugin
- CSS conditional on custom field value
- How to update scrollbar when using Jetpack’s Inifnite Scroller?
- Hide input field when second input field is in focus
- change the icon of a custom post type in WordPress to use twitter boostrap
- Adding css and js to a blank page created with custom template
- Drop Down Category Menu Not Working
- Stylesheet won’t load even when linked
- Element works, but not on wordpress site [duplicate]
- controlling the showing and hiding of the website logo
- Theme using masonry layout script rendering overlaped images in Google Chrome [closed]
- How do I add Javascript and CSS files into WordPress?
- can’t make jQuery work (change image on time interval) [closed]
- This code works, but breaks the media uploader. How do I integrate it in a way that won’t?
- How to add an active state class to my info box
- Pull total post count for child category and parent if term ID
- How do I remove/hide embed excerpts from posts
- Injecting CSS into Iframe
- How to ajaxify all pages of my Wp Site