Archive for category Jquery

Create jquery tutorial

A good jquery tutorial that I find good:

  • http://blog.jeremymartin.name/2008/02/building-your-first-jquery-plugin-that.html
  • http://www.sitepoint.com/blogs/2009/07/22/how-to-develop-a-jquery-plugin/

No Comments

Show and Hide with jquery

With jQuery, you can show and hide div. The implementation is really cool. With jQuery you can show and hide with various functions:

  • show(“fast”) , show(“slow”), show(400). The 400 is in mili seconds
  • hide(“fast”) , hide(“slow”), hide(400). The 400 is in mili seconds
  • slideUp()
  • slideDown()
  • slideToggle()
  • fadeIn()
  • fadeOut()

You can see the demo here and download the code here.

, , , , , , , , , ,

No Comments

jQuery reload page

When you load a page using require PHP function, there is time when you want to reload the page in require PHP function again. You can do this by using the require in a div. Then load the page again using jQuery load function.

Here’s the code in the main page:

<html>
<head>
<script type=”text/javascript” src=”jquery.js”></script>
<script type=”text/javascript”>
function  reload()
{
$(“#page”).load(“page.php?value=test”);
}
</script>
</head>
<body>
<div id=”page”>
<?php
require(“page.php”);
?></div>
<br>
<input type=button value=”Click to reload page.php” onclick=”reload();”>
</body>
</html>

And the function in page.php:

<?php
echo “Test value = ” . $_GET['value'];
?>

, , , , , , , , , , , , , ,

No Comments

Meet jQuery

Today I just learned about jQuery. I couldn’t believe than I haven’t know anything about it. I used to hear a lot of news about jQuery but haven’t got time to try it. Here’s an excelent resource about jQuery:

, , ,

No Comments