刷新各ifream当前页,下拉项改变触发事件js,给选中项加背景色js

<script type="text/javascript" language="javascript">
        //刷新框架各页面
        function refresh() {
            window.frames["topPage"].window.location.href = window.frames["topPage"].window.location.href;
            window.frames["leftPage"].window.location.href = window.frames["leftPage"].window.location.href;
            window.frames["mainTopPage"].window.location.href = window.frames["mainTopPage"].window.location.href;
            window.frames["mainBottomPage"].window.location.href = window.frames["mainBottomPage"].window.location.href;
            window.frames["rightPage"].window.location.href = window.frames["rightPage"].window.location.href;
            return false;
        }
    </script>

让框架页面跳转:

<script type="text/javascript" language="javascript">
//页面跳转 function redirect() { window.parent.window['mainTopPage'].location = '../ByWhole/dqzh.aspx'; window.parent.window['mainBottomPage'].location = '../ByWhole/dqzhfx.aspx'; return false; }
</script>

给选中项加背景色js:

//给选中地区加背景
    $('.main_cont_city li').each(function() {
        $(this).click(function() {
            $('.main_cont_city li').removeClass('selected');
            $(this).addClass('selected');
        });
    });

<div class="main_cont_city">
            <asp:Repeater ID="rptDq" runat="server">
                <HeaderTemplate>
                    <span class="fl">地区:</span>
                    <li class="selected"><a href='' onclick=" return redirect();">全国</a></li>
                </HeaderTemplate>
                <ItemTemplate>
                    <li><a href="javascript:" onclick='dqRedirect(<%#Eval("dq_id") %>)'>
                        <%#Eval("dq_name") %></a></li>
                </ItemTemplate>
            </asp:Repeater>
        </div>

下拉项改变触发事件js:

var mon = "";

    $("#ddlMonth").change(function() {
        mon = $(this).val();
        window.frames["UpSession"].window.location.href = "../UpSession.aspx?mon=" + mon;
        refresh();
    });

<asp:DropDownList ID="ddlMonth" runat="server" Width="70px">
            <asp:ListItem Value="1" Text="1月份">1月份</asp:ListItem>
            <asp:ListItem Value="2" Text="2年">2月份</asp:ListItem>
            <asp:ListItem Value="3" Text="3年">3月份</asp:ListItem>
            <asp:ListItem Value="4" Text="4年">4月份</asp:ListItem>
            <asp:ListItem Value="5" Text="5年">5月份</asp:ListItem>
            <asp:ListItem Value="6" Text="6年">6月份</asp:ListItem>
            <asp:ListItem Value="7" Text="7年">7月份</asp:ListItem>
            <asp:ListItem Value="8" Text="8年">8月份</asp:ListItem>
            <asp:ListItem Value="9" Text="9年">9月份</asp:ListItem>
 </asp:DropDownList>    
原文地址:https://www.cnblogs.com/tianrui/p/3495412.html