srikat

Untitled

May 4th, 2016
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. jQuery(function( $ ){
  2.  
  3. $('#main-nav-search-link').click(function(){
  4. $('.search-div').show('slow');
  5. });
  6.  
  7. $("*", document.body).click(function(event){
  8. // event.stopPropagation();
  9. var el = $(event.target);
  10. var gsfrm = $(el).closest('form');
  11. if(el.attr('id') !='main-nav-search-link' && el.attr('role') != 'search' && gsfrm.attr('role') != 'search'){
  12. $('.search-div').hide('slow');
  13. }
  14. });
  15.  
  16. // Set the URL of Page's featured image as background image for .singular-parallax-section
  17. $(".singular-parallax-section").css("background-image", "url('" + [SingularPlxBkgrdImg.src] + "')");
  18.  
  19. // Enable parallax
  20. $(window).scroll(function(){
  21.  
  22. scrolltop = $(window).scrollTop()
  23. scrollwindow = scrolltop + $(window).height();
  24.  
  25. $(".singular-parallax-section").css("backgroundPosition", "50% " + -(scrolltop/6) + "px");
  26.  
  27. });
  28.  
  29. });
Advertisement
Add Comment
Please, Sign In to add comment