[英]Supersized JavaScript slider add description
I added description in supersized slider. 我在超大滑块中添加了说明。 It works but the div containing the description is empty when I check the code. 它可以工作,但是当我检查代码时,包含描述的div为空。
in index.html: 在index.html中:
<div id="slidedescription"></div>
....
slides : [ // Slideshow Images
{image : 'img1.jpg', description : '<div"><ul><li><a href="">Text</a></li></ul></div>', title : '<h3>Text</h3>', thumb : 'img1Thumb.jpg', thumbTitle : 'Text'},
{image : 'img2.jpg', description : '<div><ul><li><a href="">Text</a></li></ul></div>', title : '<h3>Text</h3>', thumb : 'img2Thumb.jpg', thumbTitle : 'Text'},
{image : 'img3.jpg', description : '<div><ul><li><a href="">Text</a></li></ul></div>', title : '<h3>Text</h3>', thumb : 'img3Thumb.jpg', thumbTitle : 'Text'}
]
});
});
in supersized.shutter.min.js: 在supersized.shutter.min.js中:
afterAnimation:function(){...
if(a(vars.slide_description).length){
(api.getField("description"))?a(vars.slide_description).html(api.getField("description")):a(vars.slide_description).html("")
}
a.supersized.themeVars={ ...
slide_description:"#slidedescription",
The problem is: I would like the output to be in div element in the HTML page result but now: 问题是:我希望输出在HTML页面结果的div元素中,但是现在:
<div id="slidedescription"> </div>
is empty and I would like the result to be: 为空,我希望结果是:
<div id="slidedescription">
<div ><ul><li><a href="">Text</a></li></div>
<div ><ul><li><a href="">Text</a></li></div>
<div ><ul><li><a href="">Text</a></li></div>
</div>
Is it possible to be achieved? 有可能实现吗? I guess it is but would you help me with this? 我想是的,但是您能帮我吗?
Best regards. 最好的祝福。
You should add the appropriate part of the following code to theme\\supersized.shutter : 您应该将以下代码的适当部分添加到theme \\ supersized.shutter :
afterAnimation : function(){
if (api.options.progress_bar && !vars.is_paused) theme.progressBar();
var description = api.getField("description");
if (typeof description != 'undefined') {
$('#slidedescription').html(description);
} else {
$('#slidedescription').html('');
}
},
Note that you may also need to edit path in the file demo.html from 请注意,您可能还需要在文件demo.html中从以下位置编辑路径
<script type="text/javascript" src="theme/supersized.shutter.min.js"> </ script>
to 至
<script type="text/javascript" src="theme/supersized.shutter.js"> </ script>
Also, you should add part above code to '_init: function ()' that description was seen after running gallery. 另外,您应该在“ _init:function()”中添加上述代码的一部分,以便在运行Gallery之后看到该描述。
Do you mean something like this? 你的意思是这样吗? Have a look at the source, if it is of any help: http://www.krijnen.com/opcafe.shtml 如果有帮助,请查看源代码: http : //www.krijnen.com/opcafe.shtml
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.