Advertisement
joelobrecht

Untitled

Mar 26th, 2015
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 2.24 KB | None | 0 0
  1. // To toggle pagetop modules with click to a menu option (592)
  2. $(".option592").click(function(){
  3.   $("#pagetop_modules").toggle("slow");
  4. });
  5.  
  6. // To prevent the default behaviour of the menu option = not to open the link.
  7. $(function() {
  8.     $( ".option592 a" ).click(function(e) {
  9.     e.preventDefault();
  10.         });
  11.     });
  12.      
  13. // To put the image in the <h1 / hn> tag
  14. $(function() {
  15.   $(".ImgTitle").hide(); //.siblings().prependTo(".ImgTitle showhide_heading");
  16.         });
  17.  
  18. // To select the button "discuss" to color it in pink
  19. $(function() {
  20.   $("[href*='tiki-view_forum.php']").addClass('discuss');
  21. });
  22.  
  23. //For custom boxes
  24. // Remove <br>
  25. $(function() {
  26.   $(".SPBox br").remove();
  27.   $(".ImgTitle").remove();
  28. });
  29.  
  30. // Remove TikiWiki image attributes
  31. $(function() {
  32.     $(".SPBox img").removeAttr('height width');
  33.   });
  34.  
  35. ///// Nice boxes jquery
  36. // To prevent the default behaviour of the Show more link.
  37. $(function() {
  38.         $('[href="tiki-index.php?page=Show+More"]').click(function(e) {
  39.             e.preventDefault();
  40.         });
  41.     });
  42.  
  43.  
  44. // To toggle more text box
  45. $(function() {
  46.     $("[href*='tiki-index.php?page=Show+More']").click(function() {
  47.       $(this).parent().siblings(".SPBox-Extended").slideToggle("slow");
  48.       $(this).parent().siblings(".SPBox-Summary").slideToggle("slow");
  49.     });
  50. });
  51.  
  52.  
  53. // To pulse Links (with css effects)
  54. $(".SPBox-Summary, .SPBox-Extended").hover(
  55.     function() {
  56.         $(this).siblings(".MoreLess").children().addClass("Big");
  57.     }, function() {
  58.         $(this).siblings(".MoreLess").children().removeClass("Big");
  59.     }
  60. );
  61.  
  62. /* Dynamic top menu positioning*/
  63.  
  64. var num = 120; //number of pixels before modifying styles
  65.  
  66. $(document).ready(function(){
  67.   $(window).bind('scroll', function () {
  68.     if ($(window).scrollTop() > num) {
  69.         $('#topbar_modules, #pagetop_modules').addClass('fixed');
  70.     } else {
  71.         $('#topbar_modules, #pagetop_modules').removeClass('fixed');
  72.     }
  73.   });})
  74.  
  75. // Moves all superfluous elements in presentation pages based on .no_pagetop class in the tools sector
  76. $(document).ready(function () {
  77.   if ($('.no_pagetop') [0]) {
  78.     var ToAppend = $('#pagetop_modules').last();
  79.    
  80.     $('.wikitopline, .categbar, .tocnav').appendTo(ToAppend);
  81.   }
  82. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement