Getting a box-shadow programmatically in Opera can be achieved by using the appropriate CSS

Trying to achieve the same effect with jQuery:

item.css("-o-box-shadow")

or:

item.css("box-shadow")

However, the result is an empty string.

In Webkit and Gecko browsers it works by using "-webkit" and "-moz" prefixes respectively.

How can this be achieved in Opera?

I have also attempted using "boxShadow", but still receiving an empty string.

$(".flag").css("boxShadow", "rgba(0,0,0,0.5) 4pt 4pt 7pt"); // Style set successfully
$(".flag").css("boxShadow"); // Returns ""

Answer №1

$('section').css('textShadow', '5px 5px 5px #00FFFF');

or: .css('textShadow');

Answer №2

It took me a good fifteen minutes of searching and experimenting, but I have come to the conclusion that there is definitely a bug in Opera.

No matter how hard I tried, I just could not seem to retrieve the value for box-shadow, unless there is some hidden or undocumented method that I am unaware of.

Answer №3

It appears there may be a problem with how Opera has implemented boxShadow. I will investigate further to determine why that specific value is not accessible.

In the interim, you can try accessing the complete style by using $(".flag").attr("style") and then separating the string at the ':' character.

Answer №4

For those interested in incorporating jQuery, consider using the following code snippet:

$('.item').css('boxShadow','5px 5px 6px #333333');

Here's an example to illustrate :) (best viewed in Opera)

Answer №5

It seems that Opera may have a bug regarding this issue. When using jQuery's .css() method, it utilizes getComputedStyle || currentStyle to retrieve CSS properties, but both methods are returning an empty string for the property boxShadow.

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

Adding loading text that disappears once the page has finished loading can be achieved by adding a simple script to

Currently, I am working on a page that uses the .load() function to load videos. I want to display loading text that disappears once the page has finished loading. Can someone please guide me on how to achieve this? I am struggling with determining when th ...

Navigating the use of PHP variables in JavaScript

Whenever I select an option from the menu, a Javascript function changes the input value based on a PHP variable. Below is an example of how I assign values from 1 to n to each option: $i = 0; foreach($videos as $val) { echo '<option value=&ap ...

Update the style of a div within an iframe in React

I'm currently developing a project in Next.js and I've added an iframe within a component. The issue I'm facing is that I need to customize the style of a specific div inside the iframe, but I'm having trouble targeting the div with the ...

AngularJS - Not binding $scope to the DOM

Recently starting out with Angular, I decided to practice by creating a simple website. One of the features I want to include is displaying the number of times a button has been clicked through data binding. Here's the controller code I've writte ...

Tips for passing the name of a success function as a parameter in an AJAX request

My challenge is to create an AJAX call as a single function, where I pass the success function name as a parameter. Here's the function that I attempted: function MakeApiCall(dataText, apiName, functionName) { $.ajax({ url: apiUrl + apiName, ...

What could be causing the failure of loading CSS images or JS in my Laravel project?

This is a continuation of my previous question where I managed to get the site up and running. Initially, all files including css, js, and images were loading properly. However, now I am encountering issues as the files are not loading and the console disp ...

How do callback functions in Javascript interact with variables outside of their scope?

Greetings to all. I am facing an issue regarding the 'callback function - scope of variable', My intention is to utilize the 'i in for loop' with the 'callback function User_UidSearch', however, I am unable to implement it. ...

What is the method for resolving circular references using double closures?

Recently, I came across an article discussing how circular references can lead to memory leaks in internet explorer (IE). The article presented an example involving closures nested within each other to demonstrate how a circular reference could occur: fun ...

Concealing Content within an Accordion

Looking for some guidance on setting up a mobile version of my product image with hover features. Currently using tooltips on desktop and planning to use a modified accordion on mobile, but struggling to make progress. Customized some JS to toggle an acco ...

Issue with Bootstrap dropdown functionality when used within a Horizontal description block

I'm struggling to get a dropdown menu to work properly within a horizontal description. The dropdown menu just won't toggle when clicked. <div class="container-fluid"> <div class="row vertical-align"> <dl class="dl-horizonta ...

Setting input type to date with full width using jQuery Mobile

Currently working on a web project utilizing jQuery Mobile 1.1.1 and looking to incorporate a <input type="date" /> that spans the entire width of the page. However, encountering a peculiar issue (noticing a gap where an arrow should be displayed) sp ...

Incorporating OpenRouteService into an Angular application on Stackbliz

I am encountering an issue with integrating OpenRouteService into my Stackblitz application. The component code is as follows: import { Component, OnInit } from '@angular/core'; import {Location} from '@angular/common'; import {Openro ...

Having trouble with a jQuery slideshow when populating a div from a JSON feed?

$(document).ready(function() { $.getJSON("http://api.flickr.com/services/feeds/groups_pool.gne?id=89254480@N00&\ lang=en-us&format=json&jsoncallback=?", getJSONimages); function getJSONimages(data) { var htmlString = ""; $.each(data.item ...

Error: the search variable is not defined

function sorting(type) { $("#parentDiv").empty(); $.getJSON("example_data.json", ({ Find })); function Locate(a, b) { return (a[Find.type] < b[Find.type]) ? -1 : (a[Find.type] > b[Find.type]) ? 1 : 0; }; } The example_data.j ...

What is the best way to preserve the state of child components after being filtered by the parent component?

I've been working on a small application using create react app to enhance my skills in React, but I've hit a roadblock with managing the state. The application maps through JSON data in the parent component and displays 6 "image cards" as child ...

Folding animation using CSS3 and vertex manipulation

Looking to create a folding animation on a squared div with vertex? While there are examples online using Flash, I'm seeking guidance on how to achieve a similar effect using CSS3 and HTML5. Any tips or resources would be greatly appreciated. Thank y ...

Display a message to a user on the same HTML page using jQuery or JavaScript

How can I show a message to the user on the HTML page confirming their selected date without using an alert box? I attempted this code snippet, but I'm uncertain: document.writeln("The date you picked is: " + dateText); ...

Having trouble retrieving data from a Postgres table in my Node Express app, despite using async/await functionalities

Trying to fetch a row from my Postgres database table by id has presented an issue. The function calling the query contains data, but the controller is returning null. It appears that the controller is resolving before the query, despite using await in my ...

Unable to scroll through embed code on iOS responsive devices

-webkit-overflow-scrolling: touch; overflow-y: scroll; I have attempted using this code but unfortunately it is still not functioning as expected. The issue seems to only occur on iOS responsive devices, as it works fine on other devices including MAC. ...

What is the proper way to specify a file destination in React?

After reading this article on downloading objects from GCP Cloud storage bucket, I'm curious about setting the file destination dynamically in React. Is there a way to achieve this? The article can be found at: https://cloud.google.com/storage/docs/do ...