# Other Languages > jQuery >  Make a Rollover stick

## acrow

I have a client that wants the rollover state to stick instead of having the user click.

This needs to stick when rolled over only.  Please help!



```
<script type="text/javascript">
    $(function () {
        var topnum, lastitem;
        var models = $("#middle ul a").each(function () {
            var num = $(this).attr("active_item");
            if (num && !isNaN(num) && (!topnum || (num - 0) > topnum)) {
                topnum = num - 0;
                lastitem = this;
            }
        }).mouseover(function () {
            var me = $(this);
            $("#" + me.attr("hover_mn")).show().siblings().hide();
            $("#" + me.attr("hover_mnl")).show().siblings().hide();
            $("#" + me.attr("hover_no")).show().siblings().hide();
            $("#" + me.attr("hover_img")).show().siblings().hide();
        }).mouseout(function () {
            var me = $(this);
            $("#" + def_mn).show().siblings().hide();
            $("#" + def_mnl).show().siblings().hide();
            $("#" + def_no).show().siblings().hide();
            $("#" + def_img).show().siblings().hide();
        }).click(function () { $(this).closest("li").siblings().find("a").andSelf().removeClass("active_rt_item").end().end().end().andSelf().addClass("active_rt_item"); });

        var sel = lastitem ? $(lastitem) : models.eq(0);
        var def_img = sel.attr("hover_img");
        var def_mn = sel.attr("hover_mn");
        var def_mnl = sel.attr("hover_mnl");
        var def_no = sel.attr("hover_no");

        sel.click().mouseover();
    });
</script>
```

----------


## noahssite

This is the Java forum not the JQuery forum.

Here is the proper forum: http://www.vbforums.com/forumdisplay.php?f=94

Now taking a look at your code tell me if I'm wrong but you want the new styles to stay when the user moves their mouse away? Or you want the new styles to only appear when the user puts their mouse over and not click? Just clarify this and I'll give you an answer.

----------

