Change background at click - BgStretcher plugin

Change background at click - BgStretcher plugin

Hi, first of all please pardon my english !

I'm using bgStretcher plugin for a website that I'm creating.

I would like that a click on a menu element (actually on <li class="toggleSubMenu3">Text</li>) changes the background.

So I have created a script with the click function and I have copied the Background Stretcher script.

But when I click, instead of having the image that I want in background, It shows the background-color written on bgStretcher plugin stylesheet.

Please can anyone help me ? I dont know a lot about jquery... Thanks a lot !


This is the script for bgStretcher :

<script type="text/javascript"> 
$(document).ready(function(){
// Initialize Background Stretcher
$(document).bgStretcher({
images: ['images/sample-2.jpg', 'images/sample-3.jpg'],
imageWidth: 3000, imageHeight: 1500, nextSlideDelay : 7000,
});
});
</script>








The other one for the click :

<script type="text/javascript">
$(document).ready(function(){ 
$('li.toggleSubMenu3').click(function () {
$(document).bgStretcher({
images: ['images/sample-1.jpg', 'images/sample-3.jpg'],
imageWidth: 3000, imageHeight: 1500, nextSlideDelay : 7000,
});
});
});
</script>