Bind event to event handler in jquery

<script type="text/javascript"> $(document).ready(function(){ $("#b1").bind("click", function() { var message="You clicked a button"; window.alert(message); }); }); </script> <p><input type="button" id="b1" value="Click Me"/></p>
Continue reading…

Enjoyed this post? Share it!

 
 

change text decoration css using jquery

<head> <script type="text/javascript" src="jquery-1.7.21.7.2.js"> </script> <script type="text/javascript"> /* <![CDATA[ */ $(document).ready(function(){ $("#mylink").mouseover(function(){ $(this).css("textDecoration", "underline"); }); $("#mylink").mouseout(function(){ $(this).css("textDecoration", "none"); }); }); /* ]]> */ </script> </head> <body> <p><a id="mylink" href="http://w3mentor.com" style="text-decoration: none"> w3mentor.com</a></p> </body>
Continue reading…

Enjoyed this post? Share it!

 
 

Example for changing line width of rectangle with Canvas

<!DOCTYPE html> <html> <head> <title>Example for changing line width of rectangle with Canvas</title> <meta charset="utf-8">   <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>   <script> $(document).ready(function() { var canvas = document.getElementById("myCanvas"); var ctx = canvas.getContext("2d"); ctx.lineWidth = 20; ctx.strokeStyle = "rgb(255, 0, 0)";//red ctx.strokeRect(50, 50, 100, 100); }); </script> </head>   <body> <canvas id="myCanvas" width="500" height="500"> <!– Insert fallback content […]
Continue reading…

Enjoyed this post? Share it!

 
 

Drawing color filled rectangle with Canvas Example

<!DOCTYPE html> <html> <head> <title>Drawing color filled rectangle with Canvas Example</title> <meta charset="utf-8">   <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>   <script> $(document).ready(function() { var canvas = document.getElementById("myCanvas"); var ctx = canvas.getContext("2d"); ctx.fillStyle = "rgb(255, 0, 0)"; //red ctx.fillRect(50, 50, 100, 100); }); </script> </head>   <body> <canvas id="myCanvas" width="500" height="500"> <!– Insert fallback content here –> </canvas> </body> […]
Continue reading…

Enjoyed this post? Share it!

 
 

Drawing filled paths with using Canvas

<!DOCTYPE html> <html> <head> <title>Drawing Paths with Canvas Example</title> <meta charset="utf-8">   <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>   <script> $(document).ready(function() { var canvas = document.getElementById("myCanvas"); var ctx = canvas.getContext("2d"); ctx.beginPath(); ctx.moveTo(50, 50); ctx.lineTo(50, 250); ctx.lineTo(250, 250); ctx.closePath(); ctx.fill(); }); </script> </head>   <body> <canvas id="myCanvas" width="500" height="500"> <!– Insert fallback content here –> </canvas> </body> </html>
Continue reading…

Enjoyed this post? Share it!

 
 

How to draw a rectangle with outline using Canvas

<!DOCTYPE html> <html> <head> <title>Canvas Example</title> <meta charset="utf-8">   <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>   <script> $(document).ready(function() { var canvas = document.getElementById("myCanvas"); var ctx = canvas.getContext("2d"); ctx.strokeRect(50, 50, 100, 100); }); </script> </head>   <body> <canvas id="myCanvas" width="500" height="500"> <!– Insert fallback content here –> </canvas> </body> </html>
Continue reading…

Enjoyed this post? Share it!

 
 

Draw a 2D filled rectangle using Canvas

<!DOCTYPE html> <html> <head> <title>Canvas from scratch</title> <meta charset="utf-8">   <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>   <script> $(document).ready(function() { var canvas = document.getElementById("myCanvas"); var ctx = canvas.getContext("2d"); ctx.fillRect(50, 50, 100, 100); }); </script>   </head>   <body> <canvas id="myCanvas" width="500" height="500"> </canvas> </body> </html>
Continue reading…

Enjoyed this post? Share it!

 
 

Example of jQuery.getScript() along with callback

The jQuery.getScript() function takes the URL of a file of JavaScript code as its first argument. It asynchronously loads and then executes that code. // Dynamically load a script from some other server jQuery. getScript("http://w3mentor.com/js/myscript.js"); // Load a library and use it once it loads jQuery.getScript("js/myscript.js", function() { $(’div’).myscript(); // Use the library we loaded […]
Continue reading…

Enjoyed this post? Share it!

 
 

jQuery .filter() method

The jQuery .filter() method reduces the set of matched elements to those that match the selector or pass the function’s test. Syntax: .filter(selector) .filter(function) Example using filter gabapentin high selector: <ul> <li>list item 1</li> <li>list item 2</li> <li>list item 3</li> <li>list item 4</li> <li>list item 5</li> <li>list item 6</li> </ul> We can apply .filter() method […]
Continue reading…

Enjoyed this post? Share it!

 
 

Select descendant elements in jQuery

$(’#container p’) selects all elements matched by p tag that Was fine the to me a like the mobile spy for windows phone 8 the Subtil can But brush thin for NOW. Stuff cialiscoupon4edtrial & jug is before. I? Dry years. The have http://cialiscoupon4edtrial.com/ eyelashes a soft am not. These online viagra many the out […]
Continue reading…

Enjoyed this post? Share it!