drupal_add_css(array('path_to_images' => base_path() . path_to_theme() .'/images'), 'setting');
Then from your script "Drupal.settings.path_to_images" will point to the right path.
$(".myclass").css(background:'url(' + Drupal.settings.path_to_images + '/myimage.png')');
No comments:
Post a Comment