14

We want to hide button until we hover over the div layer.

FIDDLE here > Click to view

Essentially, I would like to be able to apply this to other elements also, but this will do for now, any help appreciated

422
  • 5,714
  • 23
  • 83
  • 139

3 Answers3

18

Simply use the :hover pseudo-class on the outer div:

.resultContainer .viewThisResult {
    display: none;
}
.resultContainer:hover .viewThisResult {
    display: inline;
}

Here's the fiddle: http://jsfiddle.net/dTLaF/1/

Joseph Silber
  • 214,931
  • 59
  • 362
  • 292
13
.resultContainer:hover .viewThisResult { display: block; }

:hover pseudoselector on the parent. Though it's nice when the code for the question is included in the question, for posterity.

Annika Backstrom
  • 13,937
  • 6
  • 46
  • 52
0

when using this feature and trying to hover most of the time it doesn't work because when something is hidden it is no longer there to activate hover, the simplest way to solve this is by making it transparent and using hover to remove the transparency.

Young Man
  • 1
  • 2