...

View Full Version : Dynamic PHP Picture Viewer (version 1.0)



ignitor
07-06-2007, 05:48 PM
I needed a way to display images without having to update the urls all the time so i cam across this java/php script. Everything seems to work fine in FireFox but for some reason it doesn't work in IE. Can anyone help me?

Heres the url to the scripts
http://www.javascriptkit.com/script/script2/phpviewer/

Heres the URL on my site http://5e-community.com/drew/imageviewer.php

Thanks,
Ignitor

Spookster
07-06-2007, 05:54 PM
Java and javascript are not the same language. That is using javascript.

ignitor
07-06-2007, 06:37 PM
Ok. . . I apologize - is there another forum this should go in? Can anyone help with JAVA SCRIPT. . As my title states, i am a "new coder." :)

Spookster
07-06-2007, 07:02 PM
It is likely the javascript that would be causing the problem since javascript is a client language and different browsers don't always implement it exactly the same way.

We'll just move your thread over to the javascript forum.

ignitor
07-06-2007, 07:05 PM
Sounds good to me - Thanks spook

vwphillips
07-07-2007, 12:10 AM
......
var Opac;
function showpicture(selectobj){
piccontainerobj=document.getElementById("picturearea")
Opac=10
resetfade(10);
piccontainerobj.innerHTML='<img src="'+locationstring+selectobj.options[selectobj.selectedIndex].value+'">'
fadepictoview=setInterval("gradualfade(piccontainerobj)",50)
}

function resetfade(){
if (window.fadepictoview)
clearInterval(fadepictoview)
zxcOpacity(piccontainerobj,Opac);
}


function gradualfade(){
if (Opac<100)
zxcOpacity(piccontainerobj,Opac+=20);
else //if not IE or Moz
clearInterval(fadepictoview)
}
function zxcOpacity(zxcobj,zxcopc) {
if (zxcopc<0||zxcopc>100){ return; }
if (zxcobj.style.MozOpacity!=null){ zxcobj.style.MozOpacity=(zxcopc/100)-.001; }
else if (zxcobj.style.opacity!=null){ zxcobj.style.opacity=(zxcopc/100)-.001; }
else if (zxcobj.style.filter!=null){ zxcobj.style.filter = 'alpha(opacity='+zxcopc+')'; }
else if (zxcobj.KHTMLOpacity!=null){ zxcobj.KHTMLOpacity=(zxcopc/100)-.001; }
}

window.onload=function(){
populateSelect(document.getElementById("picsform").picslist)
}

</script>

canadianjameson
07-07-2007, 01:54 AM
good old vic :)

ignitor
07-07-2007, 05:12 AM
Thanks for the help! Unfortunately i tried the code you gave and it still didn't work (now it wont load in FF either). :( I left it up so you can see it when you get a chance. Again, i appreciate the help. :)

dhomba
07-07-2007, 06:37 AM
try using this

http://hscripts.com/scripts/JavaScript/slide-show-software.php

:)

vwphillips
07-07-2007, 10:44 AM
my post was the ammended and new functions plus variable

<script type="text/javascript">

<!-- Dynamic PHP Picture Viewer (v1.0)- By JavaScriptKit.com (http://www.javascriptkit.com) //--->
<!-- For this and over 400+ free scripts, visit JavaScript Kit- http://www.javascriptkit.com/ //--->
<!-- This notice must stay intact for use //--->
function populateSelect(selectobj){
for (var i=0; i<picsarray.length; i++)
selectobj.options[selectobj.options.length]=new Option(picsarray[i], picsarray[i])
if (selectobj.options.length>1){
selectobj.selectedIndex=0
showpicture(document.getElementById("picsform").picslist)
}
}

var Opac;
function showpicture(selectobj){
piccontainerobj=document.getElementById("picturearea")
Opac=10
resetfade(10);
piccontainerobj.innerHTML='<img src="'+locationstring+selectobj.options[selectobj.selectedIndex].value+'">'
fadepictoview=setInterval("gradualfade(piccontainerobj)",50)
}

function resetfade(){
if (window.fadepictoview)
clearInterval(fadepictoview)
zxcOpacity(piccontainerobj,Opac);
}


function gradualfade(){
if (Opac<100)
zxcOpacity(piccontainerobj,Opac+=20);
else //if not IE or Moz
clearInterval(fadepictoview)
}
function zxcOpacity(zxcobj,zxcopc) {
if (zxcopc<0||zxcopc>100){ return; }
if (zxcobj.style.MozOpacity!=null){ zxcobj.style.MozOpacity=(zxcopc/100)-.001; }
else if (zxcobj.style.opacity!=null){ zxcobj.style.opacity=(zxcopc/100)-.001; }
else if (zxcobj.style.filter!=null){ zxcobj.style.filter = 'alpha(opacity='+zxcopc+')'; }
else if (zxcobj.KHTMLOpacity!=null){ zxcobj.KHTMLOpacity=(zxcopc/100)-.001; }
}

window.onload=function(){
populateSelect(document.getElementById("picsform").picslist)
}

</script>

ignitor
07-07-2007, 05:06 PM
Ahh, sorry. I tried the code you gave and it worked like a charm. Thanks a lot! Also if you noticed i gave you credit for it. Is that the proper thing to do or not? Let me know - thanks again!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum