How to use JQuery & Mootools with scroll method in SocialEngine?

How to use JQuery & Mootools with scroll method in SocialEngine?

Add Comment
1 Answer(s)
Best answer

First you should be aware that the $ sign is used by Mootools to get an element by its id – $(‘myID’). As such if you use it in conjunction with jQuery you may encounter issues. However it can be replaced by document.id(‘myID’) which will do the same job.

Now we will include two examples of showing how this can be achieved:jQuery:

jQuery.noConflict();

jQuery(window).scroll(function() {

jQuery('#menu1').toggle(jQuery(this).scrollTop() > 350);

});

a) MooTools:

window.addEvent('scroll', function () {

var scroll = window.getScroll().y;

scroll > 350 ? $('menu1').show() : $('menu1').hide();

});

Geraldine Stevens Answered on November 23, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.