I'm creating a website for a client, using css and bits of jquery (this one makes me pull my hair off everyday...) I use Jquery's AnythingSlider plugin to display texts and images, makes me save lots of space on everypage. I have managed to change the navigation buttons and show custom png images instead but my client would like the buttons to "light up" when hovered and active. As my images are called through the formatText function, how can I make them swap for another image?
I'm using the same wanted effect on other menus and submenus of the website, using desaturated images that fade to shiny glossy ones, using css and fadeto.. but I'm really stuck on the slider navigation links as the images are directly called from the script... any ideas on this one?
Here's the code:
// DOM Ready var slider = ['1', '2']; function formatText(index, panel) { return "< im g src='menus/naviaccueil" + index + ".png' />"; } jQuery(function(){ jQuery('#slider').anythingSlider({ appendNavigationTo: $('#nav'), navigationFormatter : formatText, startText: null, stopText: null, resizeContents: false, }); });
and here's the effect I'm trying to achieve (mouse over the dog "sign" image): http://www.esquisse-designs.com/Cavalandals/males.html
but on the two navigation buttons of this slider: http://www.esquisse-designs.com/Cavalandals/accueil.html
Instead of writing extra code to swap out the image source, it would be much easier to just add the images to the background and swap them out with css. Here is the extra css (I couldn't find the hover image, so I just added "hover" to the end of the file name).
Thanks a lot Mottie, problem resolved! But I still have another (last) question: can the current tab be "coloured" when the page is initialized? My normal tabs are grey, and when focused and active they swap for the coloured version. but when you first get on the page both tabs are grey... any way to change that?
I'm creating a website for a client, using css and bits of jquery (this one makes me pull my hair off everyday...)
I use Jquery's AnythingSlider plugin to display texts and images, makes me save lots of space on everypage. I have managed to change the navigation buttons and show custom png images instead but my client would like the buttons to "light up" when hovered and active. As my images are called through the formatText function, how can I make them swap for another image?
I'm using the same wanted effect on other menus and submenus of the website, using desaturated images that fade to shiny glossy ones, using css and fadeto.. but I'm really stuck on the slider navigation links as the images are directly called from the script... any ideas on this one?
Here's the code:
// DOM Ready
var slider = ['1', '2'];
function formatText(index, panel) {
return "< im g src='menus/naviaccueil" + index + ".png' />";
}
jQuery(function(){
jQuery('#slider').anythingSlider({
appendNavigationTo: $('#nav'),
navigationFormatter : formatText,
startText: null,
stopText: null,
resizeContents: false,
});
});
and here's the effect I'm trying to achieve (mouse over the dog "sign" image):
http://www.esquisse-designs.com/Cavalandals/males.html
but on the two navigation buttons of this slider:
http://www.esquisse-designs.com/Cavalandals/accueil.html
Instead of writing extra code to swap out the image source, it would be much easier to just add the images to the background and swap them out with css. Here is the extra css (I couldn't find the hover image, so I just added "hover" to the end of the file name).
CSSand the modified initialization code:
But I still have another (last) question: can the current tab be "coloured" when the page is initialized?
My normal tabs are grey, and when focused and active they swap for the coloured version. but when you first get on the page both tabs are grey... any way to change that?
CSS: