Load ya jpeg??
- Started
- Last post
- 3 Responses
- Dancer
Have been searching for a while but with no luck:
Can you tell me the best way to dynamically laod jpegs into a div tag. What code is the easiest and is there a resource for it online?
- fate_redux0
What are you talking about? letting a user upload a jpeg and displaying it in the browser at a specific location?
- myobie0
probably just set the innerHTML of the div to an img tag...
or createElement('img')
and setAttribute('src') on it
then div.appendNode(or something like that...
yeah, just make an img tag in it or change the background of it...
- heavyt0
javascript:
make an empty img tag with ID="image"
add this function:
i = 0;
function imageLoader(){
cur = document.getElementById('image...
i++
if(i=1){
cur = picture1.jpg;
}else{
cur = picture2.jpg;
}
}a very simple way to do it. depending on what you want to accomplish, you are going to want to change that IF to a SWITCH or use a math.rendom or something.
TR1