Ho visto che su tutti i browser supportano l'uso di jquery anche nel body, ma in ie no...è possibile risolvere questo problema?
grazie
Simone
Ho visto che su tutti i browser supportano l'uso di jquery anche nel body, ma in ie no...è possibile risolvere questo problema?
grazie
Simone
in pratica dovrei mettere la chiamata javascript (<script language="javascript" type="text/javascript" src="jquery-1.3.2.min.js"></script>) nel body anziche nel head.
Questo perchè io inserisco con dei template dei banner in siti che io non gestisco. Il template scrive nel body. In tutti i browser funziona in IE no... spero che ora sia più chiaro
Simo
leggermente piu' chiaro
un po' di codice si puo' vedere?
con IE8 funziona perfettamente
basta mettere prima
<script type="text/javascript" src="../../js/jquery/jquery-1.3.2.min.js"></script>
e poi
jQuery(function()
{
//qui ci va il codice da eseguire alla lettura documento
}
);
Pietro
il codice è questo
<script type="text/javascript" src="http://xxxx/0/jquery.js"></script>
<script language="javascript" type="text/javascript">
var hpbgimg = 'sfz_cornice_rockol_light.jpg';
var hpbgcolor = '';
var blink = 'http://www.google.it';
var pageWidth = jQuery(document).width();
var ffwidth = (pageWidth-1020)/2;
var iewidth = ffwidth-15;
var isIE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;
if(isIE6){
jQuery(document).ready(function(){
var D = document;
var windowHeight = Math.max(Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),Math.max(D.body.of fsetHeight, D.documentElement.offsetHeight),Math.max(D.body.cl ientHeight, D.documentElement.clientHeight));
D.getElementById('bleft').style.height = windowHeight;D.getElementById('bright').style.heig ht = windowHeight;
});}
jQuery(window).resize(function() {
pageWidth = jQuery(document).width();
if(pageWidth <= 1024) {ffwidth = 0; iewidth = 0;} else {ffwidth = (pageWidth-1004)/2;iewidth = ffwidth-20;}
jQuery("#bleft,#bright").css("width",ffwidth);
if(isIE6){jQuery("#bleft,#bright").css("width",iew idth);}
});
document.write('<style>');
document.write('body{background:'+hpbgcolor+' url("'+hpbgimg+'") top center no-repeat fixed;}');
document.write('#btop{cursor: pointer; height: 95px; min-height: 95px; width: 100%;}');
document.write('#bleft{cursor: pointer; height: 100%;width:'+ffwidth+'px;position:fixed;top:0;left :0;_width:'+iewidth+'px;_float:left;}');
document.write('#bright{cursor: pointer; height: 100%;width:'+ffwidth+'px;position:fixed;top:0;righ t:0;_width:'+iewidth+'px;_float:right;}');
document.write('#wrapper{padding: 0 9px;}');
document.write('.top-banner{display: none;}');
document.write('</style>');
document.write('<div id="btop"> </div>');
if (screen.width>1024) {
document.write('<div id="bleft"> </div>');
document.write('<div id="bright"> </div>');
}
</script>
Il codice che riporti funziona su IE8, Firefox, Opera, Chrome, Safari
funziona nel senso che non dà errore e non scrive niente nello schermo
mettendo dentro <a></a> qualcosa, riesco pure a cliccare e ad andare nella pagina del link
document.write('
<div id="btop">' + blink + '</div></p>');
Naturalmente tutto il codice è messo subito dopo <body>
Pietro
E per farlo funzionare anche per IE7??
Simo
Originariamente inviato da egimu
E per farlo funzionare anche per IE7??
Simonon ce l'ho IE7
non posso provare
Pietro
Ho provato pure con IE8 ma in modalità compatibilità IE7 e va
Pietro