summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2010-11-29 03:22:07 +0100
committerFelix Nagel <info@felixnagel.com>2010-11-29 03:22:07 +0100
commit9aa263863d849181d3a8f97897dd6323699ad374 (patch)
tree532f12d06d4dc15fa8acc81abfb3618774423d8e /demos
parent8f802c97ce70d4a68b40227b8a2b54b7fcfdcefc (diff)
downloadjquery-ui-9aa263863d849181d3a8f97897dd6323699ad374.tar.gz
jquery-ui-9aa263863d849181d3a8f97897dd6323699ad374.zip
added: improved index and value methods, if you used value method in your scripts please see https://github.com/fnagel/jquery-ui/issues/#issue/33
fixed: forgotten console debug
Diffstat (limited to 'demos')
-rw-r--r--demos/selectmenu/default.html2
-rw-r--r--demos/selectmenu/methods.html36
2 files changed, 28 insertions, 10 deletions
diff --git a/demos/selectmenu/default.html b/demos/selectmenu/default.html
index fed7f2f0f..28ec1c3bd 100644
--- a/demos/selectmenu/default.html
+++ b/demos/selectmenu/default.html
@@ -70,8 +70,10 @@
return newText;
}
</script>
+ <!--
<script type="text/javascript" src="http://ui.jquery.com/applications/themeroller/themeswitchertool/"></script>
<script type="text/javascript"> $(function(){ $('<div style="position: absolute; top: 20px; right: 10px;" />').appendTo('body').themeswitcher(); }); </script>
+ -->
</head>
<body>
<br />
diff --git a/demos/selectmenu/methods.html b/demos/selectmenu/methods.html
index 5504950a6..8d82af78d 100644
--- a/demos/selectmenu/methods.html
+++ b/demos/selectmenu/methods.html
@@ -22,28 +22,43 @@
</style>
<script type="text/javascript">
$(function(){
- var speedA = $('select#speedA').selectmenu(
- );
+ var speedA = $('select#speedA').selectmenu();
- $("#getValue").click(function(event){
+ $("#index").click(function(event){
+ console.log($('select#speedA').selectmenu("index"));
+ });
+ $("#indexNumber").click(function(event){
+ console.log($('select#speedA').selectmenu("index", 4));
+ });
+ $("#value").click(function(event){
console.log($('select#speedA').selectmenu("value"));
});
- $("#setValue").click(function(event){
+ $("#valueString").click(function(event){
+ console.log($('select#speedA').selectmenu("value", "Medium"));
+ });
+ $("#valueNumber").click(function(event){
console.log($('select#speedA').selectmenu("value", 4));
});
+ $("#valueNumberAsString").click(function(event){
+ console.log($('select#speedA').selectmenu("value", "11"));
+ });
+ $("#valueNonExisting").click(function(event){
+ console.log($('select#speedA').selectmenu("value", "test123"));
+ });
});
</script>
- <!--
- <script type="text/javascript" src="http://ui.jquery.com/applications/themeroller/themeswitchertool/"></script>
- <script type="text/javascript"> $(function(){ $('<div style="position: absolute; top: 20px; right: 10px;" />').appendTo('body').themeswitcher(); }); </script>
- -->
</head>
<body>
<br />
<br />
<form action="#">
- <a href="#nogo" id="getValue">getValue</a>
- <a href="#nogo" id="setValue">setValue to 4</a>
+ <a href="#nogo" id="index">method index without paramaters (get index)</a><br />
+ <a href="#nogo" id="indexNumber">method index with paramater '4' (set index by number)</a><br />
+ <a href="#nogo" id="value">method value without paramaters (get value)</a><br />
+ <a href="#nogo" id="valueString">method value with paramater 'Medium' (set value by string)</a><br />
+ <a href="#nogo" id="valueNumber">method value with paramater '4' (passed as number)</a><br />
+ <a href="#nogo" id="valueNumberAsString">method value with paramater '11' (passed as string)</a><br />
+ <a href="#nogo" id="valueNonExisting">method value with paramater 'test123' (not existing value)</a>
<br />
<h2>"default popup" Style</h2>
<fieldset>
@@ -54,6 +69,7 @@
<option value="Medium">Medium</option>
<option value="Fast">Fast</option>
<option value="Faster">Faster</option>
+ <option value="11">Up to eleven</option>
</select>
</fieldset>
</form>