|
|
@ -35,7 +35,7 @@ $(function() { |
|
|
|
|
|
|
|
|
|
|
|
iphone.initialLeft = iphone.offset().left; |
|
|
|
iphone.initialLeft = iphone.offset().left; |
|
|
|
iphone.initialTop = iphone.initialTop || iphone.offset().top; |
|
|
|
iphone.initialTop = iphone.initialTop || iphone.offset().top; |
|
|
|
iphone.dockingOffset = ($(window).height() + $('.platform-toggle').height() - iphone.height())/2; |
|
|
|
iphone.dockingOffset = ($(window).height() + $('.platform-toggle').outerHeight() - iphone.height())/2; |
|
|
|
checkDesktopContent(); |
|
|
|
checkDesktopContent(); |
|
|
|
calculateScroll(); |
|
|
|
calculateScroll(); |
|
|
|
|
|
|
|
|
|
|
@ -88,7 +88,7 @@ $(function() { |
|
|
|
if(pageHeight - currentTop < footerHeight + contentPadding + 1400) { |
|
|
|
if(pageHeight - currentTop < footerHeight + contentPadding + 1400) { |
|
|
|
iphone[0].className = "iphone iphone-bottom"; |
|
|
|
iphone[0].className = "iphone iphone-bottom"; |
|
|
|
iphone[0].setAttribute('style','') |
|
|
|
iphone[0].setAttribute('style','') |
|
|
|
} else if((iphone.initialTop - currentTop) <= iphone.dockingOffset + 40) { |
|
|
|
} else if((iphone.initialTop - currentTop) <= iphone.dockingOffset + 41) { |
|
|
|
iphone[0].className = "iphone iphone-fixed"; |
|
|
|
iphone[0].className = "iphone iphone-fixed"; |
|
|
|
iphone.css({top: iphone.dockingOffset}) |
|
|
|
iphone.css({top: iphone.dockingOffset}) |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -98,10 +98,10 @@ $(function() { |
|
|
|
|
|
|
|
|
|
|
|
if(currentTop >= $('.docs-masthead').outerHeight()) { |
|
|
|
if(currentTop >= $('.docs-masthead').outerHeight()) { |
|
|
|
$('.platform-toggle').addClass('fixed'); |
|
|
|
$('.platform-toggle').addClass('fixed'); |
|
|
|
console.log('fixed'); |
|
|
|
$('.docs-components').css('padding-top', $('.platform-toggle').outerHeight()); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$('.platform-toggle').removeClass('fixed'); |
|
|
|
$('.platform-toggle').removeClass('fixed'); |
|
|
|
console.log('not fixed'); |
|
|
|
$('.docs-components').css('padding-top', 0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Injection of components into phone
|
|
|
|
// Injection of components into phone
|
|
|
@ -131,4 +131,4 @@ $(function() { |
|
|
|
|
|
|
|
|
|
|
|
$(window).on('load resize', initialize); |
|
|
|
$(window).on('load resize', initialize); |
|
|
|
$(window).on('load', function () { new FingerBlast('.iphone-content'); }); |
|
|
|
$(window).on('load', function () { new FingerBlast('.iphone-content'); }); |
|
|
|
}); |
|
|
|
}); |
|
|
|