Posted in Featured, Web Design

Like this post? Share It :
  • Print
  • email
  • PDF
  • Google Bookmarks
  • Facebook
  • Twitter
  • MySpace
  • Yahoo! Buzz
  • del.icio.us
  • Digg
  • LinkedIn
  • StumbleUpon
  • Tumblr
  • Reddit
  • Technorati
  • Design Float
  • RSS

3 common requirements and the corresponding Jquery solutions for your next web project

Another post to boost your productivity :)

Recently, while working on some client projects, I noticed a few requirements(I know there are many) that were common. I strongly feel, this will be useful for your next web project.

1. Empty form field value on focus/click

form-focus
The requirement/issue:

This is a very common requirement. You would have noticed form fields that have a value by default which disappears when you click/focus on them. When you click outside, the value appears again.

Solution:
The jQuery emptyonclick Plugin works like a charm. All you need to do is download this plugin to your project directory and include the following code within the head tags.




Now add the class “emptyonclick” to all form fields that you would like to empty onclick.

You can find more about the usage here

2. Truncate lengthy text with either a “more” button or 3 dots at the end

truncate-with-dots
The requirement/issue:

I am sure that most of you would already have faced this issue, especially with lengthy breadcrumbs. You don’t have to run behind and bother a programmer anymore for a solution.

Solution:

Truncate is an awesome jQuery plugin that helps you achieve this in seconds. Download the plugin and include the following code within the head tags



Replace the .classname with the class name of your HTML element that contains the text. Also, the number 60 in the code above is the maximum number of characters you would like to allow before truncating. Replace that with your value.

Adding a “more” link at the end of the text is another cool usage. You can find more about the usage here.

3. Adding classes to the first and last list items

first-last-class-li
The requirement/issue:

I don’t think there will be a HTML/CSS developer who haven’t abused wordpress for not adding first and last classes for their lists

Just imagine a menu that needs a different background for the first and last list item. You’ll find this handy when creating themes for a CMS like wordpress where you have no control over the HTML code.

Solution:

After spending a few minutes on google, I found this snippet




This can also be achieved using the :first-child and :last-child CSS pseudo-classes.

We offer best quality HP0-S27 training program to help you pass 70-290 exam. Sign up for 642-975 online course to get best jquery solutions for your web design project!

Get your a+ certification to support your It career. No matter you want to get mcts or ccnp certification, having one of the latest certification on your credential is essential top be successful in this high tech world.

Related posts:

  1. 10 CSS properties that ‘were’ impossible to implement in IE6
  2. IE CSS hack without using any hacks!
  3. IE not interpreting text-indent on submit buttons ?


Productivedreams.com

Like this post? Share It :
  • Print
  • email
  • PDF
  • Google Bookmarks
  • Facebook
  • Twitter
  • MySpace
  • Yahoo! Buzz
  • del.icio.us
  • Digg
  • LinkedIn
  • StumbleUpon
  • Tumblr
  • Reddit
  • Technorati
  • Design Float
  • RSS

No related posts.

Comments are closed.