Wiki4Games:RatingBar/slider.js

From Wiki4Games

Jump to: navigation, search
/****************************************************************************
**
** This file is part of the Rating Bar extension for MediaWiki
** Copyright (C)2009  Mininova.org
** Source: http://labs.mininova.org/ratingbar/
**
*********************************************************************/

<!--
var blocksDiv = document.getElementById('blocks');
var currentRating = blocksDiv.className.substr(6, blocksDiv.className.length);
var blocksDivHover = false;
 
 
function setRating(rating) {
 
  if(!rating)
    rating = currentRating;
 
  blocksDiv.className = 'rating' + rating;
 
}
 
 
blocksDiv.onmouseover = function() {
 
  blocksDivHover = true;
 
};
 
blocksDiv.onmouseout = function() {
 
  blocksDivHover = false;
 
  setTimeout('if(!blocksDivHover) setRating();', 100);
 
};
 
 
for(var i=1;i<11;i++)
  document.getElementById('block' + i).onmouseover = new Function('setRating(' + i + ')');
  
//-->

Partners
...more partners