League of Legends Wiki

Comments2

Small Mainpage project

This code will load content from other pages on the wikia and display them on the page itself.

$( "#sale td:nth-child(-n+3)" ).append("<div class='champ-content'></div>");
$( "#sale td:nth-child(-n+3)" ).mouseenter( function(){
  $name = $(this).find("a")[0].title;
  $td = $(this).find(".champ-content");
  $( "[title="+ $name + "]" ).live( "hover", function() {
    $( $td ).load( $name + " .champion_info" );
  });
});

CSS

#sale > .center {
   position: relative;
}
.champ-content {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 100%;
  background-color: #082848;
  padding: 10px;
}
#sale td:hover > .champ-content {
  display: block;
}

Current Bugs

Last 2 td spaces can't contain hover content without recreating the location (doesn't effect the function of the script.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.