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
- Is it bad practice to comment out single lines of CSS with //?
- How to draw a half circle (border, outline only) [closed]
- Set parent style via child
- How do I change the background color with JavaScript?
- Vertical Align Center in Bootstrap
- Centering a background image, using CSS
- not:first-child selector
- CSS: center element within a element
- what is a parse error and how do I fix it
- Use images like checkboxes
- Adding images to a Bootstrap Carousel with AJAX
- Bootstrap NavBar with left, center or right aligned items
- Setting background-image using jQuery CSS property
- How to push a footer to the bottom of page when content is short or missing?
- Linking to a pdf file with html
- jQuery Toggle Text?
- Uncaught TypeError: Cannot read property ‘top’ of undefined
- Hide text using css
- Equivalent of jQuery .hide() to set visibility: hidden
- 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
- How to make Bootstrap carousel slider use mobile left/right swipe
- How to center image in carousel
- Bootstrap transparent navbar
- Bootstrap throws Uncaught Error: Bootstrap’s JavaScript requires jQuery
- Play/pause HTML 5 video using JQuery
- slideToggle JQuery right to left
- Refresh/reload the content in Div using jquery/ajax
- CSS selectors ul li a {…} vs ul > li > a {…}
- jQueryUI dialog width
- CSS checkbox input styling
- Background color in input and text fields
- CSS3 background image transition
- How to import Google Web Font in CSS file?
- How do I remove a box-shadow effect from an element when another element is hovered?
- How to change cursor from pointer to finger using jQuery?
- How can I remove a style added with .css() function?
- How to make div background color transparent in CSS
- How to set “style=display:none;” using jQuery’s attr method?
- Internet Explorer 8 issues with WordPress 3.8
- Internet Explorer 8 issues with WordPress 3.8
- Hide/show content starting in the middle of a paragraph
- Automatically decrease font size for long words
- Stylizing external SVG files with jQuery and CSS
- wp_enqueue_style built in styles
- Gravity list field override and adding javascript [closed]
- Show post in slider
- Slider loading issue
- Add a class to posts in increments of 2
- Override theme style with other CSS on a specific page
- custom changes removed after plugin update
- How to tie dark mode with prefers-color-scheme webkit? [closed]
- How to make an WordPress element sticky? [closed]
- Accordion scrolls page too low after clicking on the title [closed]
- WordPress Multiple Navigation bars
- show/hide div with simple jQuery script [closed]
- Change CSS for logged in users
- Automatically set all tags to have a height of 0 if there is no content inside the tag [closed]
- Google yolo one tab signup plugin avilable in wordpress? [closed]
- What is the propre way to include jQuery UI Datepicker’s CSS in plugin?
- Adding a Calculator to a WordPress Page
- How to add a dvi tag to a shortcode then change a generated text using jQuery
- JQuery undefined and Stylesheet loads in bottom along with js files
- Superfish Menu Not Loading
- Calling external Libraries in WordPress
- Is it OK combined wp-include js, jquery, css? [closed]
- The Events Calendar Plugin – List View Background Colour Issue [closed]
- displaying the categories post
- How to Remove Active css from woocommerce variation?
- WordPress Sudden Loss of All CSS And Tons of JQuery Errors
- Overriding inline !important CSS with Javscript code snippet with media query
- How to make jquery slider to start afresh [closed]
- Unable to use Datepicker in a table when inserting a row
- Getting click on item to open closest relevant element (popup) with jQuery
- jQuery for Fade Preload Causes My Site Favicon to Disappear from Tab of Browser
- Styling a specific post after hovering over it
- jQuery function not working in WordPress but works in jsfiddle
- How can I add the Post ID to Class Name in Jquery?
- 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
- 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
- Stylesheet won’t load even when linked
- Element works, but not on wordpress site [duplicate]
- Theme using masonry layout script rendering overlaped images in Google Chrome [closed]
- How do I add Javascript and CSS files into WordPress?
- 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