ciao a tutti!io dovrei realizzare una pagina in cui una sezione con dentro del testo scrolli in verticale al passaggio su 2 immagini up e down. ho trovato in giro il codice seguente che funziona correttamente con opera e ie ma il testo proprio non vuole saperne di scrollare con firefox.
ho provato a togliere il doctype e in questo modo anche su firefox funziona, ma ovviamente così la validazione è impensabile.
non è che qualcuno sa come risolvere il problema o mi sa indicare qualche altro script???è importante!!!!!!!!!!!!!!
grazie a tutti!!!
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="it">
<HEAD><TITLE>dHTML AP Scrollable Area Customised Demo with Images in the Content</TITLE>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<STYLE type=text/css>#divUpControl {
HEIGHT: 30px; LEFT: 10px; POSITION: absolute; TEXT-ALIGN: right; TOP: 10px; WIDTH: 320px; Z-INDEX: 1
}
#divDownControl {
HEIGHT: 30px; LEFT: 10px; POSITION: absolute; TEXT-ALIGN: right; TOP: 270px; WIDTH: 320px; Z-INDEX: 1
}
#divContainer {
CLIP: rect(0px 320px 240px 0px); HEIGHT: 240px; LEFT: 10px; OVERFLOW: hidden; POSITION: absolute; TOP: 30px; VISIBILITY: hidden; WIDTH: 320px
}
#divContent {
LEFT: 0px; POSITION: absolute; TOP: 0px
}
H1 {
FONT: bold 11px Tahoma, Arial, Helvetica, sans-serif
}
BODY {
FONT: 11px Tahoma, Arial, Helvetica, sans-serif
}
P {
FONT: 11px Tahoma, Arial, Helvetica, sans-serif
}
A {
COLOR: #009999; FONT: 11px Tahoma, Arial, Helvetica, sans-serif; TEXT-DECORATION: none
}
A:hover {
COLOR: #009999; FONT: 11px Tahoma, Arial, Helvetica, sans-serif; TEXT-DECORATION: underline
}
</STYLE>
<script language="JavaScript">
<!--
function SymError()
{
return true;
}
window.onerror = SymError;
var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen;
//-->
</script>
<SCRIPT language=JavaScript>
<!--
// begin absolutely positioned scrollable area object scripts
function verifyCompatibleBrowser(){
this.ver=navigator.appVersion
this.dom=document.getElementById?1:0
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
this.ie4=(document.all && !this.dom)?1:0;
this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
return this
}
bw=new verifyCompatibleBrowser()
var speed=50
var loop, timer
function ConstructObject(obj,nest){
nest=(!nest) ? '':'document.'+nest+'.'
this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight
this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight
this.up=MoveAreaUp;this.down=MoveAreaDown;
this.MoveArea=MoveArea; this.x; this.y;
this.obj = obj + "Object"
eval(this.obj + "=this")
return this
}
function MoveArea(x,y){
this.x=x;this.y=y
this.css.left=this.x
this.css.top=this.y
}
function MoveAreaDown(move){
if(this.y>-this.scrollHeight+objContainer.clipHeight){
this.MoveArea(0,this.y-move)
if(loop) setTimeout(this.obj+".down("+move+")",speed)
}
}
function MoveAreaUp(move){
if(this.y<0){
this.MoveArea(0,this.y-move)
if(loop) setTimeout(this.obj+".up("+move+")",speed)
}
}
function PerformScroll(speed){
if(initialised){
loop=true;
if(speed>0) objScroller.down(speed)
else objScroller.up(speed)
}
}
function CeaseScroll(){
loop=false
if(timer) clearTimeout(timer)
}
var initialised;
function InitialiseScrollableArea(){
objContainer=new ConstructObject('divContainer')
objScroller=new ConstructObject('divContent','divContainer')
objScroller.MoveArea(0,0)
objContainer.css.visibility='visible'
initialised=true;
}
// end absolutely positioned scrollable area object scripts
function MM_displayStatusMsg(msgStr) { //v1.0
status=msgStr;
document.MM_returnValue = true;
}
//-->
</SCRIPT>
<SCRIPT language=JavaScript>
<!--
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</SCRIPT>
<META content="MSHTML 5.00.2314.1000" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff
onload="InitialiseScrollableArea();">
<!-- begin absolutely positioned scrollable area object-->
<DIV id=divUpControl><A href="javascript:;"
onmouseout=CeaseScroll();MM_swapImgRestore()
onmouseover="PerformScroll(-7);MM_displayStatusMsg('Scroll Up');MM_swapImage('scroller_up_button','','scroller_up_button_f2.gif',0);return document.MM_returnValue"><IMG
alt=Up border=0 height=18 name=scroller_up_button
src="scroller_up_button.gif" width=33></A></DIV>
<DIV id=divDownControl><A href="javascript:;"
onmouseout=CeaseScroll();MM_swapImgRestore()
onmouseover="PerformScroll(7);MM_displayStatusMsg('Scroll Down');MM_swapImage('scroller_down_button','','scroller_down_button_f2.gif',0);return document.MM_returnValue"><IMG
alt=Down border=0 height=18 name=scroller_down_button
src="scroller_down_button.gif" width=33></A></DIV>
<DIV id=divContainer>
<DIV id=divContent><B>Scroll Area Content Start</B>
<P><IMG align=left height=75 hspace=5
src="temp_dgm_roadster_small.jpg" vspace=5 width=100>An example to demonstrate
that the scrollable area can contain content other than text. Lorem ipsum
dolor sit amet, consectetur adipscing elit, sed diam nonnumy eiusmod tempor
incidunt ut labore et dolore magna aliquam erat volupat.</P>
<P>Et harumd dereud facilis est er expedit distinct. Nam liber a tempor cum
soluta nobis eligend optio comque nihil quod a impedit anim id quod maxim
placeat facer possim omnis es voluptas assumenda est, omnis dolor repellend.
Temporem autem quinsud et aur office debit aut tum rerum necesit atib saepe
eveniet ut er repudiand sint et molestia non este recusand.</P>
<P>Lorem ipsum dolor sit amet, consectetur adipscing elit, sed diam nonnumy
eiusmod tempor incidunt ut labore et dolore magna aliquam erat volupat.</P>
<P><IMG align=left height=75 hspace=5
src="temp_dgm_roadster_small.jpg" vspace=5 width=100>Et harumd dereud facilis
est er expedit distinct. Nam liber a tempor cum soluta nobis eligend optio
comque nihil quod a impedit anim id quod maxim placeat facer possim omnis
es voluptas assumenda est, omnis dolor repellend. Temporem autem quinsud
et aur office debit aut tum rerum necesit atib saepe eveniet ut er repudiand
sint et molestia non este recusand.</P>
<P>Lorem ipsum dolor sit amet, consectetur adipscing elit, sed diam nonnumy
eiusmod tempor incidunt ut labore et dolore magna aliquam erat volupat.</P>
<P>Et harumd dereud facilis est er expedit distinct. Nam liber a tempor cum
soluta nobis eligend optio comque nihil quod a impedit anim id quod maxim
placeat facer possim omnis es voluptas assumenda est, omnis dolor repellend.
Temporem autem quinsud et aur office debit aut tum rerum necesit atib saepe
eveniet ut er repudiand sint et molestia non este recusand.</P>
<P>Lorem ipsum dolor sit amet, consectetur adipscing elit, sed diam nonnumy
eiusmod tempor incidunt ut labore et dolore magna aliquam erat volupat.</P>
<P>Et harumd dereud facilis est er expedit distinct. Nam liber a tempor cum
soluta nobis eligend optio comque nihil quod a impedit anim id quod maxim
placeat facer possim omnis es voluptas assumenda est, omnis dolor repellend.
Temporem autem quinsud et aur office debit aut tum rerum necesit atib saepe
eveniet ut er repudiand sint et molestia non este recusand.</P><B>Scroll Area
Content End</B> </DIV></DIV>
<!-- end absolutely positioned scrollable area object -->
</BODY></HTML>
<script language="JavaScript">
<!--
var SymRealOnLoad;
var SymRealOnUnload;
function SymOnUnload()
{
window.open = SymWinOpen;
if(SymRealOnUnload != null)
SymRealOnUnload();
}
function SymOnLoad()
{
if(SymRealOnLoad != null)
SymRealOnLoad();
window.open = SymRealWinOpen;
SymRealOnUnload = window.onunload;
window.onunload = SymOnUnload;
}
SymRealOnLoad = window.onload;
window.onload = SymOnLoad;
//-->
</script>
ho provato a togliere il doctype e in questo modo anche su firefox funziona, ma ovviamente così la validazione è impensabile.
non è che qualcuno sa come risolvere il problema o mi sa indicare qualche altro script???è importante!!!!!!!!!!!!!!
grazie a tutti!!!
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="it">
<HEAD><TITLE>dHTML AP Scrollable Area Customised Demo with Images in the Content</TITLE>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<STYLE type=text/css>#divUpControl {
HEIGHT: 30px; LEFT: 10px; POSITION: absolute; TEXT-ALIGN: right; TOP: 10px; WIDTH: 320px; Z-INDEX: 1
}
#divDownControl {
HEIGHT: 30px; LEFT: 10px; POSITION: absolute; TEXT-ALIGN: right; TOP: 270px; WIDTH: 320px; Z-INDEX: 1
}
#divContainer {
CLIP: rect(0px 320px 240px 0px); HEIGHT: 240px; LEFT: 10px; OVERFLOW: hidden; POSITION: absolute; TOP: 30px; VISIBILITY: hidden; WIDTH: 320px
}
#divContent {
LEFT: 0px; POSITION: absolute; TOP: 0px
}
H1 {
FONT: bold 11px Tahoma, Arial, Helvetica, sans-serif
}
BODY {
FONT: 11px Tahoma, Arial, Helvetica, sans-serif
}
P {
FONT: 11px Tahoma, Arial, Helvetica, sans-serif
}
A {
COLOR: #009999; FONT: 11px Tahoma, Arial, Helvetica, sans-serif; TEXT-DECORATION: none
}
A:hover {
COLOR: #009999; FONT: 11px Tahoma, Arial, Helvetica, sans-serif; TEXT-DECORATION: underline
}
</STYLE>
<script language="JavaScript">
<!--
function SymError()
{
return true;
}
window.onerror = SymError;
var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen;
//-->
</script>
<SCRIPT language=JavaScript>
<!--
// begin absolutely positioned scrollable area object scripts
function verifyCompatibleBrowser(){
this.ver=navigator.appVersion
this.dom=document.getElementById?1:0
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
this.ie4=(document.all && !this.dom)?1:0;
this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
return this
}
bw=new verifyCompatibleBrowser()
var speed=50
var loop, timer
function ConstructObject(obj,nest){
nest=(!nest) ? '':'document.'+nest+'.'
this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight
this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight
this.up=MoveAreaUp;this.down=MoveAreaDown;
this.MoveArea=MoveArea; this.x; this.y;
this.obj = obj + "Object"
eval(this.obj + "=this")
return this
}
function MoveArea(x,y){
this.x=x;this.y=y
this.css.left=this.x
this.css.top=this.y
}
function MoveAreaDown(move){
if(this.y>-this.scrollHeight+objContainer.clipHeight){
this.MoveArea(0,this.y-move)
if(loop) setTimeout(this.obj+".down("+move+")",speed)
}
}
function MoveAreaUp(move){
if(this.y<0){
this.MoveArea(0,this.y-move)
if(loop) setTimeout(this.obj+".up("+move+")",speed)
}
}
function PerformScroll(speed){
if(initialised){
loop=true;
if(speed>0) objScroller.down(speed)
else objScroller.up(speed)
}
}
function CeaseScroll(){
loop=false
if(timer) clearTimeout(timer)
}
var initialised;
function InitialiseScrollableArea(){
objContainer=new ConstructObject('divContainer')
objScroller=new ConstructObject('divContent','divContainer')
objScroller.MoveArea(0,0)
objContainer.css.visibility='visible'
initialised=true;
}
// end absolutely positioned scrollable area object scripts
function MM_displayStatusMsg(msgStr) { //v1.0
status=msgStr;
document.MM_returnValue = true;
}
//-->
</SCRIPT>
<SCRIPT language=JavaScript>
<!--
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</SCRIPT>
<META content="MSHTML 5.00.2314.1000" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff
onload="InitialiseScrollableArea();">
<!-- begin absolutely positioned scrollable area object-->
<DIV id=divUpControl><A href="javascript:;"
onmouseout=CeaseScroll();MM_swapImgRestore()
onmouseover="PerformScroll(-7);MM_displayStatusMsg('Scroll Up');MM_swapImage('scroller_up_button','','scroller_up_button_f2.gif',0);return document.MM_returnValue"><IMG
alt=Up border=0 height=18 name=scroller_up_button
src="scroller_up_button.gif" width=33></A></DIV>
<DIV id=divDownControl><A href="javascript:;"
onmouseout=CeaseScroll();MM_swapImgRestore()
onmouseover="PerformScroll(7);MM_displayStatusMsg('Scroll Down');MM_swapImage('scroller_down_button','','scroller_down_button_f2.gif',0);return document.MM_returnValue"><IMG
alt=Down border=0 height=18 name=scroller_down_button
src="scroller_down_button.gif" width=33></A></DIV>
<DIV id=divContainer>
<DIV id=divContent><B>Scroll Area Content Start</B>
<P><IMG align=left height=75 hspace=5
src="temp_dgm_roadster_small.jpg" vspace=5 width=100>An example to demonstrate
that the scrollable area can contain content other than text. Lorem ipsum
dolor sit amet, consectetur adipscing elit, sed diam nonnumy eiusmod tempor
incidunt ut labore et dolore magna aliquam erat volupat.</P>
<P>Et harumd dereud facilis est er expedit distinct. Nam liber a tempor cum
soluta nobis eligend optio comque nihil quod a impedit anim id quod maxim
placeat facer possim omnis es voluptas assumenda est, omnis dolor repellend.
Temporem autem quinsud et aur office debit aut tum rerum necesit atib saepe
eveniet ut er repudiand sint et molestia non este recusand.</P>
<P>Lorem ipsum dolor sit amet, consectetur adipscing elit, sed diam nonnumy
eiusmod tempor incidunt ut labore et dolore magna aliquam erat volupat.</P>
<P><IMG align=left height=75 hspace=5
src="temp_dgm_roadster_small.jpg" vspace=5 width=100>Et harumd dereud facilis
est er expedit distinct. Nam liber a tempor cum soluta nobis eligend optio
comque nihil quod a impedit anim id quod maxim placeat facer possim omnis
es voluptas assumenda est, omnis dolor repellend. Temporem autem quinsud
et aur office debit aut tum rerum necesit atib saepe eveniet ut er repudiand
sint et molestia non este recusand.</P>
<P>Lorem ipsum dolor sit amet, consectetur adipscing elit, sed diam nonnumy
eiusmod tempor incidunt ut labore et dolore magna aliquam erat volupat.</P>
<P>Et harumd dereud facilis est er expedit distinct. Nam liber a tempor cum
soluta nobis eligend optio comque nihil quod a impedit anim id quod maxim
placeat facer possim omnis es voluptas assumenda est, omnis dolor repellend.
Temporem autem quinsud et aur office debit aut tum rerum necesit atib saepe
eveniet ut er repudiand sint et molestia non este recusand.</P>
<P>Lorem ipsum dolor sit amet, consectetur adipscing elit, sed diam nonnumy
eiusmod tempor incidunt ut labore et dolore magna aliquam erat volupat.</P>
<P>Et harumd dereud facilis est er expedit distinct. Nam liber a tempor cum
soluta nobis eligend optio comque nihil quod a impedit anim id quod maxim
placeat facer possim omnis es voluptas assumenda est, omnis dolor repellend.
Temporem autem quinsud et aur office debit aut tum rerum necesit atib saepe
eveniet ut er repudiand sint et molestia non este recusand.</P><B>Scroll Area
Content End</B> </DIV></DIV>
<!-- end absolutely positioned scrollable area object -->
</BODY></HTML>
<script language="JavaScript">
<!--
var SymRealOnLoad;
var SymRealOnUnload;
function SymOnUnload()
{
window.open = SymWinOpen;
if(SymRealOnUnload != null)
SymRealOnUnload();
}
function SymOnLoad()
{
if(SymRealOnLoad != null)
SymRealOnLoad();
window.open = SymRealWinOpen;
SymRealOnUnload = window.onunload;
window.onunload = SymOnUnload;
}
SymRealOnLoad = window.onload;
window.onload = SymOnLoad;
//-->
</script>