Skip to content

Commit 797593f

Browse files
committed
Fixes #72 - Missing navigation binding functions on build
1 parent f1606e5 commit 797593f

File tree

5 files changed

+51
-38
lines changed

5 files changed

+51
-38
lines changed

dist/jquery.multiscroll.js

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -290,24 +290,30 @@
290290
}
291291
});
292292

293-
//navigation action
294-
$(document).on('click', '#multiscroll-nav a', function(e){
293+
function navClickHandler(e) {
295294
e.preventDefault();
296295
var index = $(this).parent().index();
297296
scrollPage($('.ms-left .ms-section').eq(index));
298-
});
297+
}
298+
299+
//navigation action
300+
$(document).on('click', '#multiscroll-nav a', navClickHandler);
301+
302+
function navMouseEnterHandler() {
303+
var tooltip = $(this).data('tooltip');
304+
$('<div class="multiscroll-tooltip ' + options.navigationPosition +'">' + tooltip + '</div>').hide().appendTo($(this)).fadeIn(200);
305+
}
306+
307+
function navMouseLeaveHandler() {
308+
$(this).find('.multiscroll-tooltip').fadeOut(200, function() {
309+
$(this).remove();
310+
});
311+
}
299312

300313
//navigation tooltips
301314
$(document).on({
302-
mouseenter: function(){
303-
var tooltip = $(this).data('tooltip');
304-
$('<div class="multiscroll-tooltip ' + options.navigationPosition +'">' + tooltip + '</div>').hide().appendTo($(this)).fadeIn(200);
305-
},
306-
mouseleave: function(){
307-
$(this).find('.multiscroll-tooltip').fadeOut(200, function() {
308-
$(this).remove();
309-
});
310-
}
315+
mouseenter: navMouseEnterHandler,
316+
mouseleave: navMouseLeaveHandler
311317
}, '#multiscroll-nav li');
312318

313319

@@ -856,10 +862,10 @@
856862
.on('resize', doneResizing);
857863

858864
$(document)
859-
.on('mouseenter', '#multiscroll-nav li')
860-
.on('mouseleave', '#multiscroll-nav li')
861-
.on('click', '#multiscroll-nav a');
865+
.on('mouseenter', '#multiscroll-nav li', navMouseEnterHandler)
866+
.on('mouseleave', '#multiscroll-nav li', navMouseLeaveHandler)
867+
.on('click', '#multiscroll-nav a', navClickHandler);
862868
};
863869

864870
};
865-
})(jQuery, window, document, Math);
871+
})(jQuery, window, document, Math);

0 commit comments

Comments
 (0)