PDA

View Full Version : Have I found a bug??



lister
08-21-2006, 09:30 AM
This code: (found at http://www.dynamicdrive.com/dynamicindex14/bgslide.htm ) and written below works great in FireFox and Netscape but does not work in the recent versions of IE....

Does something have to be added for it to work in IE or is that just the way it is...? Seems odd that it works for every other browser...

THANKS IN ADVANCE FOR ANY REPLIES!

<style>
body{
/*Remove below line to make bgimage NOT fixed*/
background-attachment:fixed;
background-repeat: no-repeat;
/*Use center center in place of 300 200 to center bg image*/
background-position: 300 200;
}
</style>

<script language="JavaScript1.2">

//Background Image Slideshow- Dynamic Drive (www.dynamicdrive.com)
//For full source code, 100's more DHTML scripts, and TOS,
//visit http://www.dynamicdrive.com

//Specify background images to slide
var bgslides=new Array()
bgslides[0]="bgslide.jpg"
bgslides[1]="bgslide2.jpg"
bgslides[2]="bgslide3.jpg"

//Specify interval between slide (in miliseconds)
var speed=3000

//preload images
var processed=new Array()
for (i=0;i<bgslides.length;i++){
processed[i]=new Image()
processed[i].src=bgslides[i]
}

var inc=-1

function slideback(){
if (inc<bgslides.length-1)
inc++
else
inc=0
document.body.background=processed[inc].src
}

if (document.all||document.getElementById)
window.onload=new Function('setInterval("slideback()",speed)')

</script>

jscheuer1
08-21-2006, 09:34 AM
No, works fine here, and I have the most recent full release of IE. Are you using that beta 7?

codeexploiter
08-21-2006, 10:29 AM
Hi

I've checked the script in IE 7 Beta 3 and it worked without any problem.

Regards

Code Exploiter

lister
08-21-2006, 11:13 AM
seems really really odd....it doesnt seem to work for me on IE 6.0 and the IE 7.0 Beta....it does work absolutely fine on FireFox and Netscape as i mentioned though !!

I have checked on different PC's as well (just in case of some weird cookie problem).

Is there anything that might be preventing IE from rendering the below code?

THANKS AGAIN!!!!

jscheuer1
08-21-2006, 05:21 PM
I found that with a DOCTYPE, it needs to have units specified for the position but, that doesn't stop it from working (just moves it to the upper left corner). Perhaps something else on your page is causing a problem. Do you have other scripts on your page, style? Does the demo page here at Dynamic Drive work for you in those browsers?

lister
08-22-2006, 08:34 AM
Yeah i think that something else on the page is creating the problem b/c as you suggested - the dynamicscript.com script works fine on IE 6 and IE 7 so it ought to work for me....

does seem odd though since i have stripped everything off the page and it did work but it doubled the background image.

Again, Firefox and Netscape it works abosultey fine...

I shall endeveour to work something out but if anyone reading this has any ideas that would be great to hear from you.

Thanks!

jscheuer1
08-22-2006, 08:45 AM
If you provide a link to your problem page, I could have a look and see.

lister
08-22-2006, 10:08 PM
Hi John

I hope you dont mind but i sent you the page via your email...

Thanks so much for offering to check it out for me!

TA

jscheuer1
08-23-2006, 02:52 AM
That's OK. I got the email. Here's the weird part though, it works fine. So, either you fixed it or there is some problem with the way your copy(ies) of IE are configured. Be sure that 'Enable' is ticked under the 'Active scripting' item under the 'Scripting' header near the bottom of the 'Custom' settings for 'Security':

Tools -
Internet Options -
Security -

Custom Level . . . (button)

scroll near to the bottom:

Scripting -
Active Scripting -
Enable

If that's OK, it may have something to do with your firewall, are you using Window's Firewall or do you have an add on like Norton, PCTools, etc.? These add on firewalls can sometimes block scripts and/or parts of them.

lister
08-23-2006, 12:43 PM
Thanks again.

Right, either i am going completely mad or the tow PC's i have used are set-up in very strange ways.

I tried to see if the javascript was disabled using the method you suggested - which was fine. I then disbaled the windows firewall and no joy. The PC's that i am using do not have any additional antivirus or such things.

All seems really really weird that IE has to act that way when the other browsers are fine.....