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]
- Is it bad practice to comment out single lines of CSS with //?
- How to draw a half circle (border, outline only) [closed]
- Toggle show/hide on click with jQuery
- 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
- Change Background color (css property) using Jquery
- 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
- JavaScript Loading Screen while page loads
- 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
- How to make html table vertically scrollable
- jQuery Toggle Text?
- jQuery.addClass not working
- Why adding version number to CSS file path?
- Hide text using css
- Equivalent of jQuery .hide() to set visibility: hidden
- Why is the jquery script not working?
- jQuery change class name
- TypeError: $(…).DataTable is not a function
- 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
- jQueryUI dialog width
- Is there a CSS selector for elements containing certain text?
- How to place two divs next to each other?
- “Uncaught TypeError: a.indexOf is not a function” error when opening new foundation project
- How to import Google Web Font in CSS file?
- CSS Equivalent of the “if” statement
- How do I remove a box-shadow effect from an element when another element is hovered?
- Slide right to left?
- How to make div background color transparent in CSS
- How to set “style=display:none;” using jQuery’s attr method?
- wordpress menu dropdown item not showing after first dropdown
- 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
- Best approach for loading a sidebar Only if the screen max-width is >900px?
- 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
- How can I make this custom menu work?
- Remove WordPress scripts
- How to tie dark mode with prefers-color-scheme webkit? [closed]
- How to hide CSS by default and show on button press
- How to make an WordPress element sticky? [closed]
- WordPress Multiple Navigation bars
- show/hide div with simple jQuery script [closed]
- Using page-id-{ID} from body_class() in local dev, versus live staging
- 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]
- Superfish Menu Not Loading
- Getting a ‘slide down’ js panel implemented within WP
- Problem Implementing parallax in header of bp-default theme
- This code works, but the way I integrated it is breaking the media uploader. How can I integrate it properly?
- Drop Down menu expanded by default (on front page) [closed]
- Is it OK combined wp-include js, jquery, css? [closed]
- The Events Calendar Plugin – List View Background Colour Issue [closed]
- displaying the categories post
- jQuery Drill Down iPod Menu FOUC and Selecting Current page
- Add other class content with reference class value
- How to make jquery slider to start afresh [closed]
- Why can’t blocks be hidden with jQuery?
- Bootstrap Integtration
- Change the version of default style.css in wordpress
- How Do I change Markup of a link in WordPress
- jQuery for Fade Preload Causes My Site Favicon to Disappear from Tab of Browser
- Lightbox scroll page down on iPhone
- Site images are fixed in front of my site content [closed]
- WP Media Uploader modal conflicts with Bootstrap modal
- jQuery not working when used with wordpress menu
- 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
- 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
- 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