I want to write a template in Extjs (Sencha Touch) in order to convert my css and javascript library into itemTpland also want to control a 258deg value by that. How can I append my CSS and HTML in to template having a javascript function to change the degree.
My Code:
<style type="text/css">
#a {
max-width: 100%;
max-height: 100%;
width: 100%;
height: 100%;
background-image:url('a.png');
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;
position: relative;
}
#b {
width: 100%;
height: 100%;
background-image:url('b.png');
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;
position: relative;
-webkit-transform:rotate(258deg);
-moz-transform:rotate(258deg);
-o-transform:rotate(258deg);
-ms-transform:rotate(258deg);
-moz-transition: all 1s ease;
-webkit-transition: all 1s ease;
-o-transition: all 1s ease;
transition: all 1s ease;
}
</style>
<div id="a">
<div id="b"></div>
</div>
<script type="text/javascript">
function myFunc(c) {
var c = 58;
return c
}
<script>
My Try:
style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = 'max-width: 100%;'+
'max-height: 100%;'+
'width: 100%;'+
'height: 100%;'+
'background-image:url("a.png");'+
'background-repeat: no-repeat;'+
'background-attachment: fixed;'+
'background-position: center; '+
'position: relative;';
document.getElementsByTagName('head')[0].appendChild(style);
Aucun commentaire:
Enregistrer un commentaire