Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改了一些小bug #8

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ options
* addItemOnBlur: true or false (default false)
* caseSensitive: true or false (default true)
* allowTagsNumber: number of allowed tags (default infinite)
* allowTagsWordNumber: number of allowed each tag length (default infinite)
* showTagsNumber: number of shown suggestions tags (default 10)
* preset: array of preset tags
* tags: array of tags
Expand Down
24 changes: 20 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<head>
<meta charset="UTF-8">
<title>Superbly TagField Demo</title>
<link rel="stylesheet" href="superbly-tagfield.css" />
<script type="text/javascript" src=" https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script type="text/javascript" src="superbly-tagfield.min.js"></script>
<link rel="stylesheet" href="skins/superbly-tagfield.css" />
<script type="text/javascript" src="jquery/jquery-2.1.3.js"></script>
<script type="text/javascript" src="superbly-tagfield.js"></script>
<script type="text/javascript">
$(function() {
var carTags = ['Alfa Romeo','Aston Martin','Audi','Bentley','Bugatti','BMW','Citroen','Cadillac','Chevrolet','Dodge','Daewoo','Ferrari','Ford','Fiat','Honda','Hyundai','Jaguar','Jeep','Kia','Lada','Lexus','Lotus','Maserati','Mazda','Mercedes','Nissan','Opel','Peugeot','Porsche','Rover','Renault','Suzuki','Subaru','Seat','Toyota','Volvo','Vauxhall','VW'];

var carTags = ['1', '2', '3', '4', '5'];
// Initialize Demo 1
$("#tagfield1").superblyTagField({
allowNewTags: false,
Expand Down Expand Up @@ -44,6 +44,16 @@
tags: carTags
});

// Initialize Demo 4.1
$("#tagfield41").superblyTagField({
allowNewTags: true,
allowedTagsNumber: 5,
allowedTagsWordsNumber: 3,
showTagsNumber: 10,
preset: ['Audi','Bugatti'],
tags: carTags
});

// Initialize Demo 5
$("#tagfield5").superblyTagField({
caseSensitive: false,
Expand Down Expand Up @@ -83,6 +93,9 @@
});
$('#tagDemoButton4').click(function(e){
alert($("#tagfield4").val());
});
$('#tagDemoButton41').click(function(e){
alert($("#tagfield41").val());
});
$('#tagDemoButton5').click(function(e){
alert($("#tagfield5").val());
Expand All @@ -107,6 +120,9 @@ <h2>Superbly Tagfield Demo</h2>
<p>Demo 4 (allow only 5 tags):</p>
<input type="text" id="tagfield4" />
<input style="margin:3px;" type="button" id="tagDemoButton4" value="show tags">
<p>Demo 4.1 (allow only 5 tags and allow new tags and The length of each tag is 3):</p>
<input type="text" id="tagfield41" />
<input style="margin:3px;" type="button" id="tagDemoButton41" value="show tags">
<p>Demo 5 (allow new tags case insensitive):</p>
<input type="text" id="tagfield5" />
<input style="margin:3px;" type="button" id="tagDemoButton5" value="show tags">
Expand Down
Loading