// javascript document /***************手机导航***************/ $( document ).ready( function() { $( '.phone_header_btn' ).click( function() { $( ".header_menu" ).fadein( "fast" ) $( ".header_menu_con" ).animate( { "left": "0px" }, 1000 ) $( ".header_menu_bg" ).animate( { "opacity": "1" }, 500 ) } ) $( ".header_menu_bg" ).click( function() { $( ".header_menu" ).fadeout( "fast" ) $( ".header_menu_con" ).animate( { "left": "-300px" }, 1000 ) $( ".header_menu_bg" ).animate( { "opacity": "0" }, 500 ) } ) $( '.nav_ti>li>' ).click( function() { if( $( this ).find( 'ul' ).css( "display" ) == "none" ) { alert( 1 ) $( '.nav_ti>li' ).find( 'ul' ).stop( true ).slideup( 300 ); $( this ).find( 'ul' ).stop( true ).slidedown( 300 ); } else { $( '.nav_ti>li' ).find( 'ul' ).stop( true ).slideup( 300 ); $( this ).find( 'ul' ).stop( true ).slideup( 300 ); } } ) $( '.nav_ti>li>a' ).click( function() { $( this ).next( 'ul' ).stop( true ).slidetoggle(); $( this ).find( 'i' ).toggleclass( "scale1" ) } ) } ) /***************手机导航***************/ /***导航***/ $( document ).ready( function() { $( ".header_rinav" ).height( $( window ).height() ) $( window ).load( function() { $( ".header_show" ).width( $( window ).width() ) } ) $( window ).resize( function() { $( ".header_show" ).width( $( window ).width() ) } ) $( ".has_nav" ).hover( function() { $( '.has_nav' ).find( '.header_show' ).stop( true ).fadeout( 600 ); $( this ).find( ".header_show" ).stop( true ).fadein( 600 ); $( '.header_showbg' ).stop( true ).fadein( 600 ); }, function() { $( '.has_nav' ).find( '.header_show' ).stop( true ).fadeout( 600 ); $( '.header_showbg' ).stop( true ).fadeout( 600 ); } ) $( ".header_show_b li" ).hover( function() { var now = $( this ).index(); $( this ).parents( ".header_show" ).find( '.header_show_cimg' ).stop( true, true ).hide(); $( this ).parents( ".header_show" ).find( ".header_show_cimg" ).eq( now ).stop( true, true ).fadein( 600 ); $( this ).animate( { "opacity": "1" }, 100 ).siblings( "li" ).animate( { "opacity": "0.3" }, 100 ) } ) var hj = 0 $( ".header_rinav_nav li.hnv" ).hover( function() { var _this = $( this ) if( _this.find( ".header_rinav_c" ).hasclass( "on" ) ) { } else { if( hj == 1 ) { $( ".header_rinav_c" ).removeclass( "on" ).stop( true ).slideup( 500 ) _this.find( ".header_rinav_c" ).addclass( "on" ).stop( true ).slidedown( 500 ) $( ".header_rinav_c a" ).stop( true ).animate( { marginleft: "-10px", opacity: "0" }, 100 ); $( ".header_rinav_c .line" ).animate( { width: "0px" }, 300 ); _this.find( ".header_rinav_c .line" ).animate( { width: "50px" }, 200, function() { var sec2 = _this.find( ".header_rinav_c a" ).size(); for( var j = 0; j < sec2; j++ ) { _this.find( ".header_rinav_c a" ).eq( j ).stop( true ).delay( j * 100 ).animate( { marginleft: "0", opacity: "1" }, 200 ); } } ); } } } ) $( ".header_rinav_b" ).click( function() { var nio = $( this ).attr( "data-id" ) $( ".header_rinav" ).stop( true ).animate( { right: "0px" }, 1000, function() { $( ".header_rinav_nav li" ).eq( nio ).find( ".header_rinav_c" ).stop( true ).slidedown( 500 ) $( ".header_rinav_nav li" ).eq( nio ).find( ".header_rinav_c .line" ).animate( { width: "50px" }, 200, function() { var sec2 = $( ".header_rinav_nav li" ).eq( nio ).find( ".header_rinav_c a" ).size(); for( var j = 0; j < sec2; j++ ) { $( ".header_rinav_nav li" ).eq( nio ).find( ".header_rinav_c a" ).eq( j ).stop( true ).delay( j * 100 ).animate( { marginleft: "0", opacity: "1" }, 200 ); } hj = 1 } ) } ); //settimeout( function() //{ // $( ".header_rinav" ).stop( true ).animate( { right: "-50%" }, 2000 ); // $( ".header_rinav_nav li .header_rinav_c" ).stop( true ).slideup( 10 ) // $( ".header_rinav_nav li .header_rinav_c .line" ).animate( { width: "0px" } ) // $( ".header_rinav_nav li .header_rinav_c a" ).stop( true ).animate( { // marginleft: "-10px", // opacity: "0" // }, 100 ); //}, 6000 ) } ) $(".header_rinav" ).hover(function(){ },function(){ $( ".header_rinav" ).stop( true ).animate( { right: "-50%" }, 2000 ); $( ".header_rinav_nav li .header_rinav_c" ).stop( true ).slideup( 10 ) $( ".header_rinav_nav li .header_rinav_c .line" ).animate( { width: "0px" } ) $( ".header_rinav_nav li .header_rinav_c a" ).stop( true ).animate( { marginleft: "-10px", opacity: "0" }, 100 ); }) $( ".header_rinav_cl" ).click( function() { $( ".header_rinav" ).stop( true ).animate( { right: "-50%" }, 1000 ); $( ".header_rinav_nav li .header_rinav_c" ).stop( true ).slideup( 10 ) $( ".header_rinav_nav li .header_rinav_c .line" ).animate( { width: "0px" } ) $( ".header_rinav_nav li .header_rinav_c a" ).stop( true ).animate( { marginleft: "-10px", opacity: "0" }, 100 ); } ) $( document ).bind( "click", function( e ) { var target = $( e.target ); if( target.closest( ".header_rinav,.header_rinav_b" ).length == 0 ) { $( ".header_rinav" ).stop( true ).animate( { right: "-50%" }, 1000 ); $( ".header_rinav_nav li .header_rinav_c" ).stop( true ).slideup( 10 ) $( ".header_rinav_nav li .header_rinav_c .line" ).animate( { width: "0px" } ) $( ".header_rinav_nav li .header_rinav_c a" ).stop( true ).animate( { marginleft: "-10px", opacity: "0" }, 100 ); } ; e.stoppropagation(); } ) $( ".fi_right" ).click( function() { $( "html,body" ).animate( { scrolltop: 0 }, 500 ) } ) $( window ).scroll( function() { if( $( window ).scrolltop() > 500 ) { $( ".fi_right" ).stop( true ).fadein() } else { $( ".fi_right" ).stop( true ).fadeout() } } ) } ) $( window ).load( function() { $( "html,body" ).animate( { scrolltop: 0 }, 0 ) var url = window.location.tostring(); var id = url.split( "#" )[ 1 ]; if( id ) { var t = $( "#" + id ).offset().top - 60; $( "html,body" ).animate( { scrolltop: t }, 600 ) } $( 'a' ).click( function() { var a = $( this ).attr( "href" ).split( "#" )[ 1 ]; var p = $( "#" + a ).offset().top - 60; $( "html,body" ).animate( { scrolltop: p }, 600 ); } ) } )