Recommended:

  • phpclasses.org
  • jsclasses.org
  • jsmag.com
  • siteapps.com
  • View our reviews on Hot Scripts
  • JS Tutorial
  • scripts.com
  • securesignup.com




Recent Comments

Powered by Disqus




Javascript events - crossbrowser

Here's a two useful functions to manipulate events in javascript. First one allows you to add new event. And second one will return you element, which fired event. //add event var add_event = function(element, type, listener){ if(element.addEventListener) { element.addEventListener(type, listener, false); } ...

Comments Read more

Crossbrowser viewport size

This function allows you to get viewport dimensions (width and height). Viewport is an area that is available for webpage, that is screen resolution - toolbars etc. //get viewport size var viewport = function(){ var viewport = new Object(); viewport.width = 0; viewport.height = 0; // the more standards compliant browsers...

Comments Read more

Convert twitter created_at time format to ago format

Here is a simple PHP function, which can convert created_at time format from twitter API to ago time format (hour ago, week ago, etc) like on twitter website itself. <?php function twitter_time($a) { //get current timestampt $b = strtotime("now"); //get timestamp when tweet created $c = strtotime($a); //get...

Comments Read more

Generate forms programmatically

Auto form class can generate simple insert, update, select and delete HTML forms, form validation and form processing code programmatically based on mysql table information It classifies mysql data types in different categories, uses predefined HTML markup for each of them, and uses standard datatype attributes like legth, null, etc for...

Comments Read more

Cross format color manager

Color manager class accepts different color formats like: Named colors (like green), Hex (like #fff or #ffffff or ffffff), RGB (like rgb(255,255,255)), RGB alpha (like rgba(255,255,255,1)), HSL (like hsl(360,100,100)), HSL alpha (like hsla(360,100,100,1)). Thus making it compatible with different...

Comments Read more

Javascript marquee

Marquee class can be used to create horizontal or vertical marquee elements (scrolling texts/html elements) in websites. This class takes id of element and then wrap all child nodes of that element in div elements and create array of those elements to rotate through visible part. Even if there is only one child node, still it will be copied to...

Comments Read more

High resolution image background resizer

Background resizer class can be used to display high resolution images as background for websites. Class will resize background image for different screen resolutions supporting this criterias: fill window from edge to edge display largest area possible keep image proportions (without streching image) hide scrollbars caused by...

Comments Read more

Star rating class

Star rating class can be used to display rating using empty and full star graphics (user defined or default package graphic) and allow visistors to rate items from 1 to user defined value, by displaying full/empty stars on mouse movement and passing value through get or post Package contains star_rating.js and star_rating.packed.js (packed...

Comments Read more

Cursor positions and text selections

For each input in every modern browser there are properties like selectionStart and selectionEnd using which we can easily manipulate cursor position and text selection. Every browser except IE.  In IE you will have to deal with text ranges and there is no united way for textareas and input methods, so we'll need to create separate...

Comments Read more

Rate content using stars

Here are some javascript functions, that will allow your visitors to rate your content by clicking on stars. We will use same stars, that are used in display rating using stars article. So what we will do, is define two CSS classes with full star and empty star. Then create 3 javascript function. One for onmouseover event that will change...

Comments Read more

Javascript snow for your website to create Christmas atmosphere

Here is a nice javascript Snow to add Christmas atmosphere to your website. You can manage snow flake graphic, speed, amplitude etc. Easy to implement and it looks really nice. You can download latest version from JavaScript Display snow flakes falling on the Web page An here is how to implement it to your website: <script...

Comments Read more

Using Google Analytics Async code for Ajax websites

For faster page loading it is suggested to put all your javascript files to the bottom after all content. But Google Analytics Async Code does not slow down page loading time, because it is working synchronously, thus it can be used in the beginning of the page. But as code doesn't reload using AJAX, then those pages aren't tracked....

Comments Read more

Search optimization for AJAX websites

AJAX not only provides faster website loading (because not whole page is refreshed, but only part of content is changed ), but also more interactivity and better user experience. But one main thing that discourages web developers from using AJAX on their websites is that AJAX generated pages are not indexed by search...

Comments Read more

Collecting and debugging PHP and mysql errors

As you know it is advised to prevent showing PHP related error messages because of security issues. So how can you track if there are any errors in your script that might not only have effect on user experience, but also potentially create security holes for others to exploit. The best way is to create custom handlers for errors. You...

Comments Read more

Delay external content loading for better performance

It is hard to imagine website without without any external content. Either it is a sharing tool like twitter button, widget or even advertising like adsense, they're all using external scripts that will increase your website loading time. But that doesn't mean you shouldn't use any external content. Some of this tools are...

Comments Read more

Cache images from PHP output

Sometime you need to generated image using PHP and mostly it's because you want to make dynamical image, that changes often, like CAPTCHAs. But there are rare occasions, when this image do not change. OF course browser usually don't cache PHP generated images, but if image that is outputted by PHP doesn't change, why shouldn't...

Comments Read more

Get document dimensions (cross browser compatible)

Here are two javascript functions to get document dimensions, which works in all popular browsers. Basic idea is to check all possible values in all possible combinations and take maximal value, so if in one browser this value is undefined, it will be interpreted as 0 and could never be maximal value. Here is a code snippet of those...

Comments Read more

Implement music theory to generate scale and chord notes

Music theory class implements music theory for generating scales and chords based on interval patterns between notes. User can add custom scale and chord patterns. This class can: generate scale notes by provided scale name and type generate chord notes by provided chord name and type transpose scales transpose...

Comments Read more

Get password behind asterix when auto filling forms

Using different passwords for different websites is almost mandatory nowadays, but it is also pretty hard to keep track of all passwords, so people usually use form fillers. Either it is a built in webrowser or plugin, or standalone application, you just save password once and then auto fill login form without even remembering your password....

Comments Read more

Simple Auto-CMS using HTML pages

Here is an interesting idea of CMS which is managed by HTML files. It is simple php script, that searches specified location and takes all folders and html files and interprets them as pages and content. Basically, you can manage your content with HTML files, and this script will automatically create menu to browse them. For example,...

Comments Read more



1 2 3 4 5 6 7 8 9 10 11