Web Design Forum  
 
Go Back   Web Design Forum > Web Software > Scripts

Reply
 
LinkBack Thread Tools Display Modes
Old 09-11-2007, 06:41 AM   #1 (permalink)
New Member
 
Join Date: Apr 2007
Location: Coon Rapids, MN
Posts: 3
Send a message via MSN to WorkAholicT Send a message via Yahoo to WorkAholicT
Default Blending Images with JavaScript

I am trying to edit my script so the multiple images can blend in and out of each other. My script will work in one table cell but then it won't work when I place it in another cell further on in the page. Any advice?

The following is the script I'm using.

<script type = "text/javascript">
<!--
var whichImage = true;

function blend()
{
if ( whichImage ) {
image1.filters( "blendTrans" ).apply();
image1.style.visibility = "hidden";
image1.filters( "blendTrans" ).play();
}
else {
image2.filters( "blendTrans" ).apply();
image2.style.visibility = "hidden";
image2.filters( "blendTrans" ).play();
}
}

function reBlend ( fromImage )
{
if ( fromImage ) {
image1.style.zIndex -= 2;
image1.style.visibility = "visible";
}
else {
image1.style.zIndex += 2;
image2.style.visibility = "visible";
}

whichImage = !whichImage;
blend();
}
// -->
</script>

This is what I have in my table cell to call the function and blend the images.

<img id = "image2" width="400" height="175" src = "...."
onfilterchange = "reBlend( false )"
style = "position: absolute; filter: blendTrans( duration = 4 );
z-index: 1" alt = "First Transition Image" />

<img id = "image1" width="400" height="175" src = "..."
onfilterchange = "reBlend( true )"
style = "position: absolute; filter: blendTrans( duration = 4 );
z-index: 2" alt = "Second Transition Image" />

Thank you.
WorkAholicT is offline   Reply With Quote
Old 12-03-2007, 03:44 PM   #2 (permalink)
New Member
 
Join Date: Oct 2007
Posts: 13
Default mootools

Have you tried using the Mootools javasript library?

http://mootools.net/

I've used it on my site to blend images as you describe see here:

midwinterDesign | creative website design service, Abingdon, Oxfordshire
__________________
midwinterDesign creative website design
dmidwinter is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 06:42 AM.


Computer Forum - Internet Business - Webpage Design

 
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.