2012-07-21 83 views
0

我正在使用一个简单的图像滑块脚本。它适用于大多数浏览器。简单的图像滑块Javascript图像路径不工作在IE 6

当我使用默认图像在IE6中测试它时,它工作正常:给图像加载的默认路径是一些像这样的网址somesitename.com/image.jpg;这适用于IE 6和其他现代浏览器。

但是,当我添加我的图像像someimages.jpg它不会加载IE6中的图像,而在其他浏览器中它工作正常。

是我的JavaScript首先支持一些URL路径,然后是图像路径?

下面的代码就是我编辑图像路径的一部分...

<script type="text/javascript"> 
var mygallery=new simpleGallery({ 
    wrapperid: "simplegallery1", //ID of main gallery container, 
    dimensions: [300,250], //width/height of gallery in pixels. Should reflect dimensions of the images exactly 
    imagearray: [ 
     ["images/img-2.jpg", "#", "_new", "There's nothing like a nice swim in the Summer."], 
     ["images/img-1.jpg", "#", "", ""], 
     ["images/r-.jpg", "", "", "Eat your fruits, it's good for you!"], 
     ["images/inside-image1.jpg", "", "", ""] 
    ], 
    autoplay: [true, 2500, 5], //[auto_play_boolean, delay_btw_slide_millisec, cycles_before_stopping_int] 
    persist: false, //remember last viewed slide and recall within same session? 
    fadeduration: 500, //transition duration (milliseconds) 
    oninit:function(){ //event that fires when gallery has initialized/ ready to run 
     //Keyword "this": references current gallery instance (ie: try this.navigate("play/pause")) 
    }, 
    onslide:function(curslide, i){ //event that fires after each slide is shown 
     //Keyword "this": references current gallery instance 
     //curslide: returns DOM reference to current slide's DIV (ie: try alert(curslide.innerHTML) 
     //i: integer reflecting current image within collection being shown (0=1st image, 1=2nd etc) 
    } 
}) 
</script> 
+0

引用:“...在IE6和其他现代浏览器中工作...” - 嗯... IE6,一个现代浏览器?我想不是。 – Spudley 2012-07-21 21:40:29

回答

0

您的影像滑块代码运行你的someimages.jpg应驻留在同一目录下,否则提供完整路径someimages.jpg

+0

它可以在除IE 6以外的所有浏览器中正常工作。我已经在我的代码中给出了图像的完整路径,如果你检查。是否有IE 6的调整,我必须尝试..? – 2012-07-21 17:51:20

0

我认为你使用的SimpleGallery脚本是这样的:http://www.dynamicdrive.com/dynamicindex4/simplegallery.htm(我想这是一个,因为你给出的代码示例与该页面上的代码示例相同)。

如果是这样,请注意,在该页面的顶部,它表示脚本支持的浏览器:“FF1 + IE7 + Opr9 +”。

换句话说,这个脚本不支持IE6。

您可能可以修复它,但它可能会涉及到脚本本身的代码。可能不值得的努力。

还值得指出的是,这个脚本不是一个jQuery插件。你已经把jQuery作为你的标签之一,所以我假设你的网站上有jQuery。如果是这样,肯定还有其他可用的滑块脚本支持IE6。我建议你最好的解决办法是尝试其中的一种。

最后大问题:你真的需要支持IE6吗?如果你在中国,那么答案可能是肯定的,但否则答案应该是'不'。 IE6的使用率现在降低到正在使用的浏览器的0.3%左右,并且每个月都在下降,即使这样,0.3%的企业也会在不久的将来对IE6(和WinXP)的官方支持结束时被迫升级。完全。

+0

如果您打开您在IE6中为我提供的动态驱动器链接,则会看到它的工作原理。 – 2012-07-23 06:49:20

+0

@Mckenzi - 我的观点是该程序不支持IE6。我不知道*为什么*它不支持它,但作者显然做出了决定。也许你发现的问题是它不被支持的原因,或者有其他的东西不起作用。无论哪种方式,网站上的浏览器支持细节都足够明确,我会说你在IE6中会遇到这个软件的问题。 – Spudley 2012-07-23 20:27:46