Copy link to clipboard
Copied
hi, how do you add an ease transition of 0.5s to the rollover images after inserting them with the dreamviewer cc snippet?
I have no use for those outdated MM rollover behaviors. I'm kind of surprised DW hasn't deprecated them.
You can do exactly what you want with CSS. But keep in mind that touch devices don't have a mouse so hover effects don't do anything.
Copy link to clipboard
Copied
Which snippet are you talking about?
Please show us your code.
Copy link to clipboard
Copied
<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('porsche_356','','assets/porsche_356_sabbiatura_dopo_300x200.jpg',1)">
<img src="assets/porsche_356_sabbiatura_prima_300x200.jpg" alt="" width="300" height="200" class="img-lavorazioni" id="porsche_356"></a>
<script>
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_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
}
function MM_findObj(n, d) { //v4.01
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
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x && d.getElementById) x=d.getElementById(n); 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>
this is the test published:
Copy link to clipboard
Copied
I have no use for those outdated MM rollover behaviors. I'm kind of surprised DW hasn't deprecated them.
You can do exactly what you want with CSS. But keep in mind that touch devices don't have a mouse so hover effects don't do anything.
Swap Image on Hover - With CSS
Copy link to clipboard
Copied
You're right, it's better this way, maybe even try to disable it for smartphones.