Please help me... Spent a day on this single problem.
Hi,
I am kinda new to Jquery. What I am trying to do is pass a variable as a parameter to a plugin. I will paste the code so you can see what I am doing.
$("a[rel^='prettyPhoto']").prettyPhoto({
theme: function(){
var $theme_var = 'light_rounded';
if(('body').hasClass('dark'))
{
$theme_var = 'light_rounded';
}
else
{
$theme_var = 'dark_rounded';
}
return $theme_var
}
});
the plugin works at the following: $("a[rel^='prettyPhoto']").prettyPhoto();
and can take the following parameters:
$("a[rel^='prettyPhoto']").prettyPhoto({theme: light_rounded});
OR
$("a[rel^='prettyPhoto']").prettyPhoto({theme: dark_rounded});
What I need to do is determine the class of the background. If the background has the class 'dark', accept the parameter light_rounded else dark_rounded
PLEASE HELP me and point to me where I am going wrong.
Thank you
Ty