Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dynamic PHP Picture Viewer (version 1.0)

    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

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Java and javascript are not the same language. That is using javascript.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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."

  • #4
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    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.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #5
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sounds good to me - Thanks spook

  • #6
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,501
    Thanks
    3
    Thanked 500 Times in 487 Posts
    Code:
    ......
     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>
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

  • #7
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    good old vic
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #8
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #9
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

  • #10
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,501
    Thanks
    3
    Thanked 500 Times in 487 Posts
    my post was the ammended and new functions plus variable
    Code:
        <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>
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

  • #11
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •