supersized.js与wordpress帖子附件集成

时间:2011-06-15 15:04:20

标签: javascript wordpress

有关如何将wordpress后映像附件集成到supersized.js所需的数组中以便于格式化的任何建议吗?

http://www.buildinternet.com/project/supersized/ http://buildinternet.com/project/supersized/slideshow/3.1/fade.html

它需要像 -

这样的数组中的图像

幻灯片:[//幻灯片图片 {image:'http://buildinternet.s3.amazonaws.com/projects/supersized/3.1/slides/quietchaos-kitty.jpg',标题:'Kitty Gallannaugh的安静混乱',网址:'http:// www。 nonsensesociety.com/2010/12/kitty-gallannaugh/“}, {image:'http://buildinternet.s3.amazonaws.com/projects/supersized/3.1/slides/wanderers-kitty.jpg',标题:'由Kitty Gallannaugh流浪',网址:'http://www.nonsensesociety .COM / 2010/12 /小猫-gallannaugh /'}, {image:'http://buildinternet.s3.amazonaws.com/projects/supersized/3.1/slides/apple-kitty.jpg',标题:'Applewood by Kitty Gallannaugh',网址:'http://www.nonsensesociety .COM / 2010/12 /小猫-gallannaugh /'} ]

我发现了这个 - https://www.wpoutfitters.com/2011/01/wordpress-image-attachment-gallery-revisited/ 但不确定如何使其适合数组。

这个网站似乎能够在html正文中使用supersized.js和图像 http://www.cstone.com.au

1 个答案:

答案 0 :(得分:1)

$(function() {
    var imgpad = $("img.bgscaler").prop('src');
    jQuery(function($){
        $.supersized({
            slides : [ {image : imgpad, title : 'Achtergrond'} ]
        });
    }); 
});

将图像加载到站点后,您可以提取src URL并将其放入 一个变量。现在您可以将其输入到超大尺寸。 确保你给图像一些css以显示它:none。

就是这样。