2 bits of Javascript...

Associate
Joined
8 Aug 2008
Posts
302
1. Those image based sliders on forms to change values, no idea how that works, anyone got any tutorials?
2. How do you get a div to expand to the right size when the content is random text so height isn't predetermined?

Thanks
 
1. You superstar that's perfect
2. Sorry I meant expand it with javascript, current content fades, div resizes (assuming it has a background colour or image) then you fade the new content back in.

Thanks
 
I am a mootools monkey so i have no idea about jquery, but as has been previously said a div will automatically expand to include its contents. You can directly alter the contents of any element by setting its innerHTML.

http://www.tizag.com/javascriptT/javascript-innerHTML.php

In your example it is thereby a simple case of psuedocode;
transition out,
set innerHTML
transition in,

edit; if you want to alter the background text and/or image again i have no idea about jquery but in mootools you can use setStyles: http://mootools.net/docs/core/Element/Element.Style#Element:setStyles
 
Last edited:
Back
Top Bottom