小编Car*_*ter的帖子

Stack Overflow最适合启用JavaScript的横幅

我试图模仿这个网站的Javascipt所需的横幅,并且如果允许/启用javascript,则隐藏下面的div,但是我在页面加载时得到了闪光/一瞥.

<div id="Main_noJS">Craftystuff.com works best with JavaScript enabled</div>
<div id="PartOfMain_noJS"><br /></div>
Run Code Online (Sandbox Code Playgroud)

CSS:

#Main_noJS {
    width: 100%;
    height: 23px;
    font-family: Arial;
    font-size: 111%;
    color: White;
    font-weight: bold;
    background: #AE0000;
    text-align: center;
    padding-top: 4px;
    position: fixed;
    z-index: 100;
}
Run Code Online (Sandbox Code Playgroud)

JavaScript的:

// hide the "Craftystuff.com works best with JavaScript enabled" banner, if JavaScript is working
if ($("#Main_noJS")) {
    $("#Main_noJS").hide();
    // hide the spacer between the main content and banner...
    $("#PartOfMain_noJS").hide();
}
Run Code Online (Sandbox Code Playgroud)

所以横幅是可见的,只有当javascript启用时我才能隐藏它

  • 但javascript必须花一点时间才能隐藏事物...

当页面首次加载时,我想尝试阻止横幅的任何帮助吗?

javascript asp.net

2
推荐指数
1
解决办法
334
查看次数

在for循环中改变变量名

我正在寻找帮助尝试在for循环中改变变量名:

For b = 1 To Count

    ' the below image_var(b) varible needs to vary on each iteration'
    Dim image_var(b) As New LinkedResource(Server.MapPath(myArray(b-1)))

    ' need also to have the b in myArray(b-1) bit work through the loop too'
    ' that is I''m after the array index b minus 1'

    image_var(b).ContentId = "imageContentId_" + b.ToString

    ' add the LinkedResource to the appropriate view'
    htmlView.LinkedResources.Add(image_var(b))

Next b
Run Code Online (Sandbox Code Playgroud)

提前谢谢,因为我无法登录接受答案......


谢谢Guffa - 我的照片正在通过电子邮件显示出来.

image_var(b)中的(b)对我来说也只是一个存根 - 直到我找到了我所追求的代码......我是新的,甚至不知道/意识到它创建了一个数组......我是一个nobb .

再次感谢...

vb.net asp.net

1
推荐指数
1
解决办法
712
查看次数

标签 统计

asp.net ×2

javascript ×1

vb.net ×1