1 set:
$('#tabs li:first-child').addClass('first-child');
$('.photos li:first-child').addClass('first-child');
$('#alphabet li:first-child').addClass('first-child');
2 set:
$(function(){
$("#header-thumbs img").fadeTo("fast",1);
$("#header-thumbs img").hover(function(){
$(this).fadeTo("fast",.7)},function(){
$(this).fadeTo("fast",1)})});
$(function(){$(".catalog dt img").fadeTo("fast",1);
$(".catalog dt img").hover(function(){
$(this).fadeTo("fast",.7)},function(){
$(this).fadeTo("fast",1)})});
$(function(){$(".photos li img").fadeTo("fast",1);
$(".photos li img").hover(function(){
$(this).fadeTo("fast",.7)},function(){
$(this).fadeTo("fast",1)})});
Is it possible to optimize, for a less code?
Thanks Paolo Bergantino for his help, the result is:
Optimized and packed first set (540->171):
$(function(){$("#header-thumbs, .catalog dt, .photos li").find("img").fadeTo("fast",1).hover(function(){$(this).fadeTo("fast",.7)},function(){$(this).fadeTo("fast",1)})});
second set (158->78):
$('#tabs, .photos, #alphabet').find('li:first-child').addClass('first-child');
Used Dean Edwards packer