所以我的 assets/javascripts 文件夹中有一个文件夹,它运行一个名为 galleryview 的图像幻灯片。在这个文件夹内是一个主题目录,其中包含我的“下一个”和“上一个”按钮的图像,因此......
资产/javascripts/galleryview/主题/
现在运行这个的javascript,通过这个链接到这些图像......
//Determine path between current page and filmstrip images
//Scan script tags and look for path to GalleryView plugin
$('script').each(function(i){
var s = $(this);
if(s.attr('src') && s.attr('src').match(/jquery\.galleryview/)){
img_path = s.attr('src').split('jquery.galleryview')[0]+'themes/';
}
});
但是,我现在在 Rails 应用程序中使用它,所以我需要将此 img_path 行指向
资产/图像/
那么我的 imag_path 现在应该是什么样子?
img_path = ?
这是 jsfiddle 上的整个 javascript 文件代码....将其复制并粘贴到编辑器中,我感兴趣的区域在第 389 行附近。