Question: I was trying to make a WPF button template from 4 images: "btnNormal, btnHover, btnPressed and btnDisabled".

![buttons](https://i.stack.imgur.com/Pp5Ny.png)

The thing is I don't know how to make my button look like this exactly with WPF styles. So now I am trying to make it using these images. The thing is I want my button to be stretchable and to look same on any size. To do this I need to make 3 slices for each button state image: "Top, Bottom, Left, Right, Center" 

![sliced](https://i.stack.imgur.com/LOnWd.png)

I have this XAML for now :

```
<Application.Resources>
    <ControlTemplate x:Key="StylishBlueButton" TargetType="{x:Type Button}">
            <Grid>
                <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                        <VisualState x:Name="MouseOver"/>
                        <VisualState x:Name="Pressed"/>
                        <VisualState x:Name="Disabled"/>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="FocusStates">
                        <VisualState x:Name="Focused"/>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="ValidationStates">
                        <VisualState x:Name="InvalidFocused"/>
                        <VisualState x:Name="InvalidUnfocused"/>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>
            </Grid>
        </ControlTemplate>

    </Application.Resources>
</Application>

```

**Can anyone help me out, how can I make this button template?**

Answer: 
```
var interval = setInterval(function(){ $("#nav #nextslide").click()},10000);

```

and on hover callback:

```
clearInterval(interval);

```
Just give the interval function a name so you can refer to it later with .clearInterval.

Start interval function:

```
nameOfIntervalFunction = setInterval(function(){$("#nav #nextslide").click()},10000);

```

Stop interval function with hover:

```
$( "a.gallery.form_click" ).mouseenter( function(){
    window.clearInterval(nameOfIntervalFunction)
})

```