Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#14377 closed feature (plugin)

We don't want to write rgb in if statements, make this function in next edition , please ! :)

Reported by: anon Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 2.0.0
Keywords: Cc:
Blocked by: Blocking:

Description

Hello, I realized the code below doesn't work and it's needed to write rgb, please make the code below work in the next editions, it would be very helpful ! if css background color is red, jquery should be able to recognize it ! Thank you! Keep up the good job!

http://jsfiddle.net/TcSQ8/31/

$(document).ready(function(){

$(".box").click(function(){

if ($(".box").css("background-color") == "red") {

$(".box").html("Success!");

}

});

});

Change History (4)

comment:1 Changed 10 years ago by scottgonzalez

Resolution: plugin
Status: newclosed
Type: bugfeature

comment:2 Changed 10 years ago by anonymous

Is it possible to integrate this plugin into next jquery editions?

comment:3 Changed 10 years ago by anonymous

Hello, I realized the code below doesn't work and it's needed to write rgb, or extra plugins like this. https://github.com/jquery/jquery-color

Can you please take into consideration of next jquery so that it's possible that jquery reads the code below without any external plugin?

http://jsfiddle.net/TcSQ8/31/

$(document).ready(function(){

$(".box").click(function(){

if ($(".box").css("background-color") == "red") {

$(".box").html("Success!");

}

});

});

comment:4 Changed 10 years ago by dmethvin

We have no plans or desire to incorporate existing plugins into jQuery core. The whole idea of jQuery is to be extensible. Is there some problem with your page adding a plugin for functionality that you require, but few others need on a regular basis? In general it should not be necessary for jQuery code to query colors of elements. Instead you should be using class names.

Note: See TracTickets for help on using tickets.