/    Sign up×
Community /Pin to ProfileBookmark

question about image transforming

I want to make a picture (like preview thumbnail) to have a white mask over it, while the mouse is over the picture , the mask fade out.

I set the opacity of the image to about 60 with white background to get the white mask effect , but i don’t know how to transform it (fade it out).

i try to use the following code :
onmouseover=”this.filters.alpha.opacity = 100;”
onmouseout=”this.filters.alpha.opacity = 60;”
it does make the mask effect, but it immediately remove the mask which is not fading it out.

then i try to use the following code :
onmouseover = ‘ this.style.filter=”progid?XImageTransform.Microsoft.Fade(Overlap=1.00,duration=2.0) alpha(opacity=0,style=0)” ‘
onmouseout = ‘ …….. ‘
but it doesn’t work ……..
i found that the opacity setting is done immediate but not waiting for the filters.fade.play() to trigger it to transform.

i don’t want to use two images cross fading to make this effect , i only want to use one image to do it.
is there any way to do it ??

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @Chanie spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...