|
Hi,
It would be great if someone could provide me with javascript code that would give a dissolve effect for images. I am right now doing it using the following code, but it works only with IE. If this code can be modified so that it would support all browsers, it would be great.
<script language="JavaScript" type="text/javascript">
var RunningIE4 = (msieversion() >=4);
function msieversion() {
var ua = window.navigator.userAgent
var msie = ua.indexOf ( "MSIE " )
if ( msie > 0 ) // is Microsoft Internet Explorer; return version number
return parseInt ( ua.substring ( msie+5, ua.indexOf ( ".", msie ) ) )
else
return 0 // is other browser
}
if (RunningIE4) {
changePic = dissolvePix
} else {
changePic = switchPic}
function switchPic(picObj, newSrc) {
picObj.src = newSrc}
function dissolvePix(picObj, imgfile){
// This is for IE4 or later, and dissolves the images together using a visual filter.
picObj.filters.revealTrans.Apply();
picObj.src = imgfile
picObj.filters.revealTrans.Play()
} // end of function
</script>
<form>
<input type="button" value="Stonehenge" onclick='changePic(document.images["image1"], "stonehenge.jpg")'>
</form>
Thanks & Regards,
Frenz
|
|
|
Beautiful blog with great informational content. Mostly certifications related and images using Javascript! related topics are really very good. testking 646-656, testking 646-671 and testking 646-976 are also good topics. Thanks for this great sharing.
|
|
|
|
|
|
|
|