Jeszcze jest problem ponieważ czarna obramówka uciekła w prawo oraz nazwa label nie jest wyśrodkowana do pola.
Kod formularza:
Kod
<script type="text/javascript">
$(function()
{
var itemList =
[
{url: "http://ejohn.org", title: "John Resig"},
{url: "http://bassistance.de/", title: "Jörn Zaefferer"},
{url: "http://snook.ca/jonathan/", title: "Jonathan Snook"},
{url: "http://rdworth.org/", title: "Richard Worth"},
{url: "http://www.paulbakaus.com/", title: "Paul Bakaus"},
{url: "http://www.yehudakatz.com/", title: "Yehuda Katz"},
{url: "http://www.azarask.in/", title: "Aza Raskin"},
{url: "http://www.karlswedberg.com/", title: "Karl Swedberg"},
{url: "http://scottjehl.com/", title: "Scott Jehl"},
{url: "http://jdsharp.us/", title: "Jonathan Sharp"},
{url: "http://www.kevinhoyt.org/", title: "Kevin Hoyt"},
{url: "http://www.codylindley.com/", title: "Cody Lindley"},
{url: "http://malsup.com/jquery/", title: "Mike Alsup"}
];
var opts =
{
's1': {decimals:2},
's2': {stepping: 0.25},
's3': {currency: '$'},
's4': {},
's5': {
init: function(e, ui)
{
for (var i=0; i<itemList.length; i++)
{
ui.add('<a href="'+ itemList[i].url +'" target="_blank">'+ itemList[i].title +'</a>');
}
},
format: '%(title) <a href="%(url)" target="_blank">»</a>',
items: itemList
}};
for (var n in opts)
$("#"+n).spinner(opts[n]);
$("button").click(function(e)
{
var ns = $(this).attr('id').match(/(s\d)\-(\w+)$/);
if (ns != null)
$('#'+ns[1]).spinner( (ns[2] == 'create') ? opts[ns[1]] : ns[2]);
});
});
</script>
$(function()
{
var itemList =
[
{url: "http://ejohn.org", title: "John Resig"},
{url: "http://bassistance.de/", title: "Jörn Zaefferer"},
{url: "http://snook.ca/jonathan/", title: "Jonathan Snook"},
{url: "http://rdworth.org/", title: "Richard Worth"},
{url: "http://www.paulbakaus.com/", title: "Paul Bakaus"},
{url: "http://www.yehudakatz.com/", title: "Yehuda Katz"},
{url: "http://www.azarask.in/", title: "Aza Raskin"},
{url: "http://www.karlswedberg.com/", title: "Karl Swedberg"},
{url: "http://scottjehl.com/", title: "Scott Jehl"},
{url: "http://jdsharp.us/", title: "Jonathan Sharp"},
{url: "http://www.kevinhoyt.org/", title: "Kevin Hoyt"},
{url: "http://www.codylindley.com/", title: "Cody Lindley"},
{url: "http://malsup.com/jquery/", title: "Mike Alsup"}
];
var opts =
{
's1': {decimals:2},
's2': {stepping: 0.25},
's3': {currency: '$'},
's4': {},
's5': {
init: function(e, ui)
{
for (var i=0; i<itemList.length; i++)
{
ui.add('<a href="'+ itemList[i].url +'" target="_blank">'+ itemList[i].title +'</a>');
}
},
format: '%(title) <a href="%(url)" target="_blank">»</a>',
items: itemList
}};
for (var n in opts)
$("#"+n).spinner(opts[n]);
$("button").click(function(e)
{
var ns = $(this).attr('id').match(/(s\d)\-(\w+)$/);
if (ns != null)
$('#'+ns[1]).spinner( (ns[2] == 'create') ? opts[ns[1]] : ns[2]);
});
});
</script>
Kod
<form action="settings.php" method="post">
<label for="s1">Temperature: </label>
<div class="ui-spinner">
<input type="text" id="s1" name="temperature" class="ui-spinner-box" autocomplete="off" value=<? echo $temperature;?>>
<button class="ui-spinner-up" type="button">▲</button>
<button class="ui-spinner-down" type="button">▼</button>
</div>
</form>
<label for="s1">Temperature: </label>
<div class="ui-spinner">
<input type="text" id="s1" name="temperature" class="ui-spinner-box" autocomplete="off" value=<? echo $temperature;?>>
<button class="ui-spinner-up" type="button">▲</button>
<button class="ui-spinner-down" type="button">▼</button>
</div>
</form>
Kod
label
{
float: left;
margin-right: .5em;
padding: .15em 0;
font-weight: bold;
}
.ui-spinner
{
width: 87.5px;
height: 40px;
border-radius: 10px;
display: block;
position: relative;
overflow: hidden;
border: 1px solid #999;
background: #FEFEFE url(styles/images/spinner-bg.gif) repeat-x left bottom;
padding: 0 1px;
}
.ui-spinner-disabled
{
background: #F4F4F4;
color: #CCC;
}
.ui-spinner-box
{
width: 87.5px;
height: 40px;
border-radius: 10px;
float: right;
font-size: 20px;
border: none;
background: none;
padding: 0;
text-align: left;
margin-left: 26px;
float: left;
font-weight: bold;
}
.ui-spinner-up, .ui-spinner-down
{
width: 10px;
height: 10px;
font-size: 8px;
padding: 0px;
margin: 9px;
z-index: 100;
text-align: center;
vertical-align: middle;
position: absolute;
right: -3px;
cursor: default;
border: 1px solid #999;
border-right: none;
border-top: none;
}
.ui-spinner-down
{
bottom: 0;
border-bottom: 0;
}
.ui-spinner-pressed
{
background: #FEFEFE;
}
.ui-spinner-list, .ui-spinner-listitem
{
margin: 0;
padding: 0;
}
{
float: left;
margin-right: .5em;
padding: .15em 0;
font-weight: bold;
}
.ui-spinner
{
width: 87.5px;
height: 40px;
border-radius: 10px;
display: block;
position: relative;
overflow: hidden;
border: 1px solid #999;
background: #FEFEFE url(styles/images/spinner-bg.gif) repeat-x left bottom;
padding: 0 1px;
}
.ui-spinner-disabled
{
background: #F4F4F4;
color: #CCC;
}
.ui-spinner-box
{
width: 87.5px;
height: 40px;
border-radius: 10px;
float: right;
font-size: 20px;
border: none;
background: none;
padding: 0;
text-align: left;
margin-left: 26px;
float: left;
font-weight: bold;
}
.ui-spinner-up, .ui-spinner-down
{
width: 10px;
height: 10px;
font-size: 8px;
padding: 0px;
margin: 9px;
z-index: 100;
text-align: center;
vertical-align: middle;
position: absolute;
right: -3px;
cursor: default;
border: 1px solid #999;
border-right: none;
border-top: none;
}
.ui-spinner-down
{
bottom: 0;
border-bottom: 0;
}
.ui-spinner-pressed
{
background: #FEFEFE;
}
.ui-spinner-list, .ui-spinner-listitem
{
margin: 0;
padding: 0;
}
Obrazek dla wglądu:
