0

我试图弄清楚为什么这个简单的代码不起作用。我正在实施这个:

http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm

这是我的代码:

<script type="text/javascript"     src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

<script type="text/javascript" src="fadeslideshow.js">

/***********************************************
* Ultimate Fade In Slideshow v2.0- (c) Dynamic Drive DHTML code library     (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/

</script>

<script type="text/javascript">

var mygallery=new fadeSlideShow({
    wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
    dimensions: [750, 500], //width/height of gallery in pixels. Should reflect     dimensions of largest image
        imagearray: [
        ["/images/allimages/vdance750x500.png", "", "", "Caption"],
        ["/images/allimages/vpoca750x500.png",  "", "", ""],
        ["/images/allimages/vhat750x500.png", "", "", "" ],
        ["/images/allimages/vdance750x500.png", "", "", ""] //<--no trailing comma     after very last image element!
    ],
    displaymode: {type:'auto', pause:2500, cycles:0, wraparound:false},
    persist: false, //remember last viewed slide and recall within same session?
    fadeduration: 500, //transition duration (milliseconds)
    descreveal: "ondemand",
    togglerid: ""
})
</script>


<title>Vanadia's Site</title>





</head>

<body>

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

<br />


</body>
</html>

我是编码新手,想知道是否存在语法错误……所有图像都在正确的位置。我不明白为什么这不起作用!

任何帮助,将不胜感激。

4

2 回答 2

1

您的文档类型以及打开的 html 和 head 标签在哪里?也许您只是没有在此处包含它们,但请确保它们没有从您的文档中丢失。除此之外,请检查浏览器的 JavaScript 控制台以查看是否抛出错误。如果你是,请张贴给大家看看。

于 2012-10-27T03:15:51.617 回答
0

我复制了您的代码并更改了图像路径(演示:jsfiddle.net/hJKMy/)。您的图像路径可能不正确。

于 2012-10-27T03:04:27.160 回答