Javascript for showing/printing dropdown/expanding text - not working in FF
hi
(using rh 8.0.2, building chm/webhelp, displaying webhelp in ff 3.6+)
i've got clickable text ("click here print topic") in topic footers displays dropdowns , expanding texts , opens print dialog. works in ie, in firefox nothing happens. using web developer tool find error, error message "arrayofdivs undefined" highlighted line in script below.
i have borrowed script robohelp experts in forum, , have no javascript skills, i'm looking clue on how fix script firefox. appreciated!
the script:
<script type="text/javascript" language="javascript1.2">//<![cdata[
<!--
var arrayofdivs = document.all.tags("div");
function showem() { (x=0;x<arrayofdivs.length;x++) { arrayofdivs[x].style.display = "block"; }
}
function hideem() { (x=0;x<arrayofdivs.length;x++) { arrayofdivs[x].style.display = "none"; }
}
function printem() { ;showem();settimeout('window.print()',50)}
//-->
//]]></script>
the link:
<p align="center"><a href="chap01\#" onclick="javascript:printem()">click here print topic</a></p>
best regards,
torgeir
hi,
replace document.all.tags("div") document.getelementsbytagname('div')
i think better show dropdowns using css. easier , less code. amend link this:
<p align="center"><a href="javascrip:void(0);” onclick="window.print()">click here print topic</a></p>
in style sheet, add following (using external editor):
@media print{
div.droptext { display: block !important; }
}
when prints, dropdowns shown. doesn’t make changes page, if user has dropdowns shown, won’t closed.
greet,
willam
message edited by: w. van weelden - email didn't come trough correct.
More discussions in WebHelp
adobe
Comments
Post a Comment