- Welcome to the Kancolle Wiki!
- If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord
Difference between revisions of "MediaWiki:Gadget-SiteScroll.js"
Jump to navigation
Jump to search
Gensui Hime (talk | contribs) |
|||
(3 intermediate revisions by one other user not shown) | |||
Line 4: | Line 4: | ||
* Original from touhouwiki | * Original from touhouwiki | ||
*/ | */ | ||
− | + | ||
− | $(objNotice).find("ul:first").animate({ | + | window.AutoScroll = function(objNotice) { |
− | + | $(objNotice).find("ul:first").stop(true, true).animate( | |
− | + | { | |
− | + | marginTop:"-25px" | |
− | + | }, | |
+ | 500, | ||
+ | function(){ | ||
+ | $(this).css({marginTop: "0px"}).find("li:first").appendTo(this); | ||
+ | } | ||
+ | ); | ||
}; | }; | ||
− | $ | + | $(function() { |
− | setInterval( | + | setInterval(function() { window.AutoScroll('#scrollDiv') }, 10000); |
− | //image loading effect | + | // image loading effect |
$('img').on('load', function(e){ | $('img').on('load', function(e){ | ||
var target = $(this); | var target = $(this); |
Latest revision as of 02:28, 10 May 2021
/**
* Scrolling text
*
* Original from touhouwiki
*/
window.AutoScroll = function(objNotice) {
$(objNotice).find("ul:first").stop(true, true).animate(
{
marginTop:"-25px"
},
500,
function(){
$(this).css({marginTop: "0px"}).find("li:first").appendTo(this);
}
);
};
$(function() {
setInterval(function() { window.AutoScroll('#scrollDiv') }, 10000);
// image loading effect
$('img').on('load', function(e){
var target = $(this);
target.css('opacity', 0).animate({opacity: 1}, 1000);
});
});