简体   繁体   English

supersize.js与wordpress post atachment集成

[英]supersized.js integration with wordpress post atachment

Any suggestions of how to integrate wordpress post image attachments into the array required by supersized.js for easy formatting? 关于如何将wordpress发布图像附件集成到supersized.js所需的数组中以便进行简单格式化的任何建议?

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

It needs images in an array like - 它需要数组中的图像,例如-

slides : [ //Slideshow Images {image : 'http://buildinternet.s3.amazonaws.com/projects/supersized/3.1/slides/quietchaos-kitty.jpg', title : 'Quiet Chaos by Kitty Gallannaugh', url : 'http://www.nonsensesociety.com/2010/12/kitty-gallannaugh/'}, {image : 'http://buildinternet.s3.amazonaws.com/projects/supersized/3.1/slides/wanderers-kitty.jpg', title : 'Wanderers by Kitty Gallannaugh', url : 'http://www.nonsensesociety.com/2010/12/kitty-gallannaugh/'}, {image : 'http://buildinternet.s3.amazonaws.com/projects/supersized/3.1/slides/apple-kitty.jpg', title : 'Applewood by Kitty Gallannaugh', url : 'http://www.nonsensesociety.com/2010/12/kitty-gallannaugh/'} ] 幻灯片:[//幻灯片图像{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/kitty-gallannaugh/”},{图片:“ http://buildinternet.s3.amazonaws”。 com / projects / supersized / 3.1 / slides / apple-kitty.jpg”,标题:“ Applewood by Kitty Gallannaugh”,网址:“ http://www.nonsensesociety.com/2010/12/kitty-gallannaugh/'}]

I've found this - https://www.wpoutfitters.com/2011/01/wordpress-image-attachment-gallery-revisited/ but not sure how to make it fit for an array. 我发现了这个-https://www.wpoutfitters.com/2011/01/wordpress-image-attachment-gallery-revisited/,但不确定如何使其适合数组。

this websites seems to be able to use supersized.js with images in the html body http://www.cstone.com.au 该网站似乎可以将supersized.js与html正文中的图像一起使用http://www.cstone.com.au

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

After you have loaded the image into your site, you can extract the src url and put it into a variable. 将图像加载到站点中之后,您可以提取src url并将其放入变量中。 Now you can input this into supersized. 现在,您可以将其输入到超大尺寸中。 Make sure that you give the image some css to put it on display:none. 确保给图像一些CSS以使其显示:无。

That's it. 而已。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM