使用JQuery实现Tab(结合vs2008,aspx页面)

本文介绍了一个使用 ASP.NET 实现的切换面板示例,该示例通过 jQuery 进行事件绑定,实现了不同标签页之间的内容切换效果。页面中包含了最新评论、近期热评和随机文章三个部分。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

前台:

 

ExpandedBlockStart.gif代码
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="PandaRG.NB.OurSchoolWeb.WebApplication.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    
<title></title>

    
<script type="text/javascript" src="JScripts/jquery-1.3.2-vsdoc2.js"></script>

    
<link href="App_Themes/Stylesheet1.css" rel="stylesheet" type="text/css" />

    
<script type="text/javascript">
        $(document).ready(
function()
        {
            $(
"#tab-title span").mouseover(function()
            {
                $(
this).addClass("selected").siblings().removeClass();
                $(
"#tab-content > ul").eq($('#tab-title span').index(this)).show().siblings().hide();
            });
        });

    
</script>

</head>
<body>
    
<form id="form1" runat="server">
    
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
    
</asp:ScriptManager>
    
<div id="sidebar-tab">
        
<div id="tab-title">
            
<h3>
                
<span class="selected">最新评论</span><span>近期热评</span><span>随机文章</span></h3>
        
</div>
        
<div id="tab-content">
            
<ul>
                
<?php wkc_recent_comments('number=10&length=25'); ?>pinglun1</ul>
            
<ul class="hide">
                
<?php wkc_most_commented_posts('number=10&days=300'); ?>jqrp1</ul>
            
<ul class="hide">
                
<?php wkc_random_posts('number=10&length=40'); ?>sjwz1</ul>
        
</div>
    
</div>
    
</form>
</body>
</html>

 

 

转载于:https://www.cnblogs.com/litaocnblogs/archive/2010/07/06/1772119.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值