var dynimages=new Array()
dynimages[1]=["001.jpg", ""]
dynimages[2]=["002.jpg", ""]
dynimages[3]=["003.jpg", ""]
var preloadimg="yes"
var optlinktarget=""
var imgborderwidth=0
preloads = new Array();
if (preloadimg=="yes"){
for (x=1; x<dynimages.length; x++){
preloads[x] = new Image();
preloads[x].src = dynimages[x][0]
}
}
function returnimgcode(theimg){
var imghtml=""
if (theimg[1]!="")
imghtml='<a href="'+theimg[1]+'" target="'+optlinktarget+'">'
imghtml+='<img src="'+theimg[0]+'" width="100%" border="'+imgborderwidth+'">'
if (theimg[1]!="")
imghtml+='</a>'
return imghtml
}
function modifyimage(loadarea, imgindex){
if (document.getElementById){
var imgobj=document.getElementById(loadarea)
if (imgobj.filters && window.createPopup){
imgobj.style.filter=filterstring
imgobj.filters[0].Apply()
}
imgobj.innerHTML=returnimgcode(dynimages[imgindex])
imgobj.filters[0].Play()
return false}}
Do you have the variable filterstring defined anywhere? Even if that variable is an empty string, you might be running into JavaScript errors, as there are no filters to play in that case. Secondly, is there a global function defined called createPopup?
both are in there.
someone once said something about the createPopup and i tried deleting it but then the rollover didn't work.
Code:
function modifyimage(loadarea, imgindex){
if (document.getElementById){
var imgobj=document.getElementById(loadarea)
if (imgobj.filters && window.createPopup){
imgobj.style.filter=filterstring
imgobj.filters[0].Apply()
}
function modifyimage(loadarea, imgindex){
if (document.getElementById){
var imgobj=document.getElementById(loadarea)
if (imgobj.filters && window.createPopup){
imgobj.style.filter=filterstring
imgobj.filters[0].Apply()
}
You're getting a JavaScript error somewhere. Can you post the error you are getting? This will be something generated by the browser. And then you need to post the full JavaScript -- all the JavaScript for the page.
here is the error i get in IE
"to help protect your security, Internet Explorer has restricted this webpage from running scripts or ActiveX controls that could access your computer. Click here for options."
so i clicked and allowed the blocked content and all of a sudden the roll over works. but if something my code is causing that error...
Code:
var dynimages=new Array()
dynimages[1]=["001.jpg", ""]
dynimages[2]=["002.jpg", ""]
dynimages[3]=["003.jpg", ""]
var preloadimg="yes"
var optlinktarget=""
var imgborderwidth=0
preloads = new Array();
if (preloadimg=="yes"){
for (x=1; x<dynimages.length; x++){
preloads[x] = new Image();
preloads[x].src = dynimages[x][0]
}
}
function returnimgcode(theimg){
var imghtml=""
if (theimg[1]!="")
imghtml='<a href="'+theimg[1]+'" target="'+optlinktarget+'">'
imghtml+='<img src="'+theimg[0]+'" width="100%" border="'+imgborderwidth+'">'
if (theimg[1]!="")
imghtml+='</a>'
return imghtml
}
function modifyimage(loadarea, imgindex){
if (document.getElementById){
var imgobj=document.getElementById(loadarea)
imgobj.innerHTML=returnimgcode(dynimages[imgindex])
imgobj.filters[0].Play()
return false}}
you guys are geniuses... and here i thought i knew a ton about web design... (more than anyone at my office anyway) it must make you feel good to know all the answers.
thanks again for a job well done.
you even made my JS file smaller. :-)
IE-Win, as of several windows updates ago, prevents all JavaScript from running if it comes from a file on your hard drive. There is a setting in the IE-Win options to allow active scripting in this situation. The problem was a security setting all along. This is why it's so important to give any error messages you are receiving, be they JavaScript errors or notifications from the browser.
One way to learn is to come to a place like these forums and try to solve other peoples problems that you don't already know the answer to, that way when you eventually run into a similar problem, you will know what to do.
Bookmarks