The .css()
function doesn’t queue behind running animations, it’s instantaneous.
To match the behaviour that you’re after, you’d need to do the following:
$(document).ready(function() { $("button").mouseover(function() { var p = $("p#44.test").css("background-color", "yellow"); p.hide(1500).show(1500); p.queue(function() { p.css("background-color", "red"); }); }); });
The .queue()
function waits for running animations to run out and then fires whatever’s in the supplied function.
Related Posts:
- jQuery $(this) keyword
- JavaScript error (Uncaught SyntaxError: Unexpected end of input)
- Disable button in jQuery
- JavaScript error (Uncaught SyntaxError: Unexpected end of input)
- $.ajax – dataType
- How can I get the ID of an element using jQuery?
- How do you select a particular option in a SELECT element in jQuery?
- Order of $(document).load() and $(document).ready() when deferring loading js
- TypeError: $.ajax(…) is not a function?
- Rotate image with javascript
- What does “async: false” do in jQuery.ajax()?
- How do I select multiple fields in jq?
- How to make a simple image upload using Javascript/HTML
- jQuery: outer html() [duplicate]
- Play/pause HTML 5 video using JQuery
- jQuery posting JSON
- browser.msie error after update to jQuery 1.9.1
- Javascript – ERR_CONTENT_LENGTH_MISMATCH
- $(document).ready(function() is not working
- Using OR operator in a jQuery if statement
- Using jQuery to delete data stored in wp_options
- Making $ globally accessible with jQuery.noConflict()
- Color Picker (iris) in widget – refresh when edited in Customizer
- Ajax call does not activate callback function
- Add `datetimepicker` to form
- How to reload a select box of posts dynamically?
- How to pass both action and formdata in wordpress ajax?
- Basic WordPress AJAX Call
- wp_enqueue_script won’t load in header?
- Script dependencies for post.js
- jQuery Hoverintent plugin in TwentyEleven Menu [closed]
- Cannot access elements of json object
- Script won’t execute in the media manager
- Basic ajax call in WordPress
- jQuery Validate wp_editor
- Get specific image size for small viewport width
- Using jQuery to retrieve customizer value
- How do I setup nested repeatable option fields?
- What are best practices for including jquery plugins
- wp_enqueue_scripts hook is not being called
- WordPress ajax function parameter value not being passed
- Is it safe to include a javascript file in a template’s php file?
- How to enable the content editor as a droppable target with jQuery-ui?
- Enqueue Google CDN jQuery in Footer
- ‘jQuery is not defined Error’ appearing in load-scripts.php
- Masonry and Jetpack Infinite Scroll – overlap issue
- Dealing with a library that depends on jQuery
- Override theme style with other CSS on a specific page
- Ajaxify calendar
- How can I load jquery library into my dashboard widget?
- Accessing user Meta data via REST and backbone
- Problem with tables (huge data) on Word-press site
- start.js:45TypeError: Not enough arguments on Safari [closed]
- Passing a varible from jQuery to PHP
- Vanderlee jQuery color picker and WordPress Errors
- Dropdown filtering extremely slow
- Gutenberg – Title field required
- Adding a slide toggle on WordPress
- I have an old version of jQuery showing up. How do I figure out where it is coming from?
- How to change background image from WordPress Gallery
- Search input area autogrow – how?
- Populating shortcode values dynamically in theme template
- WordPress Rotating Background Images
- Trying to Load jQuery
- How to retrieve WP_Object that is inside an array of another array
- Jquery contact form to send mail to admin [closed]
- WP Customizer: Save a control state
- Can user meta be shown or hidden depending on user logged in status?
- Screen Options JavaScript Code
- Is there some jQuery conflict here?
- Getting jQuery AJAX to work in WordPress (getting -1)
- Theme has superfish – how to add supersubs?
- jQuery Drill Down iPod Menu FOUC and Selecting Current page
- Absolute path to stylesheet_dir/images/my_img.jpg does not work?
- Which hook to use when adding ajax to viewer-facing side?
- jquery bookmark links
- WordPress and Modal Popup – how to make the already loaded javascript assets available in modal?
- Theme style overrides the plugin style
- Storing current page WP list table HTML data into a PHP variable
- jQuery .html rendering [closed]
- Special Characters and Spaces are not transferred correctly via AJAX call.
- How to manipulate elements on the Insert Media Attachment settings popup
- Site images are fixed in front of my site content [closed]
- jQuery not working for media uploader
- Adding text to links when not on the homepage
- how to remove/exclude html coding from json file while export?
- WordPress and Raty.js
- search in jquery mobile returns blank page
- Uncaught TypeError: undefined is not a function (shortcode-box)
- Running javascript in a child theme. Works in jsfiddle
- How to block action if post is “dirty”?
- $ not defined using jQuery in WordPress
- Group posts by weekly or monthly
- adding the full image path to a wordpress javascript file
- Ensure an external javascript file called from plugin is loaded after jquery is called
- jQuery not working for tabs shortcode [closed]
- Why my vertical tab js code is refreshing the page continuously? [closed]
- bootstrap-slider.js by seiyria not working in wordpress
- jQuery cycle thumbnails?
- Enqueued jQuery not working