Implementing jQuery stylesheet using a bookmarklet

Here's a question that may seem silly, but I'm looking to quickly apply CSS styles to a webpage by clicking on a bookmarklet. It will definitely save me time :)

For example, this code does the trick:

javascript:void( jQuery( ".fancybox-overlay-fixed").css("background-color","black" ) );

However, why doesn't this code work? It gives me an error due to the ";" before the second jQuery function.

javascript:void( jQuery( ".fancybox-overlay-fixed").css("background-color","black" ); jQuery( ".fancybox-close").css({ "display":"none"}); );

Any suggestions on how to modify it to apply styles to multiple elements? Thank you!

Answer №1

Changing ';' to ',' is functioning correctly after testing. I trust this will be beneficial for you.

javascript:void(  jQuery(".fancybox-overlay-fixed").css("background-color", "black"), jQuery(".fancybox-close").css({"display": "none"}) );

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

In Firefox, the functionality of applying background-position-y to a label when it is immediately preceded by a checked input[type=radio]

CSS selector input[type=checkbox]:checked + label is not functioning properly in Firefox browser! label { display: block; font-family: 'Muli'; font-size: 14px; color: #666; vertical-align: top; background: url("https://s31.postimg. ...

Selecting checkboxes based on a delimited string containing specific values can be done using Javascript

I have a set of checkboxes similar to the ones below that I would like to select based on database values. If I convert the database values into a string format like DC0|100;DK0|100;DM0-SRM|200;DR0|300 (delimited by semicolons or another delimiter), how ca ...

Invalid JSON Primitive encountered when making an AJAX call using jQuery

I've been struggling with a problem that I just can't seem to solve. I've tried numerous solutions and even searched on StackOverflow for similar questions, but nothing seems to work for me. Here is the issue at hand: I have this function ...

Retrieve the ajax variable containing the external URL

I'm currently troubleshooting why I am unable to retrieve the variable value from an ajax request. Review my code snippet below: planet_finder = function() { var planet_name; $.getJSON("https://api.planetinfo.com/jsonp?callback=?", "", funct ...

Pressing multiple buttons in Jquery triggers multiple submissions of Ajax requests

One of the features in my system allows administrators to edit or "delete" an item from the inventory. However, deleting an item doesn't completely remove it; instead, it just removes it from the active inventory. When the administrator clicks the "De ...

Sending AJAX data from VIEW to CONTROLLER in PHP (MVC) using AJAX: A step-by-step guide

I have a page at http://visiting/blog. The Controller contains two methods: action_index and add_index. When Action_index() executes, it returns pages with indexes. On the other hand, Add_index() invokes a model's method called add_data(), which inse ...

Trigger the jQuery event only during moments of inactivity

My form includes a search input box that automatically pulls remote data based on the user's entry. To activate the search, at least 3 characters are required. For instance, typing "smi" will bring up all staff members with last names starting with " ...

"Gone in a Scroll: Div vanishes as page moves

Fiddle: http://jsfiddle.net/ud6hejm6/ I was tasked with creating a website for a video game tournament. By opening the fiddle link provided, you can preview the page layout. A central div is featured in the design: <div class="middle teko" id="mezzo"& ...

Efficiently Filtering User Input and Other Things

Imagine I have a setup for organizing a television guide like this: <div class="day"> <p>A Date</p> <div class="time"> <p>A Time</p> <div class="show"> <p>A Show</p> ...

A step-by-step guide on coding a slider image

<?php $query1="SELECT * FROM user_photos_offline WHERE ssmid='$ssmid' AND status='1' ORDER BY date_uploaded DESC LIMIT 0,5"; $sql=mysql_query($query1); $count=mysql_num_rows($sql); ...

Refresh doesn't refresh

function updateImage(){ $("#fileImg").attr("src","image.jpg"); $('#fileImg').fadeIn('slow'); } function updateContent(){ $.get('content.php', function(data) { $('#content').html(data); $('#content&apos ...

Choosing the subsequent div after the current one using Jquery

I am currently in the process of creating a drop-down menu button that, when clicked, reveals the previously hidden div underneath it. The code is functioning properly without the use of $(this).next, but it is displaying all divs with the class .menudrop ...

The Quirks of jQuery's .load() Method

On my website, I am incorporating a basic jQuery script to load content from one part of a webpage into the 'display container' on the same page. The content being loaded consists of multiple divs enclosed within an outer <div> that is hid ...

What is a simpler method for transferring text from an input field to a textarea?

I need some assistance with a slightly complex task. I have multiple input fields that I would like to combine into a textarea field with specific formatting requirements. Specifically, if an input field is filled out, it should automatically be preceded b ...

How can I include a loading spinner image for every tab within jQuery tabs?

I want to display a loading spinner image for each tab in jQuery tabs when the page first loads. Once the count label is visible, I need to remove the spinner image. Below is my code: HTML Code: <div id="tabs" > <ul> <li> ...

Arranging Multiple Files in Sequence Using HTML5 File API Instead of Uploading All Simultaneously

I am currently working on a BackboneJS/Marionette App and I want to enable users to upload multiple files. Right now, the functionality works when users select multiple files simultaneously, but I would like to give them the option to select one file init ...

The behavior of the jQuery click function seems to be quirky and not functioning as expected. Additionally, the

It seems that instead of triggering a POST request, somehow a GET request is being triggered. Additionally, the ajax call is not being made as expected. I have attempted this many times before, but none of my attempts seem to be working. It could potenti ...

Is there a way to convert inline styling to CSS using Material-ui within a React component?

In my development work with React, I initially utilized inline styling to customize the appearance of material-UI components. However, I have come to realize that utilizing CSS provides a more structured and efficient approach to styling components. Despit ...

Upon making an Ajax call, the response returned as [object Object]

After making an Ajax call to an API, I received the following response: {"prova.com":{"status":0}} I attempted to retrieve the status value of 0 using this script: $.ajax({ type: 'GET', url: 'https://api.cloudns.net/domains/check- ...

Revise Total Amount in Woocommerce Checkout Using an Ajax Call

Before seeking help on SO, I researched extensively to understand how to make an AJAX request with WordPress. Although my code and request are functioning correctly, they are not achieving the desired outcome. My goal is to update the "Total" value when c ...