|
|
@ -35,9 +35,17 @@ $(function() { |
|
|
|
contentPadding = parseInt($('.docs-content').css('padding-bottom')); |
|
|
|
contentPadding = parseInt($('.docs-content').css('padding-bottom')); |
|
|
|
footerHeight = $('.docs-footer').outerHeight(false); |
|
|
|
footerHeight = $('.docs-footer').outerHeight(false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Device placment
|
|
|
|
device.initialLeft = device.offset().left; |
|
|
|
device.initialLeft = device.offset().left; |
|
|
|
device.initialTop = device.initialTop || device.offset().top; |
|
|
|
device.initialTop = device.initialTop || device.offset().top; |
|
|
|
device.dockingOffset = ($(window).height() - device.height())/2; |
|
|
|
device.dockingOffset = ($(window).height() - device.height())/2; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(device.dockingOffset); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Toggle placment
|
|
|
|
|
|
|
|
toggleTop = platformToggle.offset().top; |
|
|
|
|
|
|
|
toggleHeight = platformToggle.outerHeight(); |
|
|
|
|
|
|
|
|
|
|
|
checkDesktopContent(); |
|
|
|
checkDesktopContent(); |
|
|
|
calculateScroll(); |
|
|
|
calculateScroll(); |
|
|
|
|
|
|
|
|
|
|
@ -107,7 +115,7 @@ $(function() { |
|
|
|
var contentSectionItem; |
|
|
|
var contentSectionItem; |
|
|
|
var currentTop = win.scrollTop(); |
|
|
|
var currentTop = win.scrollTop(); |
|
|
|
|
|
|
|
|
|
|
|
if((device.initialTop - currentTop) <= device.dockingOffset + 113) { |
|
|
|
if((device.initialTop - currentTop) <= device.dockingOffset) { |
|
|
|
device[0].className = "device device-fixed"; |
|
|
|
device[0].className = "device device-fixed"; |
|
|
|
device.css({top: device.dockingOffset}) |
|
|
|
device.css({top: device.dockingOffset}) |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -115,10 +123,10 @@ $(function() { |
|
|
|
device[0].setAttribute('style','') |
|
|
|
device[0].setAttribute('style','') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(currentTop >= $('.docs-masthead').outerHeight()) { |
|
|
|
if(currentTop >= toggleTop) { |
|
|
|
platformToggle.addClass('fixed'); |
|
|
|
platformToggle.addClass('fixed'); |
|
|
|
$('.docs-components').css('padding-top', platformToggle.outerHeight()); |
|
|
|
$('.docs-components').css('padding-top', toggleHeight); |
|
|
|
} else { |
|
|
|
} else if (currentTop <= $('.docs-header').outerHeight()) { |
|
|
|
platformToggle.removeClass('fixed'); |
|
|
|
platformToggle.removeClass('fixed'); |
|
|
|
$('.docs-components').css('padding-top', 0); |
|
|
|
$('.docs-components').css('padding-top', 0); |
|
|
|
} |
|
|
|
} |
|
|
|