tips & tricks


Calendario
aprile 2024
lmmgvsd
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

My Jquery Tutorial

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Untitled Page</title>
    <script src="jquery-1.6.1.js" type="text/javascript"></script>
    <style type="text/css">
    .test
    {
        
        }
    
    </style>

    <script type="text/javascript">

 var verificato = ($('#'+idverificato+':checked').length == 1);

         // Define the entry point
        $(document).ready(function () {
            // The ready function is like Override the onload event
            // window.onload = function () {
            // Now i'm shure the DOM (document object model) is constructed
            // We will initialize and run our plugin here
            // the page finished loading, do something here...

            /*
            Please note the selector and context parameters of the jQuery function object.
            The selector is usually a string that selects a number of elements from the DOM.
            It can also be the this object (a self-reference).
            The jQuery selector parameter accepts the same values you would expect to use in a CSS style definition.
            */

            // Select all elements of class: "someClass" and
            // apply a red border to all of them
            jQuery(".test").css("border", "1px solid red");

            // Select an element with id: someId and insert dynamic html into it
            jQuery("#someId").html("<b>So Bold!</b>");

            // Exactly the same as above, but using $
            $("#someId").html("<b>So Bold!</b>");

            ColorCellTable();

            SpecialEffectExample();

        }



       )

        function EventHandlerExample() {

            $("a").click(function (event) {
                alert("As you can see, the link no longer took you to jquery.com");
                event.preventDefault();
            });
        }
      
        function ColorCellTable() {

            //prende tutti gli elementi TD
            $("td").css("color", "red");

        }

        function AddRemoveClassExample(className) {

            $("a").addClass(className);
            $("a").removeClass(className);

        }


        function SpecialEffectExample() {


            $("a").attr("onmouseover",function myfunction() {
            ('Visit W3Schools!')
    
}

            $("a").click(function (event) {
                event.preventDefault();
                $(this).hide("slow");
            });



            $("p").click(function () {
                $("p").fadeOut("slow");
            });
        }

        var oggetto = function myfunction() {

        }




    
    </script>
</head>
<body>


    <table style="width: 100%;" class="test">
        <tr>
            <td >
                &nbsp;
                a</td>
            <td>
                &nbsp;
                b</td>
            <td id="someId">
                &nbsp;
                c</td>
        </tr>
        <tr>
            <td>
                &nbsp;
                d</td>
            <td>
                &nbsp;
                e</td>
            <td>
                f</td>
        </tr>
        <tr>
            <td>
                g</td>
            <td>
                h</td>
            <td>
                j</td>
        </tr>
        <tr>
            <td>
                Special Effects</td>
            <td>
                <p>fadeOut</p></td>
            <td>
                <a>Hide Slow</a></td>
        </tr>
    </table>


</body>
</html>

Categoria: Jscript
venerdì, 24 giu 2011 Ore. 10.12
Archivio Posts
Anno 2020

Anno 2018

Anno 2015

Anno 2013

Anno 2011

Anno 2010

Anno 2009

Anno 2008
Statistiche
  • Views Home Page: 13.321
  • Views Posts: 56.028
  • Views Gallerie: 2.837
  • n° Posts: 117
  • n° Commenti: 1
Copyright © 2002-2007 - Blogs 2.0
dotNetHell.it | Home Page Blogs
ASP.NET 2.0 Windows 2003