Mouse over function

Can anybody help

Im trying to create a mouse over function which shows a black or grey state over the image

the same way this link below does it

http://themes.premiumpixels.com/?theme=artiste

at the moment I have function using two images but wanted to try and make it faster with just a colour

I have tried but my coding isnt the best

can some one show me how please

Stu


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Apply the Protaculous Action to your page, and choose ‘scriptaculous-packed’ from the Library picker. Click on the top Function Body button, and paste in the following script:

$$('a img').each(function(elm){
  elm.observe('mouseover',function(evt){
    elm.morph('opacity:0.4', {duration: 0.4});
  });
  elm.observe('mouseout',function(evt){
    elm.morph('opacity:1', {duration: 0.4});
  });
});

This will add the effect to all images that are children of link tags, so any graphic box you have added a link to in the usual way, or that an Action has added a link to (such as Showcase), will get the effect.

If you want to scope this effect to only one part of your page, say all such image links that are children of one HTML box, then simply click once on that HTML box and make a note of the name that Freeway (or you) have assigned to that box in the Title field of the Inspector. Then modify the script above to include the ID of the HTML box that all those linked images appear within:

$$('#item42 a img').each(function(elm){
...

This effect will be visible in modern browsers, wherever opacity is understood. I suspect that IE 7 and lower will be out of luck, but the beautiful thing about this approach is that you don’t stop these aging browsers from using the link and you don’t punish modern browsers by building the effect with a very-old-school rollover image swap.

Walter

On Feb 21, 2012, at 3:21 AM, stuart wrote:

Can anybody help

Im trying to create a mouse over function which shows a black or grey state over the image

the same way this link below does it

http://themes.premiumpixels.com/?theme=artiste

at the moment I have function using two images but wanted to try and make it faster with just a colour

I have tried but my coding isnt the best

can some one show me how please

Stu


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options