MediaWiki:Biph.js
(Difference between revisions)
				
																
				
				
								
				Baya  (Talk | contribs)
(Створена сторінка: $( function(){ var canMove = true; if ( $('#mg .galleryholder').length ) { $('#mg .galleryholder a').click( function() { return false; }).css('c...)
Newer edit →
(Створена сторінка: $( function(){ var canMove = true; if ( $('#mg .galleryholder').length ) { $('#mg .galleryholder a').click( function() { return false; }).css('c...)
Newer edit →
Revision as of 17:11, 31 March 2012
$( function(){
    var canMove = true;
    if ( $('#mg .galleryholder').length ) {
        $('#mg .galleryholder a').click( function() { return false; }).css('cursor','default');
        $('#mg .galleryholder a').mouseleave( function() { canMove = true; }).mouseenter( function() {
            if ( !canMove ) return;
            canMove = false;
            ul = $(this).parents('ul');
            document.title = ul.contents('li:first-child').css('marginLeft');
            if ( parseInt( ul.contents('li:first-child').css('marginLeft') ) != 0 ) { nl = 0; } else {
                w = 0;
                ul.contents('li').each( function() { w+= $(this).width() + 3 } );
                nl = ul.width() - w;
            }
            ul.contents('li:first-child').animate({'marginLeft':nl + 'px'},5000,function(){canMove = true;});
        });
    };
});
