I've been attempting to pass CSS attributes into a jQuery method using data stored in a JSON database. However, it doesn't seem to be functioning as expected. I suspect that directly inputting the path to the JSON variable may not be the correct approach.
Below is my JSON variable snippet:
{
"galleryeleven":"",
"galleryelevenlink":"",
"galleryelevendisplay":"none !important"
}
And here is the jQuery code where I'm trying to incorporate this data:
$('#galleryeleven').attr('src',database[globalswitchNumber].galleryeleven);
$('#galleryelevenlink').attr('href',database[globalswitchNumber].galleryelevenlink);
$('#galleryeleven').css("display",database[globalswitchNumber].galleryelevendisplay);
While the jQuery .attr methods are working fine, the .css method seems to be encountering some issues.