Not signed in (Sign In)

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.


    • CommentAuthorhardy
    • CommentTimeNov 5th 2006
     
    I need help on loading some photos to the same webpage. Here's what I'm trying to do. I want to be able to choose photo groups from a drop down list and display the selected photo group in a table in the same page instead of loading another page that contains the selected photo group. I was thinking of puting the photo name in a a database and loading it from there but then that was too difficult and I don't have that many photos to use the power of a database. So I think there must be some way to use Javascript or PHP to do what I wanted to do. The problem is I have not used Javascript nor PHP to do this kind of things before. Will anyone help me please?

    Many thanks in advance!
    • CommentAuthorviane
    • CommentTimeNov 5th 2006
     
    I really am not sure, i never completely learned javascript but I know for a link you have to do something like this:


    <A HREF="" onClick="document.pic.src=img1.gif">Click to Change Picture</A>
    <br>
    <br>
    <IMG SRC="blank.gif" NAME="pic" BORDER=0>



    Try something like that in dropdowns
    Maybe onFocus or something like that....

    Oh yeah, PHP is more static then Javascript, so it would probably require a refreshed page with different variables passed in the URL (?picture=1 kinda thing)
    • CommentAuthorjustnajm
    • CommentTimeNov 16th 2006
     
    Hi,

    'vian' the method you define is correct but it is not complete and had left a big part of it.

    Javascript can do the trick as 'vian' described but javascript also need the picture to be already available in the cache or some where hidden on the page. Otherwise the above method will not gonna work

    you need to add the following lines in your html head section:

    <script language="JavaScript">

    Image1= new Image(50,60)
    Image1.src = "toad1.gif"

    </script>


    like this you can add as many images as you want to be uplaoded for javascript use.

    You can do it, but you should also know that it will take time to load all the images as your page will load. And will minimize the loading speed of your page as the javascript will find "new Image" words it will imideatly try to load the image before the page will load. I hope you understand what I mean.

    I have heard about AJAX that it gives the possibility of loading a particular table or image without loading the other parts of the page.