main.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. $(document).ready(function(){
  2. var optionsFloating = $('#optionsFloating');
  3. var defaultOptionsTop = optionsFloating.offset().top;
  4. var defaultOptionsBottom = $('#downloadTarget').offset().top - $(window).height();
  5. var defaultOptionsWidth = optionsFloating.width();
  6. $(window).scroll(function(){
  7. if( $(window).scrollTop() > defaultOptionsTop - 100 && $(window).scrollTop() < defaultOptionsBottom ){
  8. optionsFloating.addClass('fixed');
  9. optionsFloating.width(defaultOptionsWidth)
  10. }else{
  11. optionsFloating.removeClass('fixed');
  12. }
  13. })
  14. $('.scrollToLink').on('click',function(){
  15. var divId = $(this).attr('data-scroll');
  16. var scrollTop = $('#'+divId).offset().top - 10;
  17. $('html, body').animate({ scrollTop: scrollTop+'px' });
  18. })
  19. $('#web_by').hover(function(){
  20. $('#jobotic').animate({right:'80px'},600, function(){ $('#web_by label').css('display','block'); });
  21. },
  22. function(){
  23. $('#web_by label').css('display','none').stop(true, true)
  24. $('#jobotic').animate({right:'1900px'},1800, function(){ $('#jobotic').css('right','-100px').stop(true, true) })
  25. });
  26. $('#web_by').click(function(){ window.location.href = 'http://www.steinlinconsulting.com';});
  27. })