View Full Version : element specific javascript

04 Dec 2005, 06:25 PM
I am using bgsleight javascript
to display transparent png's as a background image for css elements.

The AlphaImageLoader filter is set to 'scale' in the javascript which is linked into the page header.
That is useful so the background images of my divs scales to the size of the div which is dependent on the content.

Now I also would like to replace the h1 tabs with a background image.
Problem is the background image gets stretched for the whole widht of the div since the AlphaImageLoader filter is set to scale.
If I set it to 'image' it is fine for the h1's background but not good for the other divs.

My question is:

Is there anyway to link a specific javascript to a specific css element ?
The idea is to keep using the current javascript (set to scale) for the whole page, and a new javascript (with the filter set to 'image') only for the h1 or a for a specific div or class.

I guess this is must pretty hard and requires very good knowledge of both javascript and css, but maybe there is someone here who can help....