日期:2014-05-18  浏览次数:20447 次

高分求两个问题的答案 1.javascript 2.Wizard控件
1.   如何用javascript实现以下功能,点击按钮(最好是服务器的Button)后出现 "5秒后跳转至首页 ",其中5这个数字是逐渐变化的,到0秒自动跳转。
请不要仅仅说setTimeout,不要AJAX的实现,谢谢

2.   Wizard控件左边的SideBar里的链接我不想让用户点击,我只想让用户点击右边的下一步,
我现在已经将其转换为SideBarTemplate
                        <SideBarTemplate>
                                <asp:DataList   ID= "SideBarList "   runat= "server ">
                                        <SelectedItemStyle   Font-Bold= "True "   />
                                        <ItemTemplate>
                                                <asp:LinkButton   ID= "SideBarButton "   runat= "server "   CausesValidation= "False "> </asp:LinkButton>
                                        </ItemTemplate>
                                </asp:DataList>
                        </SideBarTemplate>

在后台我也写了
                protected   void   WizardAccount_SideBarButtonClick(object   sender,   WizardNavigationEventArgs   e)
                {            
                        e.Cancel   =   true;
                }
可以让用户只能按照我的步骤来选择

但我现在希望的是
1.   能否找到这个LinkButton,用户点击了以后不要用服务器端的WizardAccount_SideBarButtonClick来处理其事件,直接在javascript里就return   false了。
2.   或者能否就不显示连接按钮,只是显示普通的文字,用户就不会去点击,可以用Enable   =   false   但太难看了

如有其他方案能满足条件者也请赐教

------解决方案--------------------
1.先弄一个div 用于写字 id= 'x '
function click_button(){
var t=5;
var tim= setInterval(funtion(){
document.getElementById( 'x ').innerHTML= '还有 '+(t--)+ '秒跳转到xx ';
if(t <1) {clearInterval(tim);top.location.href= 'xxx ';}
},1000);
}
------解决方案--------------------
You have finished the registration, The screen will jump to homepage automatically after&nbsp; <b> <span id= "spnsec "> </span> </b> &nbsp;seconds. <br /> <br />
<a href= "../default.aspx " > OR you can click here to homepage. </a>

<script language= "javascript " type= "text/javascript ">
var iSecond = 5;
document.getElementById( "spnsec ").innerHTML = iSecond;

function changeSecond()
{
if (iSecond == 0) // 跳转页面
{
window.location.href = "../Default.aspx ";
}
else
{
iSecond = iSeco