PHP jQuery Cookbook phần 8

Nhưng hầu hết thời gian các plugin cố gắng để được như vậy hoàn toàn có tính năng không cần thiết leo. Trong chương này chúng ta sẽ tạo ra các vật dụng, chẳng hạn như accordion, DIVs nổi, và kỹ thuật phai màu vàng là phổ biến trong các ứng dụng AJAX hiện đại. Chúng tôi sẽ tạo ra những cách thức đơn giản với | Simpo PDF Merge and Split Unregistered Version - http Creating Cool Navigation Menus----------------------------------------------- function displaySelectedValues var name userName .val var product product .val var quantity quantity .val var strHtml Hello name strHtml Please confirm your selection br strHtml strong Item strong product strHtml br strHtml strong Quantity strong quantity strHtml ul order .html strHtml script 3. Save the file and open it in your browser. You will see three familiar tabs. Enter some value in the first tab and click on the Next button. Then select a product and its quantity from the second tab and click on the Next button. The final tab will show you a confirmation message with the values that you have selected. Simpo PDF Merge and Split Unregistered Version - http -----------------------------------------------------------------------------------Chapter 7 How it works. First we hide all tabs except the first one. Then add class active to the first tab. Then comes the event handler for the Previous and Next buttons. When a button is clicked we get the index of its parent DIV in variable currentTablndex using the getCurrentTabIndex function. Then the handler function checks the class of the clicked button. If it is prev which means user wants to navigate to previous tab we then decrease the value of currentTablndex and pass it to the showHideTabs function. Similarly if the button has class next we pass the incremented value of currentTabIndex to the showHideTabs function. Function showHideTabs first removes the class active from the list item. Then it finds the list item whose index is equal to the passed index and adds class active to it. Then the visible tabContent DIV is hidden and the DIV whose index matches the passed index is displayed. In the end the code checks if the tab is the last one or not by checking for class last. If it is the last tab then function displaySelectedValues is called. .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
111    334    1    06-06-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.