Posted By

nickyangau on 11/18/11


Tagged

javascript jquery drupal


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

Balamir
spee66
sdudenhofer


some jQuery samples -- back to top / fadein fadeout menu / drupal menu open new window


 / Published in: jQuery
 

  1. // back to top button
  2. $(function() {
  3. $('#back_to_top').click(function() {
  4. $('body,html').animate({scrollTop:0},800);
  5. });
  6. });
  7.  
  8. //menu fadein/fadeout anmiation.
  9. $(function() {
  10. $('ul li ul', this).hide();
  11. var enterEvent = function() {
  12. $('ul', this).fadeIn();
  13. };
  14. var leaveEvent = function() {
  15. $('ul', this).hide();
  16. };
  17. $('#nav ul li').hover(enterEvent, leaveEvent);
  18. });
  19.  
  20. // gallery menu open a new window
  21. $(document).ready(function(){
  22. $("#nav li.last").click(function(){
  23. window.open('http://www.steveparishgallery.com');
  24. return false;
  25. });
  26. });

Report this snippet  

You need to login to post a comment.