'defaults' Example : defaults « Javascript Objects « JavaScript Reference

Home
JavaScript Reference
1.Event Handlers Reference
2.Javascript Collections
3.Javascript Methods
4.Javascript Objects
5.Javascript Properties
JavaScript Reference » Javascript Objects » defaults 




'defaults' Example

    
<html xmlns:yourNs>
<head>
<?import namespace="yourNs" implementation="yourHTC.htc"></head>
<body><div style= "color:red; 
                   font-size:20pt; 
                   font-Style:italic; 
                   border:2px solid blue">
<br>Sample text in the main document<br>
<yourNs:yourTagName></yourNs:yourTagName>
</div>
</body>
</html>

<!--
Contents of yourHTC.htc:
-->
<public:component tagName="yourTagName">
<attach event="oncontentready" onevent=contentReady() />
</public:component>
<script language="JavaScript"
function contentReady(){
    defaults.viewLink = document;
    defaults.viewInheritStyle = false;
    defaults.viewMasterTab = false
}
function inheritStyle() {
    boolInherit = defaults.viewInheritStyle;
    defaults.viewInheritStyle = true
}
</script>
<body>
<div id="extDiv" 
     style="font-size:20pt; font-weight:bold; border:3px solid green">
     Imported Document Text
</div>
<br>
<button onclick="inheritStyle();">Set Inheritance to True</button>
</body>

    
      
      














Related examples in the same category
1.'defaults' Syntax and Note
2.'defaults' Event Handlers
3.'defaults' CSS Attributes and JavaScript Style Properties
4.'defaults' JavaScript Properties
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.