简体   繁体   中英

Simple image slider Javascript image path not working in IE 6

I'm using a simple image slider script. It works perfectly in most browsers.

When I was testing it in IE6 with the default images, it was working fine: The default path given to the images to load was some url like this somesitename.com/image.jpg ; this works in IE 6 and other modern browsers.

But when I added my images like someimages.jpg it doesn't load the images in IE6, whereas in other browsers it works fine.

Is it that my javascript supports some URL path first and then the image path?

The code below is the part where i'm editing the image path...

<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>

您的someimages.jpg应该位于图像滑块代码运行所在的目录中,否则应提供someimages.jpg的完整路径。

I assume that the SimpleGallery script you're using is this one: http://www.dynamicdrive.com/dynamicindex4/simplegallery.htm (I guess it is that one, because the code example you've given is identical to the one on that page).

If so, please note that at the top of that page, it states the browsers supported by the script: "FF1+ IE7+ Opr9+".

In other words, this script does not support IE6.

You may be able to fix it, but it would likely involve hacking around with the code of the script itself. Probably not worth the effort.

It's also worth pointing out that this script is not a jQuery plugin. You've put jQuery as one of your tags on the question, so I assume you've got jQuery on your site. If so, there are definitely other slider scripts available which do support IE6. I suggest your best solution would be to try one of them instead.

Finally, the big question: do you really need to support IE6? If you're in China, then the answer is maybe yes, but otherwise the answer really should be 'No'. IE6 usage is now down to about 0.3% of the browsers in use and falling every month, and even then a lot of that 0.3% are corporates who will be forced to upgrade in the near future when official support for IE6 (and WinXP) ends completely.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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