Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function($) {
- $.fn.createStickyObject = function() {
- var $alert_box = [];
- //var $selector = $(this.selector);
- //console.log("hotfix "+$this.selector);
- //var $selector = $this.selector;
- $(window).scroll(function() {
- if (!$alert_box.length) {
- $alert_box = $('#emall-alert-create form');
- }
- if ($alert_box.length){
- var scrollTop = $(window).scrollTop();
- // We must calculate the top always as the user
- // may deploy the prices box when there are multiple.
- var alert_box_offset_top = $alert_box.offset().top;
- if(scrollTop > alert_box_offset_top) {
- //$selector.removeClass('element-invisible');
- $(".emall-sticky-menu").removeClass('element-invisible');
- }
- else {
- //$selector.addClass('element-invisible');
- $(".emall-sticky-menu").addClass('element-invisible');
- }
- }
- });
- };
- Drupal.behaviors.sticky_menu = {
- attach : function(context, settings) {
- var $menu = $('div.emall-sticky-menu', context);
- $menu.createStickyObject({
- duration: 0,
- unstick: false,
- });
- }
- };
- })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement