"Lasse Reichstein Nielsen" <> wrote in message
news:...
> "Randy Starkey" <> writes:
>
>> "Randy Starkey" <> wrote in
>> message news:...
>
>>> "Lasse Reichstein Nielsen" <> wrote in message
>
>>>> Yes, just a button with a "+" or "-" in it. If you want it styled,
>>>> just use CSS and style the class "moreButton".
>>
>> could you give me a CSS code line that would make the button not quite so
>> tall? Just a bit shorter.
>
> Try:
> ---
> <style type="text/css">
> .moreButton { height: 1em; width: 1em; }
> </style>
Here's the full script with style inserted - seems to kill the script
working. I'm doing something wrong.
--Randy
<HTML>
<script type="text/javascript">
function getElement(id) {
return document.getElementById ?
document.getElementById(id) :
document.all ?
document.all[id] :
null; // no need to fall back on Netscape here
}
function writeMoreButton(id) {
document.write("<input class='moreButton' type='button' value='+'",
" onclick='toggleMore(this,\"", id, "\");'>");
}
<style type="text/css">
.moreButton { height: 1em; width: 1em; }
</style>
function toggleContent(id, visible) {
var elem = getElement(id);
(elem.style||elem).display = visible?"":"none";
}
function toggleMore(button,id) {
var expand = (button.value=="+");
toggleContent(id, expand);
button.value = expand ? "-" : "+";
}
</script>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua.
<span id="loremMore">Ut enim ad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.</span>
<script type="text/javascript">
writeMoreButton("loremMore");
toggleContent("loremMore", false);
</script>
</p>
</HTML>
> ---
>
> /L
> --
> Lasse Reichstein Nielsen -
> DHTML Death Colors:
> <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
> 'Faith without judgement merely degrades the spirit divine.'