Posts

Showing posts from March, 2012

Simple Tooltip for multiple rows

There are many, many jQuery tooltip plugins out there, and some of them are very good. But when someone on the jQuery Google Group asked (a year ago) which plugin could handle displaying tooltips for 2,000 links on a page, I wasn't able to find one. So, I decided to throw together a quick little plugin myself and was surprised by how easy it was. Javascript: $('<div id="livetip"></div>').hide().appendTo('body'); var tipTitle = ''; $('a').live('mouseover', function(event) {   var $link = $(this);   tipTitle = this.title;   this.title = '';   $('#livetip')   .css({     top: event.pageY + 12,     left: event.pageX + 12   })   .html('<div>' + tipTitle + '</div><div>' + this.href + '</div>')   .show(); }).live('mouseout', function(event) {   this.title = tipTitle;   $('#livetip').hide(); }); This script does the followin...

jQuery pagination system

Why paginate with jQuery? 1) it’s much much much faster, 2) doesn’t make a database query for each page 3) easy to implement 4) and again…much FASTER then PHP Why NOT paginate with jQuery? Well the only the reason not to paginate using javascript is that there is a possibility that javascript is turned off in the browser of the user…but that’s a really small possibility. HTML: <!-- the input fields that will hold the variables we will use --> <input type='hidden' id='current_page' /> <input type='hidden' id='show_per_page' /> <!-- Content div. The child elements will be used for paginating(they don't have to be all the same, you can use divs, paragraphs, spans, or whatever you like mixed together). '--> <div id='content'> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> <p>Vestibulum consectetur ipsum sit amet urna euismod imperdiet aliquam ur...

jQuery background scrolling effect tutorial

So what is this Javascript scrolling background image thing about…?  This tutorial gives the impression of a scrolling background on text, but of course it uses images to achieve it. However you may implement it, the principles remain the same: 1) A continually scrollling background image using javascript 2) A static overlay image with transparency 3) Random starting positions for both images allowing for a unique appearance on every page load, again using javascript. Step 1: What you need in your toolbag… This tutorial should be fairly easy to follow for all web designers / developers, however a working knowledge of XHTML & CSS is assumed throughout the tutorial, as well as experience in hooking up jquery and javascript to your web designs. What you are going to need: A background image which will scroll. This is the coloured gradient with texture image in our example. An overlaid transparency image (this will be much taller than the viewable area). jQuery core library...

Upload and Resize an Image with PHP

Are you looking for image upload and Resize PHP script. I had implemented a simple PHP script to re-sizing image into different dimensions. It's very useful to your web projects to save hosting space and bandwidth to reduce the original image to compressed size. PHP Code This script resize an Image into two 60px and 25px. Take a look at $newwidth you have to modify size values. <?php  define ("MAX_SIZE","400");  $errors=0;  if($_SERVER["REQUEST_METHOD"] == "POST")  {         $image =$_FILES["file"]["name"];  $uploadedfile = $_FILES['file']['tmp_name'];   if ($image)   {   $filename = stripslashes($_FILES['file']['name']);         $extension = getExtension($filename);   $extension = strtolower($extension);  if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif...

Login with Facebook and Twitter

Facebook and Twitter have become large in the social network world and both networks offering oAuth support. We developed a system to login with Twitter and Facebook. Nowadays web users not interested to filling the big registration forms. This script helps you to avoid registration forms, It’s is very useful and simple to integrate. Database Sample database  users  table columns id, email, oauth_uid, oauth_provider and username. CREATE TABLE  users ( id  INT  PRIMARY KEY   AUTO_INCREMENT , email  VARCHAR(70),  oauth_uid  VARCHAR(200), oauth_provider  VARCHAR(200), username  VARCHAR(100),  twitter_oauth_token  VARCHAR(200),  twitter_oauth_token_secret  VARCHAR(200)  ); The tutorial contains three folders called  facebook , twitter  and  config  with PHP files. facebook   //Facebook OAUTH library  twitter   //Twitter OAUTH library  config --  functions.php ...