//banner滚动插件 $(".fullslide").hover(function(){ $(this).find(".prev,.next").stop(true, true).fadeto("show", 0.5) }, function(){ $(this).find(".prev,.next").fadeout() }); $(".fullslide").slide({ titcell: ".hd ul", maincell: ".bd ul", effect: "fold", autoplay: true, autopage: true, trigger: "click", startfun: function(i) { var curli = jquery(".fullslide .bd li").eq(i); if ( !! curli.attr("_src")) { curli.css("background-image", curli.attr("_src")).removeattr("_src") } } }); //内页做成导航伸展 $(function() { var accordion = function(el, multiple) { this.el = el || {}; this.multiple = multiple || false; // variables privadas var links = this.el.find('.link'); // evento links.on('click', { el: this.el, multiple: this.multiple }, this.dropdown) } accordion.prototype.dropdown = function(e) { var $el = e.data.el; $this = $(this), $next = $this.next(); $next.slidetoggle(); $this.parent().toggleclass('open'); if (!e.data.multiple) { $el.find('.submenu').not($next).slideup().parent().removeclass('open'); }; } var accordion = new accordion($('#accordion'), false); }); // -------------------------------------------------- /*! * fittext.js 1.1 * * copyright 2011, dave rupert http://daverupert.com * released under the wtfpl license * http://sam.zoy.org/wtfpl/ * * date: thu may 05 14:23:00 2011 -0600 */ (function( $ ){ $.fn.fittext = function( kompressor, options ) { // setup options var compressor = kompressor || 1, settings = $.extend({ 'minfontsize' : number.negative_infinity, 'maxfontsize' : number.positive_infinity }, options); return this.each(function(){ // store the object var $this = $(this); // resizer() resizes items based on the object width divided by the compressor * 10 var resizer = function () { $this.css('font-size', math.max(math.min($this.width() / (compressor*10), parsefloat(settings.maxfontsize)), parsefloat(settings.minfontsize))); }; // call once to set. settimeout( function(){ resizer(); } , 250 ); // call on resize. opera debounces their resize by default. $(window).on('resize.fittext orientationchange.fittext', resizer); }); }; })( jquery ); // -------------------------------------------------- // fittext init + animate to hash $( document ).ready( function() { // set fittext for main heading $( '.fittext' ).fittext( 0.45 ); // scroll to hash animation $( function() { $( 'a[href*=#]:not([href=#])' ).click( function() { if( location.pathname.replace( /^\// , '' ) == this.pathname.replace( /^\// , '' ) && location.hostname == this.hostname ) { var target = $( this.hash ); target = target.length ? target : $( '[name='+this.hash.slice( 1 )+']' ); if( target.length ) { $( 'html,body' ).stop().animate( { scrolltop:target.offset().top - 120 } , 1000 ); return false; } } }); }); }); // --------------------------------------------------