I’m using 2 font-faces and wish to switch between them using jQuery, thing is my font-face’s name is ‘ArvoBold’ and when I use:
css('font-family','ArvoBold')
it changes to a non-existing font named ArvoBold (no-quotes)! I’ve tried to make it work with:
css("font-family","'ArvoBold'")
But it doesn’t seem to work. I’ve also tried to create a variable:
var fontvar="'"+"ArvoBold"+"'";
css('font-family',fontvar);
And also with no success, because on the CSS of the element (checked using
Google Chrome’s inspector) it keeps using ArvoBold instead of ‘ArvoBold’.
Can anybody help me out?
Thanks in advance!
John
Not sure of your exact implementation, but this works by escaping the single quotes in the string:
Why do you need the single quotes?
Quick Test on escaping the single quotes outputs ‘ArvoBold’ in the content div: