1/* 2 + JQuery : switchHat.js 0.10 3 + 4 + Author : Takashi Hirasawa 5 + Special Thanks : kotarok (http://nodot.jp/) 6 + Copyright (c) 2010 CSS HappyLife (http://css-happylife.com/) 7 + Licensed under the MIT License: 8 + http://www.opensource.org/licenses/mit-license.php 9 + 10 + Since : 2010-06-24 11 + Modified : 2010-06-27 12 */ 13 14(function($) { 15 16 $(function(){ 17 $.uHat.switchHat(); 18 // $.uHat.close(); 19 // $.uHat.openAll(); 20 }); 21 22 $.uHat = { 23 24 switchHat: function(settings) { 25 uHatConA = $.extend({ 26 switchBtn: '.switchHat', 27 switchContents: '.switchDetail', 28 switchClickAddClass: 'nowOpen' 29 }, settings); 30 $(uHatConA.switchContents).hide(); 31 $(uHatConA.switchBtn).addClass("switchOn").click(function(){ 32 var index = $(uHatConA.switchBtn).index(this); 33 $(uHatConA.switchContents).eq(index).slideToggle("slow"); 34 $(this).toggleClass(uHatConA.switchClickAddClass); 35 }).css("cursor","pointer"); 36 }, 37 38 close: function(settings) { 39 uHatConB = $.extend({ 40 closeBtnSet: uHatConA.switchContents, 41 apCloseBtn: '<span>X Close</span>' 42 }, settings); 43 $(uHatConB.closeBtnSet).append('<p class="closeBtnHat">'+uHatConB.apCloseBtn+'</p>'); 44 $(".closeBtnHat").children().click(function(){ 45 $(this).parents(uHatConA.switchContents).fadeOut("slow"); 46 $(this).parents().prev().contents(uHatConA.switchBtn).removeClass(uHatConA.switchClickAddClass); 47 }).css("cursor","pointer"); 48 }, 49 50 openAll: function(settings) { 51 uHatConC = $.extend({ 52 openAllBtnClass: '.allOpenBtn', 53 switchBtn: uHatConA.switchBtn, 54 openContents: uHatConA.switchContents 55 }, settings); 56 $(uHatConC.openAllBtnClass).addClass("switchOn").toggle( 57 function(){ 58 $(this).addClass(uHatConA.switchClickAddClass); 59 $(uHatConC.openContents).slideDown("slow"); 60 $(uHatConC.switchBtn).addClass(uHatConA.switchClickAddClass); 61 }, 62 function(){ 63 $(this).removeClass(uHatConA.switchClickAddClass); 64 $(uHatConC.openContents).slideUp("slow"); 65 $(uHatConC.switchBtn).removeClass(uHatConA.switchClickAddClass); 66 } 67 ).css("cursor","pointer"); 68 } 69 70 }; 71 72})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.