Sha256: 048e2c848ebe0043ffcc11b0fdd603f8eba379709e87fef1cff1da0e5687ff23
Contents?: true
Size: 1.05 KB
Versions: 27
Compression:
Stored size: 1.05 KB
Contents
/* * show_and_hide.js : javascript for show_and_hide.rb plugin of tDiary * * Copyright (C) 2011 by tamoot <tamoot+tdiary@gmail.com> * You can distribute it under GPL. */ $( function() { function show_and_hide(target) { $('.show_and_hide_toggle', target).each( function() { $(this).click( function() { $('.show_and_hide#'+$(this).attr('data-showandhideid')).slideToggle(400); }); }); }; // for AutoPagerize $(window).on('AutoPagerize_DOMNodeInserted', function(event) { show_and_hide(event.target); }); // for AuthPatchWork // NOTE: jQuery.bind() cannot handle an event that include a dot charactor. // see http://todayspython.blogspot.com/2011/06/autopager-autopagerize.html if(window.addEventListener) { window.addEventListener('AutoPatchWork.DOMNodeInserted', function(event) { show_and_hide(event.target); }, false); } else if(window.attachEvent) { window.attachEvent('onAutoPatchWork.DOMNodeInserted', function(event) { show_and_hide(event.target); }); }; show_and_hide(document) $('.show_and_hide').hide(); });
Version data entries
27 entries across 26 versions & 2 rubygems