Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function () {
- $(document).tooltip({})
- $("#add").click(function () {
- $("#new_student").dialog("open")
- })
- $("#new_student").dialog({
- autoOpen: false,
- modal: true,
- buttons:{
- Add : function () {
- var student = $("#student_name").val() + " " + $("#student_index").val()
- $("#list_students").append("<li>"+student+"</li>")
- $("#new_student").dialog("close")
- }
- }
- })
- $("#list_students").sortable({
- connectWith: "#test_students"
- })
- $("#test_students").sortable({
- receive: function( event, ui ) {
- $student = $(ui.item)
- $("#student_points").dialog("open")
- }
- })
- $("#student_points").dialog({
- autoOpen: false,
- modal: true,
- buttons:{
- Add : function () {
- var points = $("#points").val()
- $student.attr("title", points)
- $("#student_points").dialog("close")
- }
- }
- })
- })
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>Title</title>
- <link rel="stylesheet" href="jquery/jquery-ui.css">
- <script src="jquery/jquery.js"></script>
- <script src="jquery/jquery-ui.js"></script>
- <script src="script.js"></script>
- <style>
- </style>
- </head>
- <body>
- <h3>Студенти кои го запишале предметот</h3>
- <ul id="list_students">
- <li>Student Student1 190990</li>
- <li>Student Student2 190991</li>
- <li>Student Student3 190993</li>
- </ul>
- <button id="add">Додати студент</button>
- <h3>Студенти кои го полагале тестот</h3>
- <ul id="test_students">
- <li title="50">Student Student1 190990</li>
- <li title="55">Student Student2 190991</li>
- <li title="70">Student Student3 190993</li>
- </ul>
- <div id="new_student">
- <h3>Внеси име на студентот</h3>
- <input type="text" id="student_name">
- <h3>Внеси индекс</h3>
- <input type="text" id="student_index">
- </div>
- <div id="student_points">
- <h3>Внеси поени од тестот</h3>
- <input type="number" id="points">
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement