View Single Post
07-16-2008, 02:00 AM
#3
v-a-l-o-r is offline v-a-l-o-r
v-a-l-o-r's Avatar
Status: Member
Join date: Jul 2008
Location:
Expertise:
Software:
 
Posts: 100
iTrader: 1 / 100%
 

v-a-l-o-r is on a distinguished road

  Old

Definitely. Alot of web users (not developers) are drawn to the factors and thats one of the main factors that makes a site popular. Additionally they can save you alot of code writing.

For example if you want to have input values change and such (i.e. like the login panel in the left when you are logged out), in html the long code will look like the following:
Code:
<input value="username" onfocus="if (this.value == 'username') {this.value = '';}" onblur="if (this.value == '') {this.value = 'username';}" type="text">
Now if you are using jQuery lets say, the html is shortend to the following:

$(document).ready(function() {
$('.field').click(
function() {
if (this.value == this.defaultValue) {
this.value = '';
}
}
);
$('.field').blur(
function() {
if (this.value == '') {
this.value = this.defaultValue;
}
}
);
});


HTML:
<input type="text" class="field" name="username" value="username" />
Ofcourse you have to declare it prior but cleaner HTML code.

In todays day and age, almost everyone has fast internet and if they don't, then most likely they aren't worth the trouble, thats my take on it.

Anyways libraries can be used to add effects that make a site more interesting.

Reply With Quote