jQuery

To Bottom

jQuery

// Use $(callback) for document ready events, the ready() method is deprecated.

// jQuery CDN

// jQuery Event Basics

// Effects

// Themeroller

To Top

// Targeting (Traversal)

// CSS Selectors

To Top

// Attributes

To Top

// Events

jQuery event.which returns which keyboard key or mouse button was pressed for the event

To Top

// jQuery AJAX


    $("document").ready(function() {
        $("#one-button").on("click", getInfoFromServer);
        $("#two-button").on("click", getDblFromServer);
        $("#three-button").on("click", getXmlFromServer);
    });
    function getInfoFromServer() {
        $.ajax({
            type: "GET",
            url: "textFromServer.txt",
            success: postToPage
        });
    }
    function postToPage(data, status) {
        $("#first").text(data);
    }
    function getDblFromServer() {
        $("span").load("getDouble.php",
            $("#the-form").serializeArray());
    }
    function getXmlFromServer() {
        $.ajax({
            type: "GET",
            url: "customer.xml",
            datatype: "xml",
            success: postToPageTwo
        });
    }
    function postToPageTwo(data) {
        $(data).find("customer").each(function() {
            let id = $(this).attr("id");
            let fName = $(this).find("fName").text();
            let lName = $(this).find("lName").text();
            let street = $(this).find("street").text();
            let city = $(this).find("city").text();
            let zip = $(this).find("zip").text();

            $('<div class="fName"></div>').html(fName).appendTo('#customers');
            $('<div class="lName"></div>').html(lName).appendTo('#customers');
            $('<div class="street"></div>').html(street).appendTo('#customers');
            $('<div class="city"></div>').html(city).appendTo('#customers');
            $('<div class="zip"></div>').html(zip).appendTo('#customers');
        });
    }

To Top

// Animation

To Top

// Menu

    
    $("#menu").menu({
        position: {
            my: "center top",
            at: "center bottom"
        }
    });
    

To Top

// Accordion


    $("#accordion").accordion({
        animate: 1500,
        active: 1,
        collapsible: true,
        event: "click",
        heightStyle: "content"
    });

To Top

// Tabs


    $("#tabs").tabs({
        event: "click",
        show: "fadeIn",
        hide: "fadeOut",
        active: 3,
        collapsible: true,
        heightStyle: "auto"
    });

To Top

// Dialog


    $("#dialog").dialog({
        draggable: true,
        resizable: false,
        height: 300,
        width: 300,
        position: {
            my: 'center top',
            at: 'center bottom',
            of: "#openDialog"
        },
        show: 1000,
        hide: 1000,
        autoOpen: false,
        buttons: {
            "OK": function() {
                $("#openDialog").html("You clicked OK");
                $(this).dialog("close");
            }
        }
    });
    $("#openDialog").click(function() {
        $("#customDialog").dialog("open");
    });

To Top

// Tool Tip


    $("[title]").tooltip();

To Top

// Select Menu


    $("#present").selectmenu({ width: 200 });

To Top

// Buttons


    $("#btn-3").button();

To Top

// Radio Buttons


    $("#radio-2").buttonset();

To Top

// Date Picker


    $("#birthday").datepicker({
        changeMonth: true,
        changeYear: true,
        dateFormat: "MM dd, yy",
        numberOfMonths: 1,
        maxDate: 365,
        minDate: -3650
    });

To Top