Dynamic div
- Started
- Last post
- 12 Responses
- eb6
i have an simple image gallery done with javascript .
http://www.ebrandell.com/dynamic…is it possible to have the description load in the <div> instead of the <textarea>?
Thanks much
- ********0
Er ... in the script or template you are using simply place whatever the Description Value is ... inside of that DIV tag you have.
- ********0
Oh, double der.
Just place your entire form tag inside of your DIV, and then use CSS to change the style of what the Text Area looks like? Make it read-only too?
- eb60
I was wanting it out of the form totally if thats possible. Mainly because I can't seem to get the <textarea> to resize for long descriptions, it just adds scroll bars which looks horrible.
- fugged0
document.getElementById("test... = "the text you want to appear in the div with the id of test"
- fugged0
oh bugger. FAIL.
get a reference to the div in the DOM using document.getElementById
set its innerHTML property to the text you want to appear.
done.
- ldww0
document.getElementById('test... = desc;
also, why are you using all those evals? totally unnecessary.
- ldww0
oh damn, fugged got it, but its erasing the innerHTML part.
- eb60
i should have added, i have no clue about javascript. just trial and erroring. I tried the innerHTML part but i can only get it to display plain text, not the dynamic changing description when you move forward and back.
- acescence0
i updated the changeslide() function, this should work:
- eb60
it works! is there a way to get the first description to load automatically like the first image does?
- acescence0
sure, add an onload handler to the opening body tag:
onload="changeslide()"
- eb60
Thank you!!