Tips for animating individual corners of the border radius upon hovering in and out (Firefox)

I have successfully implemented animation for Webkit browsers, but I'm facing some challenges with Firefox. The code I have only seems to animate the top-left corner while the rest snaps into place.

Below is the snippet of code:

$('img').hover(function(){
        $(this).animate({MozBorderRadius: '50px 50px 0px 0px'}, 900);
    },function(){
        $(this).animate({MozBorderRadius: '25px 25px 0px 0px'}, 900);
});

Answer №1

It seems that the issue lies in using a shortcut for all four corners in one definition when they need to be defined separately.

Here's a suggestion:

$('img').hover(function(){
    $(this).animate({
        "MozBorderRadiusTopleft": '50px',
        "MozBorderRadiusTopright": '50px'
    }, 900);
},function(){
    $(this).animate({
        "MozBorderRadiusTopleft": '25px',
        "MozBorderRadiusTopright": '25px'
    }, 900);
});

Answer №2

Hey there! MozBorderRadius is a bit of a mystery to me - could it be outdated? You might want to consider switching to -moz-border-radius for better results.

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

prevent a text field from inheriting the Jquery.ui CSS styling

I am experiencing a minor issue where my text field is inheriting the CSS of the jquery.ui. This textfield is located inside a Jquery.ui tabs script, which applies its CSS by adding a class of the jquery ui tabs. How can I prevent this from happening and e ...

Troubleshoot: Bootstrap Tooltips visible in DOM but not functioning

I am currently attempting to utilize bootstrap's tooltip feature on a dynamically created set of divs. When hovering, I can see in Chrome's inspector that the div itself is being modified correctly (title value is passed to data-original-title) a ...

Utilizing jQuery tabs to dynamically load content via URL links

Here is the code for my script: function() { $( "#tabs" ).tabs(); }); function LoadContent(link, div_id, param1, param2, param3) { $.ajax(link, { data: { par1: param1, par2: param2, par3: param3 }, type: "post", success: function(data) { ...

What is the best way to position this dropdown menu component directly under a specific section of my navbar in a React application?

As I delved into creating a basic navbar and dropdown menu in React, I encountered a puzzling issue. I envisioned a section within the nav that would trigger a dropdown menu right below it upon hovering over it. Attempting to replicate this functionality b ...

Highlighting table column when input is selected

I am working with a table where each <td> contains an <input>. My goal is to apply the class .highlighted to all the column <td>s when an <input> is being focused on. Additionally, I want to remove this class from all other columns ...

Exploring Django: Extracting attribute values from HTML input elements in views

Here is the HTML input I am working with: <input type="text" name="download_number" class="corecharinputwidget form-control" size="10" maxlength="30" style="font-size: smaller;margin-top: 30px;" ...

I am looking to dynamically alter the CSS background URL using JavaScript

Currently, I am looking to update the background image url using JavaScript. Most tutorials I've come across involve having the image downloaded on the desktop and then providing its path. However, in my scenario, the user will input an image link whi ...

Place CSS elements in relation to the underlying element

This is an example of my HTML structure: <nav id="menu"> <ul> <li><a href="">Products</a></li> <li><a href="">Offers</a></li> <li><a href="">References</a>& ...

Ensuring the state is correctly updated upon form submission in React JS

Is there a way to reset the state to blank after submitting the form? I attempted to clear it again upon submission, but the state still retains its value. How can I revert the state back to its initial state after finishing the submission? state = { ...

Displaying Chinese HTML files in jQuery tabs

On my page, I implemented the jQuery tabs widget with ajax mode. Here is an example: <li><a href="changelog/web.html" title="web">WEB</a></li> The file changelog/web.html is already declared with charset gb2312 in its meta tag and ...

Having issues with PHP code on AJAX page?

I've been delving into AJAX, but I've hit a roadblock along the way. Here's the code snippet in question: <label>View as:</label> <a href ="#" onClick="return false" onmousedown="javascript:swapContent('con1');"> ...

How to choose an item in Jquery using its exact location?

For my testing purposes, I rely on Selenium Webdriver to ensure the functionality of creating a new time slot in a calendar. The specific calendar I am working with is the Jquery week calendar which can be found at the following link: https://github.com/th ...

My script was functioning just fine until suddenly I started receiving the dreaded "No 'Access-Control-Allow-Origin' error" repeatedly

I've been working on building a small API in the background of a server using PHP. The subdomain I'm utilizing for this project is api.website.com. To aid in debugging, I included the following code at the top of my index.php file within the subd ...

Creating multiple instances of Infinite Ajax Scroll on a single page

How can I set up two instances on the same page? I have successfully implemented Infinite AJAX Scroll in a single overflow div but now need to add another overflow div that accesses different data on the same page. I know it's possible, but I haven& ...

What is the best way to customize the icon-bar in react-bootstrap's Navbar?

I am trying to customize the icon-bar in a react-bootstrap's Navbar component by setting its background color to white. However, my webpack scss loader is preventing me from styling CSS classes with dashes, as it only allows camel case. This restricti ...

Enhancing the appearance of each letter within a word

I am currently working on styling the word "Siteripe". Each letter should have a different color, just like it is shown on this website. I have successfully styled only the first letter using the following CSS code: #namer:first-letter { color:#09C; f ...

jQuery unable to properly reset form inputs

I encountered an issue with my page that contains two forms. One is a regular form, and the other is a form within a hidden modal that appears after a successful ajax post from the first form. The problem I face is that once the modal is populated correct ...

Unexpected outcomes occur from CSS nesting

Today I realized there is still so much to learn about CSS. How is it possible that the CSS style below produces that outcome? Stylesheet: li.item a:first-child {color: red} HTML List: <ul class="mylist"> <li class="item"><a ...

Issue with JSON or Jquery: Uncaught error message: Cannot access property 'error' as it is null

I am attempting to initiate an ajax call using the jQuery code provided below. However, when I try this in Chrome, I encounter an error that says 'uncaught typeerror cannot read property 'error' of null'. This prevents the preloader fr ...

Unable to resize div element using the change size function

When I click on a div, it should change size, and I want to write the onclick command in an external .js file instead of directly in the html page. Currently in html: <div id="box1" class="kaesten" onclick="changeSize('box1')"> Title 1 &l ...