0

プログレスバーの上に、バーが何パーセントにあるかを示すパーセントボックスが欲しい

私はjqueryが初めてで、いくつか試しましたが、途方に暮れています。誰かが私に道を教えてくれることを願っています。

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>

<link type="text/css" rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquerui.js"></script>



<script type="text/javascript">
$(document).ready(function () {
    var target = new Date('10/25/2013'),
    today = new Date(),
    daysToGo = Math.ceil((target.getTime() - today.getTime() ) / (1000*60*60*24)),
    // probably not the best, but it should work
    percent = 100 - daysToGo;

    $('#percent').text (percent + '%');
    $("#progressbar").progressbar({
        value: percent,
        create: function(event, ui) {
            $('.ui-progressbar').append(daysToGo + ' days left!');
        }
    });
});
    </script>

    </head>

    <body>

    <div id="progressbar"></div>

    <div id="percent"></div>

    </body>

    </html>
4

1 に答える 1

0

作成をリッスンする必要はありません。変更を加えるだけです。

$("#progressbar").progressbar({
    value: percent
});
$('.ui-progressbar').append(daysToGo + ' days left!');
于 2013-10-08T17:09:56.270 に答える