Reply
filters.alpha Javascript problem
Old 01-27-2005, 07:55 AM filters.alpha Javascript problem
Super Talker

Posts: 121
I am using someones code but itt deosnt work in IE(works fine in FireFox) and im getting the error: 'filters.alpha' is null or not an object can anyone tell me why?
vegancoder is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 01-28-2005, 07:20 AM
ACJavascript's Avatar
Humble Mod

Posts: 548
Location: CT, USA
Please post the code
__________________
CYTech-services.com - 100 Satisfied Customers - Custom Programming and Web Development
ACJavascript is offline
Reply With Quote
View Public Profile Visit ACJavascript's homepage!
 
Old 01-28-2005, 09:10 AM
Super Talker

Posts: 121
here you go

HTML Code:
JSFX.ImageFadeAnimation = function()
{
	JSFX.ImageFadeRunning = false;
	for(i=0 ; i<document.images.length ; i++)
	{
		var img = document.images[i];
		if(img.state)
		{
			if(img.state == "FADE_IN")
			{
				img.index+=FadeInStep;

				if(img.index > 100)
					img.index = 100;

				if(img.filters)
					img.filters.alpha.opacity = img.index;
				else
					img.style.MozOpacity = img.index/101;

				if(img.index == 100)
					img.state="ON";
				else
					JSFX.ImageFadeRunning = true;
			}
			else if(img.state == "FADE_IN_OUT")
			{
				img.index+=FadeInStep;
				if(img.index > 100)
					img.index = 100;

				if(img.filters)
					img.filters.alpha.opacity = img.index;
				else 
					img.style.MozOpacity = img.index/101;

	
				if(img.index == 100)
					img.state="FADE_OUT";

				JSFX.ImageFadeRunning = true;
			}
			else if(img.state == "FADE_OUT")
			{
				img.index-=FadeOutStep;
				if(img.index < 0)
					img.index = 0;

				if(img.filters)
					img.filters.alpha.opacity = img.index;
				else
					img.style.MozOpacity = img.index/101;


				if(img.index == 0)
					img.state="OFF";
				else
					JSFX.ImageFadeRunning = true;
			}
			else if(img.state == "FADE_OUT_IN")
			{
				img.index-=FadeOutStep;
				if(img.index < 0)
					img.index = 0;

				if(img.filters)
					img.filters.alpha.opacity = img.index;
				else
					img.style.MozOpacity = img.index/101;

				if(img.index == 0)
				{
					img.src = img.next_on;
					img.currSrc = img.next_on;
					img.state="FADE_IN";
				}
				JSFX.ImageFadeRunning = true;
			}
		}
	}
	/*** Check to see if we need to animate any more frames. ***/
	if(JSFX.ImageFadeRunning)
		setTimeout("JSFX.ImageFadeAnimation()", JSFX.ImageFadeInterval);
}
vegancoder is offline
Reply With Quote
View Public Profile
 
Old 01-28-2005, 04:34 PM
ACJavascript's Avatar
Humble Mod

Posts: 548
Location: CT, USA
I do not recongnize this code:


JSFX.

I am thinking, javascript Effect??

Its possible that this will only work in firefox.

Anyone else have an idea?
__________________
CYTech-services.com - 100 Satisfied Customers - Custom Programming and Web Development
ACJavascript is offline
Reply With Quote
View Public Profile Visit ACJavascript's homepage!
 
Old 10-30-2006, 01:13 AM Re: filters.alpha Javascript problem
Junior Talker

Posts: 1
Name: Corey Farrell
img.filters.alpha.opacity = img.index;

change this line to read:
img.style.filter = 'alpha(opacity='+img.index+')';
corey_farrell is offline
Reply With Quote
View Public Profile
 
Old 10-30-2006, 02:49 AM Re: filters.alpha Javascript problem
chrishirst's Avatar
Super Moderator

Posts: 12,816
Location: Blackpool. UK
Are you using a correct and valid doctype?
and, if you are using XHTML1.n do you have the <? xml ...> declaration above it? because that will negate the doctype for IE.

posting a URI so we can see the issue directly would be helpful.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to filters.alpha Javascript problem
 

Thread Tools

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

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




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.21473 seconds with 13 queries