Skip to content

Commit 4dee512

Browse files
committed
add "clone_event" option
1 parent f105df2 commit 4dee512

File tree

5 files changed

+560
-489
lines changed

5 files changed

+560
-489
lines changed

demo/sample.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44

55
// 各サンプルの設定
6-
jQuery(document).ready(function($) {
6+
$(function () {
77
$('#list1').addInputArea();
88
$('#list2').addInputArea({
99
area_var : '.var_area02',
@@ -43,13 +43,20 @@ jQuery(document).ready(function($) {
4343
alert('Added!');
4444
}
4545
});
46+
$('#list11 .test-tooltip').tooltip();
47+
$('#list11').addInputArea({
48+
clone_event: false,
49+
after_add: function () {
50+
$('#list11 .test-tooltip').tooltip();
51+
}
52+
});
4653
});
4754

48-
jQuery(document).ready(function($) {
55+
$(function () {
4956
// ページ内リンクのスクロール
50-
$('a[href^=#]').click(function() {
57+
$('a[href^="#"]').click(function() {
5158
var href= $(this).attr("href");
52-
var target = $(href == "#" || href == "" ? 'html' : href);
59+
var target = $(href == "#" || href === "" ? 'html' : href);
5360
var position = target.offset().top - 10;
5461
$('body,html').animate({scrollTop: position}, 200, 'swing');
5562
history.pushState('', '', $(this)[0].href);
@@ -58,8 +65,8 @@ jQuery(document).ready(function($) {
5865

5966
// 英語・日本語切り替え
6067
$('#language button').click(function(ev) {
61-
$('*[class*=lang_]').hide();
62-
$('button[id*=lang_]').removeAttr('disabled');
68+
$('*[class*="lang_"]').hide();
69+
$('button[id*="lang_"]').removeAttr('disabled');
6370
$('.' + $(ev.target).attr('id')).show();
6471
$(ev.target).attr('disabled', 'disabled');
6572
});

demo/simple/index.html

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="utf-8">
5-
<meta name="viewport" content="width=device-width,initial-scale=1.0">
6-
<title>jquery.add-input-area</title>
7-
<script src="//cdn.jsdelivr.net/jquery/1.11.3/jquery.min.js"></script>
8-
<script src="//cdn.jsdelivr.net/jquery.add-input-area/4.7.2/jquery.add-input-area.min.js"></script>
9-
<script>
10-
jQuery(document).ready(function($) {
11-
$('#list1').addInputArea();
12-
});
13-
</script>
14-
</head>
15-
<body>
16-
<h1>Simple Demo</h1>
17-
<form action="result.php" method="post">
18-
<ol id="list1">
19-
<li class="list1_var">
20-
<input type="text" size="40" name="list1_0" id="list1_0">
21-
<button class="list1_del">Delete</button>
22-
</li>
23-
</ol>
24-
<button type="button" class="list1_add">Add</button>
25-
<p><button type="submit" name="submit">Submit</button></p>
26-
</form>
27-
</body>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
6+
<title>jquery.add-input-area</title>
7+
<script src="//code.jquery.com/jquery-1.12.0.min.js"></script>
8+
<script src="//cdn.jsdelivr.net/jquery.add-input-area/4.8.0/jquery.add-input-area.min.js"></script>
9+
<script>
10+
$(function () {
11+
$('#list1').addInputArea();
12+
});
13+
</script>
14+
</head>
15+
<body>
16+
<h1>Simple Demo</h1>
17+
<form action="result.php" method="post">
18+
<ol id="list1">
19+
<li class="list1_var">
20+
<input type="text" size="40" name="list1_0" id="list1_0">
21+
<button class="list1_del">Delete</button>
22+
</li>
23+
</ol>
24+
<button type="button" class="list1_add">Add</button>
25+
<p><button type="submit" name="submit">Submit</button></p>
26+
</form>
27+
</body>
2828
</html>

0 commit comments

Comments
 (0)