document ready function var SLIDE_SPEED 250 left_menu li div each func

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
$( document ).ready(function(){
var SLIDE_SPEED = 250;
$( '#left_menu li div' ).each(function(){
$( this ).css( { 'cursor' : 'pointer' , 'padding' : '2px 3px' } );
$( this ).mouseenter(function(){
$( this ).css( { 'background-color' : '#333' } );
});
$( this ).mouseleave(function(){
$( this ).css( { 'background-color' : 'transparent' } );
});
if ( $( this ).parent().find( '>ul' ).length ){
//$( this ).append( '<span class="arrow-contents">&nbsp;&#65516;</span>' );
$( this ).append( '<span class="arrow-contents">&nbsp;&#65515;</span>' );
$( this ).find( 'span.arrow-contents' ).css( { 'font-weight' : 'bold' , 'font-size' : '14px' } );
$( this ).parent().find( '>ul' ).css( 'display' , 'none' );
$( this ).click(function(){
var _self = this;
$( this ).parent().find( '>ul' ).stop( true , true ).slideToggle( SLIDE_SPEED , function(){
if ( $( _self ).parent().find( '>ul' ).is( ':visible' ) ){
$( _self ).find( 'span.arrow-contents' ).html( '&nbsp;&#65516;' );
} else {
$( _self ).find( 'span.arrow-contents' ).html( '&nbsp;&#65515;' );
}
});
});
}
});
});