Tag Archives: jQuery

jQuery – Slideshow Example

This is another jQuery example which i want to share with you. Again, it maybe not good for use but it would be a nice example for beginners to take a quick look on jQuery. Try jQuery Cycle Plugin to get more interesting animation. If you are looking for more jQuery examples, take a look in my previous blog posts.

Continue reading jQuery – Slideshow Example

jQuery – Sliding div Example

There are some jQuery plugins such as jQuery Cycle Plugin which makes website animation simple. The following HTML is a sliding div example without using other plugins. it maybe not good for use but it would be a nice example for beginners to try the power of jQuery. Continue reading jQuery – Sliding div Example

Javascript – Preload Images When the HTML Page is Loaded

With Javasript and jQuery, we could manipulate images at client side. For example, some images are shown on a mouse hover effect. But if that image is too large, there may be some latency before the image could be rendered. We’d better preload those images to minimize the time delay. Continue reading Javascript – Preload Images When the HTML Page is Loaded

jQuery & Javascript – Capture the Browser or Tab Closed Event

I was working on a WordPress project which i need to clear the PHP session when the browser or browser tab is closed. Although Javascript provides the window.onbeforeunload event but it will be triggered even whenever you leave the website. Finally i got a simple solution from Daniel Melo in StackOverflow. The following code required jQuery and i have included the Google one in the HTML.

In your web root, create the js/check_browser_close.js. Continue reading jQuery & Javascript – Capture the Browser or Tab Closed Event

jQuery – Cycle Plugin White Background Problem in Internet Explorer

The jQuery Cycle plugin is so helpful on showing animated slide show in your webpage. Check it out at the following website to find more details.
jQuery Cycle Plugin

But thanks Microsoft, it’s greatest product, Internet Explorer 7 and 8 has a bug when showing transparent png in the slide show. That is a white background would be added to the cycle element which block the background image. Add the following options when calling the cycle function. Continue reading jQuery – Cycle Plugin White Background Problem in Internet Explorer

jQuery & Javascript – Schedule a Function call by setTimeout()

In Javascript, you could schedule a function call using the setTimeout().

<html>
  <head>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.js"></script>
    <script type="text/javascript">
      $(document).ready(function() {
        setTimeout(delayedAlert, 3000);
      });
		
      function delayedAlert() {
        alert("Hello Eureka!");
      }
    </script>
  </head>
  <body>
    <h1>Eureka!</h1>
  </body>
</html>

Continue reading jQuery & Javascript – Schedule a Function call by setTimeout()