JavaScript问题:如何将描述移动下来? [英] JavaScript question: How to move the description down?

查看:59
本文介绍了JavaScript问题:如何将描述移动下来?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!



我有一个HTML + JavaScript网站我正在努力,我正在尝试添加一些功能,但每次我尝试调整我喜欢的东西,我打破了剧本。你们上次能够立即解决我的问题,所以我想我会问,看看你是否有一个简单的解决方案。



JavaScript是一个幻灯片,带有在照片上发生的描述。我想要实现的技巧是:将描述文本显示在幻灯片放映下方,以及图像计数(例如3 of 7等)



您可以在此处查看当前存在的幻灯片显示页面: http://www.louisecarriewales.com/test/ codes_of_conduct_images.html [ ^ ]



幻灯片本身最低限度地被调用到HTML中,只有这样:

Hi guys!

I have an HTML + JavaScript site I am working on and I am trying to add a little functionality, but each time I try to adjust things to my liking, I break the script. You guys were able to instantly solve my question last time, so I thought I would ask and see if you had an easy solution.

The JavaScript is a slideshow, with a description that occurs on top of the photos. The trick that I''m trying to achieve is: to have the description text appear below the slideshow, along with the image count (e.g. "3 of 7", etc.)

You can see the slideshow page as it currently exists here: http://www.louisecarriewales.com/test/codes_of_conduct_images.html[^]

The slideshow itself is called into the HTML minimally, with just this:

<div id="fadeshow1"></div>





图像计数(3 of 7等)被调用到HTML中单独在下面,使用status:



The image count ("3 of 7", etc.) is called into the HTML separately below that, with the "status":

<div id="fadeshow1toggler" style="width:627px; text-align:center; margin-removed1px">
<span class="status" style="margin:0 1px;"></span>
</div>





在页面的头部,我们有这个。我想拉动并向下移动的描述是第四个也是最后一个每个数组中的字符串。



In the page''s head, we have this. The description I want to pull and move below is the fourth and final string in each array.

<script type="text/javascript">
var mygallery=new fadeSlideShow({
    wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
    dimensions: [543, 649], //width/height of gallery in pixels. Should reflect dimensions of largest image
    imagearray: [
        ["images/photo_wall_smaller.jpg", "", "", "Name of the image Lorum ipsum"],
        ["images/photo_fpo1.jpg", "http://en.wikipedia.org/wiki/Cave", "_new", "Title of the artwork"],
        ["images/photo_fpo2.jpg", "", "", "Name of the image Lorum ipsum dolor sit"],
        ["images/photo_fpo3.jpg", "", "", "Name of the image"] //<--no trailing comma after very last image element!

    ],

    displaymode: {type:'auto', pause:3500, cycles:0, wraparound:true},

    persist: false, //remember last viewed slide and recall within same session?

    fadeduration: 1100, //transition duration (milliseconds)

    descreveal: "ondemand",

    togglerid: "fadeshow1toggler"

})

</script>





JavaScript的内容是一个名为fadeslideshow.js的单独文档,您可以在其中看到整个: http://www.louisecarriewales.com/test/fadeslideshow.js [ ^ ]



但下面是.js文件中显示图像数量的部分,这正是我想添加描述blurb:



The meat of the JavaScript is a separate document called fadeslideshow.js, which you can see in its entirety here: http://www.louisecarriewales.com/test/fadeslideshow.js[^]

But below is the portion of the .js file that presents the image count, and this is exactly where I''d like to add the description blurb:

if (setting.$descpanel){
        setting.$descpanel.css({visibility:(setting.imagearray[imgindex][3])? 'visible' : 'hidden'})
        if (setting.imagearray[imgindex][3]) //if this slide contains a description
            setting.$descinner.empty().html(setting.closebutton + setting.imagearray[imgindex][3])
    }
    if (setting.displaymode.type=="manual" && !setting.displaymode.wraparound){
        this.paginatecontrol()
    }
    if (setting.$status) //if status container defined
        setting.$status.html(setting.curimage+1 + " <span class=\"sections_grey\">of</span> " + totalimages + "&nbsp; &nbsp; <span class=\"copper\"> name of image here</span>")

},





是否有在这里添加描述的简单方法是不会破坏脚本?谢谢你们的时间和专业知识!这应该是我对这个项目的最后一个问题。:)

-Barry



Is there an easy way to add in the description here that won''t break the script? Thank you guys for your time and expertise! This should be my last question on this project. :)
-Barry

推荐答案

descpanel){
setting。
descpanel){ setting.


descpanel.css({visibility:(setting.imagearray [imgindex] [ 3 ])?' visible'' hidden'})
if (setting.imagearray [imgindex] [ 3 ]) // 如果此幻灯片包含描述
设置。
descpanel.css({visibility:(setting.imagearray[imgindex][3])? 'visible' : 'hidden'}) if (setting.imagearray[imgindex][3]) //if this slide contains a description setting.


descinner.empty()。html(setting.closebutton + setting.imagearray [imgindex] [< span class =code-digit> 3 ])
}
if (setting.displaymode.type == manual&& !setting.displaymode.wraparound){
this .paginatecontrol()
}
如果(设置。
descinner.empty().html(setting.closebutton + setting.imagearray[imgindex][3]) } if (setting.displaymode.type=="manual" && !setting.displaymode.wraparound){ this.paginatecontrol() } if (setting.


这篇关于JavaScript问题:如何将描述移动下来?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆