Jump to content

User:Dodoïste/vector.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Dodoïste (talk | contribs) at 13:03, 13 May 2010 (Undid revision 360516364 by Dodoïste (talk)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
importScript('User:Cacycle/navbox.js');

/* jQuery section Begin */ jQuery(document).ready(function($){
 
$(':header').each(
  function(){
    $(this)
    .append(' ')
    .append(
      $(this).children('span.editsection')
      .css('display','inline')
      .css('float','none')
      .css('font-size','small')
      .css('margin-left','5px')
      .css('line-height','90%').hide()
    )
    .hover(
      function(){$(this).children('span.editsection').show()},
      function(){$(this).children('span.editsection').hide()}
    )
  }
);
 
/* Auto-hide TOC like that in Baidu Baike */
 
if ($('table#toc.toc').size()>0){
 if ($('table#toc.toc').position().left==0){
  $('li.toclevel-1>ul').hide()
  $('table#toc.toc')
  .css('position','absolute')
  .css('float','left')
  .css('margin-right','1em')
  .hover(
    function(){$('li.toclevel-1>ul').attr('style','display:none').show('slow')},
    function(){$('li.toclevel-1>ul').stop(true,false).hide('slow')}
  )
  .after(
    $('<div/>')
    .css('height',$('table#toc.toc').height())
    .css('padding','8px')
  )
 }
}
 
/* jQuery section End */ });