Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

url(image loacation) give a class

var basePath = 'mysite/images/';
$('a').each(function() {
    var className = $(this).attr('class');
    className = className.replace(/[^f][^0-9]*/, '').replace(' ', '');
    $(this).css('background-image', basePath + className + '.png');
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #give #class
ADD COMMENT
Topic
Name
1+6 =