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!
Code:
<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>