Tag: javascript


jQuery File Upload – With Drag n’ Drop

Posted by Alaa Badran in AJAX, CSS, DHTML, Java Script, Jquery, Web & Programming. 2 comments

18th March

jQuery File Upload is a plugin for the popular JavaScript framework that helps handling file uploads.

The plugin is based on open standards like HTML5-JavaScript and No Flash. For legacy browsers it falls back to an Ajaxed-like iframe-PHP solution.

Multiple files can be selected, they can even be drag ‘n’ dropped from the desktop and the upload process can start automatically or with an event (like clicking the “upload” button).

A progress bar can display the status and uploads can be canceled anytime.

It is possible to use multiple instances of the plugin in the same page and jQuery File Upload is compatible with any server-side application platform.


jQuery Gloss Plugin

17th January

It’s lovely to make you webpage interactive. jQuery plugins add effects to multiple elements of HTML. jQuery Gloss adds a Gloss (shining) effect to images by simple and lightweight code.

This effect is added on hover effect (mouseover, mouseout).

This plugin is ~2.2 Kb and it’s simple as:

Add a DIV element to hold the image with class=”gloss”. eg:
<div class=”gloss”><img src=”” alt=”Image gloss effect” /></div>
Include the script file of jQuery Gloss plugin. eg:
<script type=”text/javascript” src=”gloss.1.0.js”></script>
Call the Gloss function. eg:
<script type=”text/javascript”>$(document).ready(function (){ $.gloss(); });</script>
OR
add this before </body>: <script type=”text/javascript”> $.gloss();  </script>

Resources:

jQuery Plugins: plugins.jquery.com/project/gloss
Source & Demo: www.freelancer-id.com/gloss


jQuery Animate – Advanced

24th September

In the last jQuery Animate article I wrote, I mentioned how to use the .animate() function with few tricks.

But here, I am going to write about jQuery Animate function in general and I will explain few things and some tricks.

The jQuery Animate is a smart object because could be used at any syntax.
I mean,
We can use the default syntax of this function as follow:

$().animate({
/* params */ },
/* integet time period in milliseconds */
);


jQuery Animate

19th May

Here I will mention how to use the jquery animate function and the usability and flexibility of it.
The syntax of this function is:

$.animate(options, settings, callback);
/* you can replace setting with duration (in milliseconds) or words: ‘slow’, ‘normal’ or ‘fast’.
callback is optional */

Below is a list of popular and most used animation:

increasing/decreasing width and height
moving or scrolling html element
changing opacity
scrolling window

Now let me explain each in an example.


Scroll window smoothly using jQuery

26th March

Using jQuery animate() function to do a smooth scrolling:

I have also created a div as follow:

<div id=”scrollToHere”>
Scroll to here
</div>

You need something to run your script. Create a button like this:

<input type=”button” onclick=”scollWin();” value=”Scroll up” />

The jQuery Code will be like this:

function scrollWin(){
$(‘html,body’).animate({
scrollTop: $(“#scrollToHere”).offset().top
}, 800);
}

Here is something to try:

now jQuery window scrolling is done with animation.

Enjoy it..


Better way to load XML document with Javascript

31st December

The better way to load XML document on all browsers is to use AJAX technique.

After testing XML with Javascript. I fount that Safari (on Mac OSX 10) does not support XML with Javascript.
So, How to load it then?