Bug Tracker

Ticket #3966: test-3966.htm

File test-3966.htm, 818 bytes (added by dmethvin, 13 years ago)

Mouseover event only sticks for the first copy

Line 
1<!DOCTYPE HTML>
2<html>
3<head>
4<title>test</title>
5<script type="text/javascript" src="jquery-1.3.js"></script>
6
7<script type="text/javascript">
8
9$(document).ready(function(){
10
11// this works in 1.2.6, but in 1.3.1, the mouseover event only gets applied to the first div created
12
13$("p").hide();
14$('<div class="mousey">mouse over me</div>').mouseover(function() {
15        $(this).hide().parent("div").find("p").show();
16}).appendTo($(".tester"));
17
18});
19
20 
21</script>
22<style type="text/css">
23.tester { border: 1px solid #ccc }
24.mousey { border: 1px solid #f88 }
25</style>
26</head>
27
28<body>
29
30<div class="tester"><p>this is a test</p></div>
31<div class="tester"><p>of events</p></div>
32<div class="tester"><p>and cloning</p></div>
33<div class="tester"><p>plus other stuff</p></div>
34
35       
36</body>
37</html>
38