Jump to content

Recommended Posts

I've got this part of my function:

 

var target = $(this).children(".inner_wrapper").attr("id");
var defaultColor = $("#" + target + " .color_picker").css("background-color");
var hexColor = defaultColor.replace("#", "");
if(defaultColor.match(/rgb/))
{
defaultColor = jqueryColorpicker.rgb2hex(defaultColor);
}
setTimeout("jqueryColorpicker.refreshColor(hexColor, \"#\" + target + \" .color_picker\")", 100);

The whole thing worked until I added the definition of hexColor, and the timeout function. So other than those two lines, the code is correct (this is all part of a much larger jquery function).

 

I'm getting the error that 'hexColor isn't defined' in this line:

 

setTimeout("jqueryColorpicker.refreshColor(hexColor, \"#\" + target + \" .color_picker\")", 100);

 

I can't wrap my head around it. hexColor looks to be defined to me, as I defined it right above.

Any thoughts?

Link to comment
https://forums.phpfreaks.com/topic/185974-hexcolor-is-not-defined/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.