Browsing articles tagged with " java script"

Font resizing using jQuery

Font Resizing is a very common feature in many modern websites. This can be done very easily with jQuery. The following script uses cookies to save the user preference, so the user preference is saved. jQuery Cookie plugin is used for managing cookie using jQuery. So include that too. the html for increase, decrease links <div> <a href="javascript:void decreaseFont();" class="font-smaller" title="Reduce font size">-</a> <a href="javascript:void normalFont();" class="font-normal" title="Normal font size">0</a> <a href="javascript:void increaseFont();" class="font-bigger" title="Increase [...]


Disable right-click contextual menu

You can disable right-click contextual menu in your website using jQuery. Download and include jQuery library in your page and add the following code before the tag.


Create a portable slideshow for your website, blog, Myspace, etc from your picasa web album

Create a portable slideshow for your website, blog, Myspace, etc from your picasa web album.. Using Picasa Web Albums you can create a Flash slideshow to embed in your blog or webpage. Each slideshow features built-in playback controls, size options, and the ability to display captions. To create and embed a slideshow: Sign in to your Google Account for Picasa Web Albums at using your Google Account username and password. Click the My Photos [...]


File extension validation Javascript

You can use this function to validate the extension of a file, for client side file upload checkes. // You can specify the file type in the code “valid_extensions = /(.doc|.pdf)$/i;” . //If you want to add .docx supprt simply add |.docx (ex:(.doc|.pdf |.docx| .your-extension) ) var valid_extensions = /(.doc|.pdf)$/i; function CheckExtension(fld) { if(fld.value) { if (valid_extensions.test(fld.value)){ return true; } else { return false; } } else { return true; } }


Javascript for validating a date

Javascript for validating a date. Pass month, day, year as parameters. This function will return true if the date is valid. // Author: function validDate(month, day, year){ if(month ==’0′ || day ==’0′ || year==’0′){ return false; } switch(month){ case ’1′: //** jan case ’3′: //** March case ’5′: //** May case ’7′: //** July case ’8′: //** Aug case ’10′: //** Nov case ’12′: //** Dec if(day >=1 && day =1 && day =1 [...]


Highslide for Wordpress Plugin