Upcoming Pokemon RPG coming soon! Join the testing team to gain insight and some extra goodies once released. Details found here
+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    Administrator Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of
    Join Date
    Nov 2010
    Location
    TT
    Posts
    4,510
    Simoleons
    7,269
    Blog Entries
    12
    Gibs is an rpg addict
    Male
    jQuery syntax or "the structure the code should be written in"is pretty straight forward.

    $ is the symbol reserved for activating jquery.
    Init, or initiation codes are codes that activated a certain function
    Function, a template or blueprint used to process data. can be represented as function_name()
    #, symbol representing an ID
    . symbol representing a class (a preiod)
    attribute, a parameter of a html tag. like <div class="big"></div> where class is the attribute and big is its value.

    I will be using that alot so its best to understand them properly.

    [top]The basic usage


    jQuery can edit an element on a page using various ways. the most basic of ways is to call the run a function for an element using id's. It is done in this format. (the init code)

    Code:
    $("#my_id").hide()
    the above code will search for the element with the ID "my_id" and run the predefined function "hide".
    In jquery, the hide() funtion will add "style='display:none' " to the element, which hides it.

    You can pass on parameters with functions as well, so if you want to make it hide, but slowly, jQuery can easily support this. There are predefined parameters to specify the hide type, example "slow"
    using this parameter is as follows.

    Code:
    $("#my_id").hide("slow")
    The code will append the "style='display:none' " to the attribute of "my_id" but along with an opacity change, so the effect is a smooth transition, shown here:



    pretty simple.

    [top]Advanced Functions


    The real benefit of jQuery, is its ability to stack functions on top each other. Or in other words, run multiple functions per element in one code block. Other coders use the terms "binding" or "stacking" but they all mean the same thing.

    Say for example I want to change the text color of an element, but only if a user clicks on my special button. the code is as follows:

    Code:
    $("#my_id").click(function(){
        $("#my_id").css("color","green");
    });
    The code $("#my_id").css("color","green"); will only activate once the element "my_id" is clicked upon. So we can stack infinite functions upon each other to get various effects.

    In the beginning there was a hum
    from a poet whose pulse felt:
    "DRUM DRUM DRUM! "

    He would perform prayers and all
    till one day he heard a voice call
    "COME COME COME! "

    Sus'pi'cious he moved with vicious caution.
    Dismisses, he thinks its a little off.
    People get held back
    by the voice inside 'em.


    The voice said,
    I'm poised to speak inside you...
    "Rejoice then ...please let me invite you,
    ...To evil, greed and lies too."

    ..and knock on his door, his heart is no more,
    ..and knock on his door, his soul is no more ..

    Originally Posted by Gibs



  2. The Following 2 Users Added to Gibs Reputation For This Useful Post:

    behemoth101 (06-25-2011), nateAnator (06-25-2011)

  3. #2
    AF's Encoders nateAnator is a jewel in the rough nateAnator is a jewel in the rough nateAnator is a jewel in the rough
    Join Date
    Feb 2011
    Location
    Australia
    Posts
    816
    Simoleons
    1,205
    nateAnator Is a Crisp Malt Centre
    Keep this up, iv always wanted to learn javascript but never got around it it.

  4. #3
    Administrator Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of
    Join Date
    Nov 2010
    Location
    TT
    Posts
    4,510
    Simoleons
    7,269
    Blog Entries
    12
    Gibs is an rpg addict
    Male
    ah jQuery is valid javascript but javascript is not valid jQuery. think about that.

    You're better off learning jQuery instead of javascript. I had no idea how to code in javascript up until last month. Instead of learning javascript, i jumped right into jQuery and javascript now is soooooooooooo easy.

    In the beginning there was a hum
    from a poet whose pulse felt:
    "DRUM DRUM DRUM! "

    He would perform prayers and all
    till one day he heard a voice call
    "COME COME COME! "

    Sus'pi'cious he moved with vicious caution.
    Dismisses, he thinks its a little off.
    People get held back
    by the voice inside 'em.


    The voice said,
    I'm poised to speak inside you...
    "Rejoice then ...please let me invite you,
    ...To evil, greed and lies too."

    ..and knock on his door, his heart is no more,
    ..and knock on his door, his soul is no more ..

    Originally Posted by Gibs



  5. #4
    AF's Encoders nateAnator is a jewel in the rough nateAnator is a jewel in the rough nateAnator is a jewel in the rough
    Join Date
    Feb 2011
    Location
    Australia
    Posts
    816
    Simoleons
    1,205
    nateAnator Is a Crisp Malt Centre
    ah jQuery is valid javascript but javascript is not valid jQuery. think about that.

    Originally Posted by Gibs


    i have thought about it and googled a little, as long as you keep postin ill try to learn :)

  6. #5
    Senior Member behemoth101 is on a distinguished road
    Join Date
    May 2011
    Location
    Bangladesh
    Posts
    142
    Simoleons
    10
    behemoth101 is behind the curtains.
    so u dont need to knw javascript for jquery huh?

  7. #6
    Administrator Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of
    Join Date
    Nov 2010
    Location
    TT
    Posts
    4,510
    Simoleons
    7,269
    Blog Entries
    12
    Gibs is an rpg addict
    Male
    i didnt need it :)

    In the beginning there was a hum
    from a poet whose pulse felt:
    "DRUM DRUM DRUM! "

    He would perform prayers and all
    till one day he heard a voice call
    "COME COME COME! "

    Sus'pi'cious he moved with vicious caution.
    Dismisses, he thinks its a little off.
    People get held back
    by the voice inside 'em.


    The voice said,
    I'm poised to speak inside you...
    "Rejoice then ...please let me invite you,
    ...To evil, greed and lies too."

    ..and knock on his door, his heart is no more,
    ..and knock on his door, his soul is no more ..

    Originally Posted by Gibs



  8. #7
    Senior Member behemoth101 is on a distinguished road
    Join Date
    May 2011
    Location
    Bangladesh
    Posts
    142
    Simoleons
    10
    behemoth101 is behind the curtains.
    i've been reading the tuts of js at w3....they are difficult....so im reading the jquery tuts

  9. #8
    Administrator Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of
    Join Date
    Nov 2010
    Location
    TT
    Posts
    4,510
    Simoleons
    7,269
    Blog Entries
    12
    Gibs is an rpg addict
    Male
    yup, jQuery, i keep telling you guys, jQuery makes it easy to grasp...too easy

    In the beginning there was a hum
    from a poet whose pulse felt:
    "DRUM DRUM DRUM! "

    He would perform prayers and all
    till one day he heard a voice call
    "COME COME COME! "

    Sus'pi'cious he moved with vicious caution.
    Dismisses, he thinks its a little off.
    People get held back
    by the voice inside 'em.


    The voice said,
    I'm poised to speak inside you...
    "Rejoice then ...please let me invite you,
    ...To evil, greed and lies too."

    ..and knock on his door, his heart is no more,
    ..and knock on his door, his soul is no more ..

    Originally Posted by Gibs



  10. #9
    Moderator Bill will become famous soon enough Bill will become famous soon enough
    Join Date
    Nov 2010
    Location
    Trinidad and Tobago
    Posts
    822
    Simoleons
    1,770
    Bill is behind the curtains.
    Male
    you used this on the pokemon rp thing for the part that says
    "ANIMEFANS PRESENTS"
    correct?

    Credits to bolt
    The things people do in this world ^^
    Register for the Member Knockout Tournament Today!

  11. #10
    Administrator Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of Gibs has much to be proud of
    Join Date
    Nov 2010
    Location
    TT
    Posts
    4,510
    Simoleons
    7,269
    Blog Entries
    12
    Gibs is an rpg addict
    Male
    yup thats the fadeIn function with a callback to fadeOut once completed.
    here is the code that controls that whole effect

    HTML Code:
    $(document).ready(function(){
    	$("#animation_op").animate({
    		minHeight:"522px"
    	},5000,function(){
    		$("#animation_op").fadeOut(5000,function(){
    			$("#animation_logo").fadeIn(5000,function(){
    				$("#animation_logo").fadeOut(5000,function(){
    					$("#animation_cont").fadeIn(5000,function(){
    					
    					});
    				});
    			});
    		});
    	});
    });

    In the beginning there was a hum
    from a poet whose pulse felt:
    "DRUM DRUM DRUM! "

    He would perform prayers and all
    till one day he heard a voice call
    "COME COME COME! "

    Sus'pi'cious he moved with vicious caution.
    Dismisses, he thinks its a little off.
    People get held back
    by the voice inside 'em.


    The voice said,
    I'm poised to speak inside you...
    "Rejoice then ...please let me invite you,
    ...To evil, greed and lies too."

    ..and knock on his door, his heart is no more,
    ..and knock on his door, his soul is no more ..

    Originally Posted by Gibs



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts