• 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"

From Kancolle Wiki
Jump to navigation Jump to search
Line 4: Line 4:
 
  * Original from touhouwiki
 
  * Original from touhouwiki
 
  */
 
  */
 +
 
var AutoScroll = function(objNotice) {
 
var AutoScroll = function(objNotice) {
     $(objNotice).find("ul:first").animate({
+
     $(objNotice).find("ul:first").animate(
        marginTop:"-25px"
+
    {
    },500,function(){
+
    marginTop:"-25px"
        $(this).css({marginTop: "0px"}).find("li:first").appendTo(this);
+
    },
     });
+
    500,
};
+
    function(){
 +
        $(this).css({marginTop: "0px"}).find("li:first").appendTo(this);
 +
    }
 +
     )
 +
}
  
 
$(document).ready(function() {
 
$(document).ready(function() {
Line 18: Line 23:
 
         var target = $(this);
 
         var target = $(this);
 
         target.css('opacity', 0).animate({opacity: 1}, 1000);
 
         target.css('opacity', 0).animate({opacity: 1}, 1000);
   });
+
   })
});
+
})

Revision as of 04:05, 2 November 2019

/**
 * Scrolling text
 *
 * Original from touhouwiki
 */

var AutoScroll = function(objNotice) {
    $(objNotice).find("ul:first").animate(
    	{
    		marginTop:"-25px"
    	},
    	500,
    	function(){
    	    $(this).css({marginTop: "0px"}).find("li:first").appendTo(this);
    	}
    )
}

$(document).ready(function() {
    setInterval('AutoScroll("#scrollDiv")',10000);
    //image loading effect
    $('img').on('load', function(e){
         var target = $(this);
         target.css('opacity', 0).animate({opacity: 1}, 1000);
   })
})