Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
   <div id = "main_div" style = "width: 33%">
            <div id = "hover_div">
                <h1 style = "width: 300px; background-color: blue; margin: 0; border: 1px solid #DDDDDD" id = "text1">Hover to see the truth</h1>
            </div>
        </div>
</body>
</html>
 
$(document).ready (function() {
    $(document).on ("mouseenter", "#text1", function() {
      
        $("#descr").remove();
        $("#main_div").append ("<div style = 'background-color: red; width: 300px; height: 200px; margin: 0; border: 1px solid #DDDDDD' id = 'descr'></div>");
        $("#descr")
            .hide()
            .append ("<h3 id = 'truth' style = 'float: left; height: 100px'>You're an idiot</h3>")
            .stop()
            .slideDown ("slow");
    });
    $(document).on ("mouseleave", "#text1", function() {
        $("#descr").stop().slideUp ("slow", function() {
        });
    });
    $(document).on ("mouseenter", "#descr", function() {
        $("#descr").stop().slideUp ("slow", function() {
                $(this).remove();
        });
    });
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers