Thursday 22 March 2012


·   Problem: How can use animation in JavaScript?
 
    Solution: jQuery is a cross-browser javascript library. The syntax provided is to allow easier use of functions and events and provides simple to create animations, handle events and develop AJAX applications.

·    <script type="application/javascript" language="javascript" src="jquery-1.7.1.min.js" ></script>add in header in JavaScript
·        
 Effects: Function show(){$(“#id_name”).show();} .hide(); .slidetoggle(); .fadein(); .fadeout(); .hide(1000); .html(‘content’);

  We will refer to all calls to the jQuery library via the ($) dollar sign.
Selectors: is the term given to the specific tag requested to perform specific actions.  Like: $(“p:first”) 

 Events: $(document).ready(function(e) {   alert("Welcome to my HTML file! "); });
  Several events: .blur(), .change(), .onclick(), .focus(), .onmouseover(), .onkeydown(), .scroll()

  $(“body”).text(“This is new text”) = document.write() function in javascript in HTML page

No comments:

Post a Comment