Firstly, I apologise. I should be able to do this, finally got it working on Drupal 6 but now find myself back at square 1. More of a front-end guy so apologies for my lack of depth of knowledge, I am quite simply looking to call jquery in Drupal 7. I've tried in vain the official threads and a million searches...
1 div, on rollover to disappear and reveal the picture below, a nice effect! Could someone translate the below D6 code into the new D7 format for me. I have tried everything and cut and hacked a million examples but cannot get this working in D7. (Yes, I have placed the JQuery function tags in my js file!)
Anyway to convert
Drupal.behaviors.changeOver = function(context) {
$('.img-above').mouseover(function(){
$(this).stop().animate({"opacity": "0"}, 3000);
}).mouseout(function(){
$(this).stop().animate({"opacity": "1"}, 550);
})
}
to my mind it SHOULD (but isn't, don't copy!!!) be something like this...
(function ($) {
Drupal.behaviors.changeOver = {
attach: function(context, settings) {
$('.img-above', context).mouseover(function () {
$(this).stop.animate({"opacity": "0"}, 3000);})
$('.img-above', context).mouseout(function () {
$(this).stop.animate({"opacity": "1"}, 500);)
});
}
};
})(jQuery);