撤销SkyEye FAST(讨论)的版本1515
SkyEye FAST(讨论 | 贡献) (// Edit via Wikiplus) |
SkyEye FAST(讨论 | 贡献) (撤销SkyEye FAST(讨论)的版本1515) 标签:撤销 |
||
第1行:
/* 这里的任何JavaScript将为所有用户在每次页面载入时加载。 */
/**
* Set minimum height for animations to prevent moving the page if the frames
* differ in height
*/
/*
( function() {
// Set frames to be visible for measuring height
var $animated = $wikipageContent.find( '.animated' ).addClass( 'animated-visible' );
// Group frames per animation
var animateds = [];
$animated.each( function() {
animateds.push( {
$: $( this ).find( '> .animated-subframe' ).addBack()
.find( '> *:not(.animated-subframe)' ),
} );
} );
// Get highest frame for each animation (if heights differ)
$.each( animateds, function() {
var minHeight = 0, differentHeights;
this.$.each( function() {
var height = this.offsetHeight;
differentHeights = differentHeights || minHeight && height !== minHeight;
minHeight = Math.max( height, minHeight );
} );
if ( differentHeights ) {
this.height = minHeight;
}
} );
// Set animation to be at least as tall as the tallest frame,
// and set the non-active frames to be hidden again
$animated.each( function( i ) {
$( this ).css( 'min-height', animateds[i].height );
} ).removeClass( 'animated-visible' );
}() );
/**
第9行 ⟶ 第48行:
$( this ).find( '.animated' ).toggleClass( 'animated-paused', e.type === 'mouseenter' );
} );
/**
* Animated Site Announcement
*
* To show mutiple announcements.
*/
( function() {
var $content = $( '#localNotice' );
var advanceFrame = function( parentElem, parentSelector ) {
var curFrame = parentElem.querySelector( parentSelector + ' > .animated-active' );
$( curFrame ).removeClass( 'animated-active' );
var $nextFrame = $( curFrame && curFrame.nextElementSibling || parentElem.firstElementChild );
return $nextFrame.addClass( 'animated-active' );
};
setInterval( function() {
$content.find( '.animated' ).each( function() {
var $nextFrame = advanceFrame( this, '.animated' );
if ( $nextFrame.hasClass( 'animated-subframe' ) ) {
advanceFrame( $nextFrame[0], '.animated-subframe' );
}
} );
}, 2000 );
}() );
/* [[Template:Tabs]] */
|