简体   繁体   English

jQuery-指定循环插件的目录

[英]jQuery - specify a directory for cycle plugin

forget my question for a while... bad choice of words 暂时忘记我的问题。。。

I am using this code for a jQuery Cycle Slideshow... 我正在将此代码用于jQuery Cycle Slideshow ...

script is here... you may skip it and proceed to question 脚本在这里...您可以跳过它并继续提问

<script type="text/javascript" src="code_snipets/jquery.js"></script>
<script type="text/javascript" src="code_snipets/jquery_plugin_cycle.js"></script>
<script language="javascript" type="text/javascript">
$(
   function()
   {
    $('ul#ullist').cycle(
            {
                fx:     'scrollHorz',
                speed:  3000,
                sync:   0,
                prev:   '#prev',
                next:   '#next',
                height: 'auto',
                cleartype:  1,
                timeout: 10000
            }
            );
   }
);
</script>

style is here... you may skip it and proceed to question 样式在这里...您可以跳过它并继续提问

ul 
{ 
    display  : block;
    margin   : 0;
    padding  : 0;
    width    : 280px;
    height   : auto;
    overflow : hidden; 
}

ul li 
{ 
    width       : 280px; 
    display     : block; 
    color       : #e0e0e0;
    font-family : Verdana;
    font-size   : 11px;
}

html code is here html代码在这里

<ul id="ullist2" class="ul_li">
    <li class="ul_li"><img src="images/bu_logo.png"></li>
    <li class="ul_li"><img src="images/bu_title.png"></li>
</ul>

now I am using LIST for my images... how can suggest a directory .. meaning just specify a directory and it should pick all images from directory... 现在我正在使用LIST作为图像...如何建议目录 ..意思是只指定一个目录,它应该从目录中选择所有图像...

You can't do this directly...directories aren't returned in a 100% standard fashion from a web server, what happens usually is the server in question ( if directory browsing is enabled) translates the directory to an HTML page with links to the files. 您不能直接执行此操作... Web服务器不会以100%标准的方式返回目录, 通常会发生问题的服务器( 如果启用了目录浏览) 会将目录转换为带有链接的HTML页面到文件。

Browsing a directory on IIS vs. Apache vs. nginx, etc will be different, and the plugin doesn't have code to parse all of those responses and pick the image links out. 在IIS,Apache,nginx等上浏览目录的方式将有所不同,并且该插件没有代码来解析所有这些响应并选择图像链接。 You could have a server-side handler rendering links in the page based on a directory, but with static HTML the plugin (as it is now) won't do this. 您可能有一个服务器端处理程序根据目录在页面中呈现链接,但是使用静态HTML时,插件(如现在)将不会执行此操作。

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

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