Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('*[data-toggle="dropdown"]').click(function (e) {
- // X postion get
- var viewPortHeight = $(window).height();
- var getCurrentPostion = e.clientY;
- // set automatic position in viewport
- console.log(viewPortHeight, getCurrentPostion);
- // if ((viewPortHeight - selfPostion) < droplistHeight) {
- if ((viewPortHeight / 2) < getCurrentPostion) {
- console.log('if');
- $(this).parent().removeClass('dropdown');
- $(this).parent().addClass('dropup');
- } else {
- console.log('else');
- $(this).parent().removeClass('dropup');
- $(this).parent().addClass('dropdown');
- }
- });
Add Comment
Please, Sign In to add comment