HtmlDlgSafeHelper (Dialog Helper) object
[This documentation is preliminary and is subject to change.]
Provides access to the color dialog box, block formats, and system fonts collections.
Standards information
There are no standards that apply here.
Remarks
To create this object, use the OBJECT element and provide the class identifier (CLSID) for the dialog helper.
HtmlDlgSafeHelper was introduced in Microsoft Internet Explorer 6
Examples
This code creates a dialog helper object which can be referenced by its id value.
<OBJECT id=dlgHelper CLASSID="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width="0px" height="0px"> </OBJECT>
Build date: 2/14/2012
Hi dear~
I got a problem.
Can you help me?
I want to get random font that not borken text(include text of local -> korean text, japan text, english text..) .
I wrote javascript codes that "setInterval" and "Dialog Helper Object".
the below codes are example... so, How can i repair codes?
The codes:
<object id="dlgHelper" classid="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width="0px" height="0px"></object>
<script type="text/javascript">
var CallFuncSpeed = 120;
function GetRndFont() {
try{
var nSystemFontCnt = Math.floor((Math.random()*(dlgHelper.fonts.count))+1);
return dlgHelper.fonts(nSystemFontCnt);
}
catch(err){
document.getElementById('log').innerHTML += nSystemFontCnt;
}
}
function SetRndmFont(){
TextObj.style.fontFamily = GetRndFont();
}
function StartSwitchingFont(){
setInterval("SetRndmFont()",CallFuncSpeed);
}
if(document.all) { //IE
window.onload = StartSwitchingFont;
}
</script>
<div id="log"></div>
<div id="TextObj" style="width:98%;height:30px;text-align:center;font-size:large;background-color:#ddd;">This is a test.</div>
You can have random font. but sometimes, You can seeing broken text...
I don't wana see booken text.
[JSUDDS.MSFT] Your code contained an error. Apparently, the collection of fonts does not start at 0--it starts at 1. So, occasionally your nSystemFontCnt variable would be set to zero, and the object would return an error. I have replaced your code above with a working example.
- 10/16/2008
- toydiary
- 2/13/2009
- John Sudds [Microsoft]