Using jQuery UI to create a bouncing effect on a CSS sprite image

Want to give your social icons a bounce effect using jQuery UI Bounce? I'm following a template and some jQuery documentation, but having trouble getting it right. It seems like the sprite image for the icons might be causing the issue.

Can someone have a look and assist me?

The necessary jQuery & jQuery UI scripts in the header:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"</script>

The CSS styles being used:

#footer {
  background:#1c1c1c;
  padding:40px 0 20px;
  border-top:4px solid #fff;
}
  
#footer a {color:#fff;}
#footer a:hover {color:#d5d5d5;}

#footer .social-icons {float:right;}
#footer .copyright img {float:left; margin-right:20px;}

/* more CSS styles here */

The HTML structure where the icons are placed:

<div id="footer">
        <div class="row">
            <div class="span12">
                <div class="bottom fixclear">
                    <ul class="social-icons fixclear">
                        <li class="title">SOCIAL LOVE</li>
                        <li class="social-twitter">
                            <a href="#">Twitter</a>
                        </li>
                    </ul>

And here is the script that should make them bounce:

<style type="text/css">
footer li.social-twitter {
width: 32px;
height: 32px;
}
</style>
<script>
$(document).ready(function() {

$("div").mouseenter(function () {
$(this).effect("bounce", { times:3 }, 270);
});

});
</script>

Answer №1

To achieve this visual effect, consider using @keyframes animation.

@keyframes bounce {
0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
}
40% {
    transform: translateY(-30px);
}
60% {
    transform: translateY(-15px);
}
}

For a convenient solution, take a look at Animate.css, an animation library developed by Dan Eden specifically designed for animations like the one you are working on.

Answer №2

Experience a dynamic bouncing animation using CSS3 alone. Utilize the @keyframes and animation properties for this effect. Take a look at the live demo on JSFiddle. Witness each image bounce upon hovering over it.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

the navigation process in $state was not successful

In order to navigate from page A to B, I included the following code in my page A (history.html) view: <a href="#/history/{{data.id}}"> <li class="item"> {{data.items}} </li> </a> In my app.js file, I set the state as ...

Performing an AngularJS $http POST request with a combination of JSON parameter and query string

I'm currently trying to write an AJAX call using Angular's $http object in order to send a post request with JSON in the body and a query string appended to the URL. Despite going through the documentation for $http, looking for solutions on SO, ...

Styling with CSS: Utilizing the Float Left Property to Anchor Elements

Currently, I have implemented an anchor element that utilizes a CSS class to replace the text with an image. Despite its unusual nature, the end result is mostly satisfactory. .toolLink a { overflow:hidden; } .toolEdit { float:left; ba ...

Are none of the page links clickable?

Currently, I am in the process of creating a portfolio website. This is my first attempt at coding HTML and CSS from scratch without the aid of a layout template. I've encountered an issue that has me stumped - the links within the container are not ...

On page load, refresh the content of the div based on the selected radio button values

My goal is to automatically collect the values of checked radio buttons when the page loads, rather than waiting for a user interaction like clicking a radio button. Below is the JavaScript code I am using: $(function () { updateDivResult(); $(&a ...

Using jQuery to refresh a div element

I am struggling with updating the "right" div in my jsp page using the script below. Despite being contained in a single file, the update does not seem to work. Any assistance is appreciated. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//E ...

Transferring information from a Jade file to a Node.js server

I'm currently working on creating a data object within my Jade view page that will be used in my server-side JS. The data object involves dynamic HTML generation that inserts input boxes based on user input. function addDetail() { var det ...

"Unlocking the power of AngularJS translate: A step-by-step

I'm seeking answers to two questions. 1) How can I utilize angularjs translate with ng-repeat? Although my Json file works fine, the text does not display when using ng-repeat. Here is a snippet from my json: "rules":{ "points":[ {"t ...

Creating users or custom roles in MongoDB on a NodeJS server is not currently possible

I have been attempting to directly create users on my database through our Express server, utilizing MongoDB 3.4 for the backend. Below is the current code snippet from the server: const express = require('express'); const bodyParser = require(& ...

What is the best way to obtain a date in the format of yyyy_mm_dd from a datepicker tool?

I am working with 2 datepickers that have similar structures, but different names. The first one has the id "fecha_1_1" and the second one has the id "fecha_1_2". <div class="col-sm-3"> <p>Desde</p> <div class="f ...

Receiving error message "[object Object]" while working with JavaScript

My current challenge involves adding an item to the shopping cart through a button click event that sends necessary data to a database table storing cart items. The issue arises with the item name, as I am encountering an error displaying [object Object] ...

Tips for storing form information using Flask and Vue.js

Currently, I am tackling a straightforward assignment that requires me to utilize tools with which I am not very familiar. In this task, I need to find a way to save the form data (preferably to a text file as the optimal solution) or at least serialize it ...

Retrieving the previous value using JQuery's onChange event

Is there a way to retrieve the initial quantity value before it is changed with the onChange function in this code snippet? I'm encountering issues with the CSS while using this setup for an input box. You can view the problematic CSS here. Updating ...

Transform inline styles in React to CSS declarations

Is there a tool available that can convert React inline style descriptions into CSS rules? For example: { minHeight: 200, position: 'relative', flexGrow: 1, flexShrink: 1, display: 'flex', flexDirection: ' ...

Stopping a function when another function is invoked in JavaScript

I've been immersing myself in the search for a way to halt one function if another is called or triggered in JavaScript. Initially, I believed it to be unattainable, but I'm open to having my perspective changed. My current focus lies within a t ...

Error in Jade compilation: 'Unforeseen Symbol "period"'

Struggling to put together a basic Jade template: p hello Below is the associated JavaScript code (JQuery has already been imported): var jade = require('jade'); $('#container').html(jade.compile('../jade/gen.jade')); An ...

How can I create a CSS animation for a box element?

During my current project, I have the task of creating a box that will display an animation within 2 seconds and move from one corner to another. What is the most straightforward way to achieve this? ...

How can I make a single <input> element that can handle both files and urls simultaneously?

Is there a way to enable my users to import both local and remote files using just one input field? A possible solution, inspired by Stackoverflow, is to implement tabs: Another approach could be using radio buttons like this: <style> .display ...

A guide on accessing checkbox values using jQuery

What is the best way to utilize jQuery in order to retrieve the values of checked checkboxes and instantly input them into a textarea? For example: <html> <head> </head> <body> <div id="c_b"> <input type= ...

Unable to access account due to login function malfunctioning

I've created a login button with this function code, but I keep getting the error message "Login unsuccessful, Please try again..." Thank you in advance. I wasn't entirely sure what you needed, so I included most of the code because I've b ...