文件名来自 SMUGMUG
我正在尝试在单个图像上获取自以为是的文件名。这是我发现的一些获取图像的代码..
$.smugmug.images.getInfo 行是需要发生此操作的地方,但我不确定如何实现它。任何建议将不胜感激!
$.fn.smugmugCycle = function(options) {
var albumID = options.albumID;
var size = options.size || "Medium";
// Setup div
var div = this;
$.smugmug.login.anonymously(function() {
$.smugmug.images.get({AlbumID: albumID, Heavy: 1}, function(images) {
$.each(images.Images, function() {
var url = this[size + "URL"];
div.append("<img src=\"" + url + "\" />");
var img_id = this.id
$.smugmug.images.getInfo({ImageID: img_id}, function(images) {
alert(images.FileName);
});
});
div.cycle(options);
});
});
};
原始代码来自 https://github.com/jmaurer
...另外,显然我无法制作新的标签,除非我在 StackOverflow 上更有经验:( *smugmug
I'm trying to get smugmug filenames on individual images. Here's some code I found that gets the image..
the $.smugmug.images.getInfo line is where this needs to happen but I'm not sure how to implement it. Any advice would be greatly appreciated!
$.fn.smugmugCycle = function(options) {
var albumID = options.albumID;
var size = options.size || "Medium";
// Setup div
var div = this;
$.smugmug.login.anonymously(function() {
$.smugmug.images.get({AlbumID: albumID, Heavy: 1}, function(images) {
$.each(images.Images, function() {
var url = this[size + "URL"];
div.append("<img src=\"" + url + "\" />");
var img_id = this.id
$.smugmug.images.getInfo({ImageID: img_id}, function(images) {
alert(images.FileName);
});
});
div.cycle(options);
});
});
};
Original code from https://github.com/jmaurer
... also, Apparently I can't make a new tag unless I'm more experienced on StackOverflow :( *smugmug
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 images.getInfo 来获取图像的文件名。但是,您不仅需要为其提供 ImageID,还需要为其提供 ImageKey。
You can use images.getInfo to get the filename of an image. However you need to give it not only the ImageID but also the ImageKey.