7

I need to add an effect to my link with jQuery but it only works in min 1.7.1, and I have another code that only worked in 1.10.2.

This code works only in 1.10.2

$(document).ready(function(){
    var menu = document.querySelector('#menu-bar-wrapper');
    var origOffsetY = menu.offsetTop;
    function scroll () {
        if ($(window).scrollTop() >= origOffsetY) {
            $('#menu-bar-wrapper').addClass('sticky');
            $('#latest-wrapper').addClass('menu-padding');
        } else {
            $('#menu-bar-wrapper').removeClass('sticky');
            $('#latest-wrapper').removeClass('menu-padding');
        }
    }
    document.onscroll = scroll;
});

and this work in 1.7.1 :

$(document).ready(function(){
    $('.block-content ul.menu li').hover(function(event) {
        $(this).stop().animate({ marginRight: "5px" }, {duration: 'slow',easing: 'easeOutElastic'});
    },function(){
        $(this).stop().animate({ marginRight: "0px" }, {duration: 'slow',easing: 'easeOutElastic'});
    });
});

When I open my site these two codes don't work and show me this error :

TypeError: jQuery.easing[this.easing] is not a function

percent, this.options.duration * percent, 0, 1, this.options.duration

What can I do to solved it?

DBS
  • 9,110
  • 4
  • 35
  • 53
user3133976
  • 85
  • 1
  • 2
  • 9

2 Answers2

1
a{
    color: #666;
    -webkit-transition: all 0.3s ease-out; 
    -moz-transition: all 0.3s ease-out;
    -o-transition: all 0.3s ease-out;
    -ms-transition: all 0.3s ease-out;
}
a:hover{
    cursor: pointer;
    color: #000;
    text-decoration: none;
}

This way in css

Arthur Yakovlev
  • 8,933
  • 8
  • 32
  • 48
1

You have to include the Effects Core in the jQuery UI download builder to solve this error.

silkfire
  • 24,585
  • 15
  • 82
  • 105