08-11-2010, 18:27
Witam!
mam nastepująca sytuacje z 2 funkcjami w js
w kodzie strony każda jest odpowiednio wywołana itp. wszystko działa ok poza przeglądarką microsoftu w której 2 funkcja zostaje pominieta(nie ma jej w debugu).
Jest sposób aby sobie z tym poradzić?
mam nastepująca sytuacje z 2 funkcjami w js
Kod:
function relocate()
{
var u=screen.width;
u-=980;
u=u/2;
u-=50;
document.write('<style type="text/css">#fingers{position:absolute;right:'+u+'px;top:2px;}\n');
document.write('@media screen and (-webkit-min-device-pixel-ratio:0) { #fingers{position:absolute;top:3px;right:'+u+'px;}}</style>');
}
function resize()
{
var sidebar=document.getElementById('primary');
var main=document.getElementById('main');
var sizeofs=sidebar.clientHeight;
var sizeofm=main.clientHeight;
if (sizeofm>sizeofs){document.write('<style type="text/css">#primary{height:'+sizeofm+'px;background:url(img/site_h2.png)repeat-y;width:202px;}</style>');}
else{document.write('<style type="text/css">#primary{background:url(img/obaz.png)repeat-y;width:202px;}</style>');}
}
Jest sposób aby sobie z tym poradzić?