2015-06-26 6 views
1

Первое сообщение здесь так эй.Наверх ссылки не будут работать

Я пытаюсь создать обратную ссылку, которую я правильно сделал много раз раньше, но на сайте, над которым я сейчас работаю, просто отказывается работать! Я пытаюсь использовать animatescroll.js, поскольку я делал много раз, но он просто отказывается работать! Любая помощь будет оценена, так как это последний кусок головоломки!

<body> 
    <div class="site-wrap" id="site-wrap"> 
     <!-- Intro Section --> 
     <div class="main-banner full-width-div"> 
      <div class="container"> 
       <div class="row" id="social"> 
        <h2><center>Pre-Register Now</center></h2> 
        <div class="col-xs-4"><center><img class="social-buttons" src="img/Twitter_Icon_Black.png"></center></div> 
        <div class="col-xs-4"><center><img class="social-buttons" src="img/Facebook_Icon_Black.png"></center></div> 
        <div class="col-xs-4"><center><img class="social-buttons" src="img/Google-Plus_Icon_Black.png"></center></div> 
       </div> 
      </div> 
     </div> 


<!-- What is Wukus Section --> 
     <div class="whatiswukus full-width-div-1"><center> 
      <h2>What is Wukus?</h2> 
      <p>Wukus is a new era of talent discovery, a revolutionary global platform putting the hottest talents in front of the people that matter. Wukus is designed by the industry for the industry; it’s not what you know, it’s who you know.</p> 
      </center> 
     <img src="img/vision.png"></div> 


<!-- Vision Section --> 

     <div class="whatiswukus full-width-div-1"><center> 
      <h2>Vision</h2> 
      <p>The Wukus vision is to impact people around the world through the power of entertainment, creating legacies and being the driver of positive change. Our philanthropic initiatives provide opportunities, rehabilitation and fun to those who need it most. Giving back is what we do best.</p> 
      </center> 
     <img src="img/dream.png"></div> 


<!-- Dream Section --> 

     <div class="whatiswukus full-width-div-1"> 
      <div id="showdream"><center><h2>Dream <i class="fa fa-plus-circle"></i></h2></center></div> 
      <div class="dreamcontent" style="display:none;"><center><p>The founders of Wukus understand that turning dreams into reality can be tough. Wukus has been designed with your needs at the forefront of everything we do, supporting you on your journey.</p> 
       </center></div> 
     <img src="img/connect.png"></div> 



<!-- Connect Section --> 

     <div class="whatiswukus full-width-div-1"> 
      <div id="showconnect"><center><h2>Connect <i class="fa fa-plus-circle"></i></h2></center></div> 
      <div class="connectcontent" style="display:none;"><center><p>Wukus connects the entertainment industry like never before; our concept goes far beyond the technology itself. Wukus culture believes in the connection of people, driven by talents working towards common goals.</p> 
       </center></div> 
     <img src="img/discover.png"></div> 



<!-- Discover Section --> 

     <div class="whatiswukus full-width-div-1"> 
      <div id="showdiscover"><center><h2>Discover <i class="fa fa-plus-circle"></i></h2></center></div> 
      <div class="discovercontent" style="display:none;"><center><p>Wukus is more than an app, it’s an experience. Our platform will not only allow industry professionals to find you at the touch of a button, but also gives you the tools to discover more about yourself, and your brand. We take discovery to the next level.</p> 
       </center></div></div> 



<!-- Not a talent section --> 

     <div class="not-a-talent full-width-div-1"> 
      <div id="shownottalent"><center><h2>Not a talent? <i class="fa fa-plus-circle"></i></h2></center></div> 
      <div class="nottalentcontent" style="display:none;"><center><p>Not a talent? Not to worry. The founders have also designed features for public users; we wouldn’t want you to miss out on the fun! ...Oh and did we mention Wukus is free.</p> 
       </center></div> 
     <img src="img/miami.png"></div> 



<!-- Pre register Miami Section --> 

     <div class="whatiswukus-miami full-width-div-1"><center> 
      <h2>Miami</h2> 
      <p>Pre-register now to become a founding member and a chance to win a trip to Miami, Wukus style.</p> 
      </center></div> 



<!-- Footer Section --> 
     <div class="footer"> 
     <center> 
      <p> 
      <a href="#" onclick="$('body').animatescroll();">Back To Top</a> 
      </p> 
      <p> 
      Copyright © Wukus 2015. All Rights Reserved 
      </p> 
      <p> 
      <a href="privacy.html">Privacy Agreement</a> 
      </p> 
      <p> 
      <a href="mailto:[email protected]" target="_top">Contact Us</a> 
      </p> 
      </center> 
     </div> 
     </div> 

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> 
    <!-- Include all compiled plugins (below), or include individual files as needed --> 
    <script src="js/bootstrap.min.js"></script> 
    <script type="text/javascript"> 
     $(document).ready(function() { 
     $('#showdream').click(function() { 
       $('.dreamcontent').slideToggle("slow"); 
     }); 

     $('#showconnect').click(function() { 
       $('.connectcontent').slideToggle("slow"); 
     }); 

     $('#showdiscover').click(function() { 
       $('.discovercontent').slideToggle("slow"); 
     }); 

     $('#shownottalent').click(function() { 
       $('.nottalentcontent').slideToggle("slow"); 
     }); 
    }); 
    </script> 
     <script src="js/animatescroll.js"></script> 

    </script> 
    </body> 

Любая помощь была бы принята с благодарностью!

+0

Что не работает? Есть ли ошибка или что-то странное? – JasonWilczak

+0

попробуйте '$ ('body, html'). Animatescroll()' и вы уверены, что хотите сделать это onclick? – Pete

+0

@JasonWilczak вы нажимаете на обратную связь, и ничего не происходит вообще. –

ответ

0

Вам не нужны никакие внешние библиотеки jQuery. Для этого используйте простой код jQuery.

/** 
 
* Show or hide the button depending on the scroll position. 
 
*/ 
 
function animateButton() { 
 
    var button = $('#back-to-top'); 
 
    var scrollPosition = $(window).scrollTop(); 
 
    if (scrollPosition > 400) { 
 
     button.fadeIn(); 
 
    } else { 
 
     button.fadeOut(); 
 
    } 
 
} 
 
    
 
/** 
 
* Create the button and append it to the body. 
 
*/ 
 
$(function() { 
 
    $('<a id="back-to-top">Back to Top</a>') 
 
     .click(function() { 
 
      $('html,body').animate({ 
 
       scrollTop: 0 
 
      }, 1200); 
 
      return false; 
 
     }) 
 
     .appendTo($('body')); 
 
}); 
 
    
 
/** 
 
* Run the animateButton function on window resize, scroll, and load. 
 
*/ 
 
$(window).resize(animateButton); 
 
$(window).scroll(animateButton); 
 
$(window).load(animateButton);

Приведенный выше код достаточно для функциональности.