Code has been amended and now it works as follows when you click on the page the div animates out to show. And if you click on the button it toggles the show and the hide div. But what it doesn’t do is disappear after a minute when it first opens. still learning jquery so my code maybe a bit over all over the place.
<script>
var isOn = true;
function getOff(){
if(isOn){
$("#button").trigger('click');
}
}
$("#button").trigger('click');
setTimeout("getOff()", 1000);
$(document).ready(function() {
$("#button").toggle(function () {
$("#expandText").show("slide", { direction: "right" }, 1000);
$("#button").css("background-image","url(images/Text_Expander_off.jpg)");
},function () {
$("#expandText").hide("slide", { direction: "right" }, 1000);
$("#button").css("background-image","url(images/Text_Expander_on.jpg)");
});
});
</script>
and set the isOn false if user presses the button