我想显示一些浮动框(包含缩略图的div),缩略图的数量取决于当前的页面宽度.例如:
<div class="container">
<div class="box1" style="float:left;width:120px;height:120px;margin-right:10px;">Thumbnail image here</div>
<div class="box2" style="float:left;width:120px;height:120px;margin-right:10px;">Thumbnail image here</div>
<div class="box3" style="float:left;width:120px;height:120px;margin-right:10px;">Thumbnail image here</div>
<div class="box4" style="float:left;width:120px;height:120px;margin-right:10px;">Thumbnail image here</div>
.......... ETC
</div>
Run Code Online (Sandbox Code Playgroud)
问题是,对于给定的宽度,它显示每行上有4个方框,但它们都是左对齐的,右边有一些空白区域,我怎样才能水平居中每一行?
像这样的东西:http://realworldstyle.com/thumbs_3.html但页面上水平居中的框...
提前致谢,
SQL Server Management Studio 2008中的一个新功能是"概述"(折叠区域的能力).太棒了.但是,默认情况下会扩展所有区域.我似乎无法找到"全部崩溃"的方法(在Visual Studio中也称为"切换轮廓").有人知道这样做的方法吗?我的任务是审查3000行存储过程,逐个折叠区域很麻烦.
Noob问题在这里,每当我更改SQL Server 2008 R2表中的某个记录时,我想增加一个RevisionId记录; 为此,我使用以下语法:
UPDATE TheTable
SET RevisionId=(SELECT RevisionId
FROM TheTable
WHERE Id=@id) + 1
WHERE Id=@id;
Run Code Online (Sandbox Code Playgroud)
顺便说一句,我要把它放到一个触发器中,这样就会自动发生,但是这个代码有效,感觉很笨重 - 任何更干净的方法都可以做到这一点?
我有几个块助手,这是我正在做的一个简单的例子:
def wrap_foo foo, &block
data = capture(&block)
content = "
<div class=\"foo\" id=\"#{foo}\">
#{data}
</div>"
concat( content )
end
Run Code Online (Sandbox Code Playgroud)
我只是尝试erubis,它给了我以下错误:
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.<<
Run Code Online (Sandbox Code Playgroud)
删除调用以concat删除错误但最终导致我的包装器没有被渲染
使用:
运行我们的程序时,我们得到java.lang.IllegalMonitorStateException类型的异常.在Java6 API网站上,它说有一个构造函数提供有关异常的详细信息:IllegalMonitorStateException(String s)
我们如何使用它来更好地了解错误在我们的代码中的位置?还有什么我们可以做的(除了我们目前正在进行的大量调试)以确定失败的功能或线路吗?
我正在使用e4X难以解析XML文件.我可以从'version'标签中获取信息,但我不能从任何嵌套标签中获取信息.
有人可以指出我做错了什么吗?
这是XML:
<NameOfRoot xmlns="http://www.theaddress.com/file">
<version>1.0</version>
<NameOfChild1>
<NameOfChild2>
<GeneralData>
<Identifier>2678</Identifier>
</GeneralData>
</NameOfChild2>
</NameOfChild1>
</NameOfRoot>
Run Code Online (Sandbox Code Playgroud)
这是代码:
<mx:HTTPService id="MyService" url="data.xml" result="resultHandler(event)" resultFormat="e4x"/>
private function resultHandler(event:ResultEvent):void {
XMLData = event.result as XML;
var ver:String = XMLData.*::version; // ver = 1.0
var id:String = XMLData.*::NameOfChild1.NameofChild2.GeneralData.Identifier; //empty string
}
Run Code Online (Sandbox Code Playgroud) 我必须在这里错过一些愚蠢的东西,但我看不到它.我的工作在他们的网站上使用内联代码,例如:
<panel runat="server" id="myid" visible='<%# MyboolVal %>'>
some stuff
</panel>
Run Code Online (Sandbox Code Playgroud)
这似乎对他们很有用,面板将在他们的状况满足时显示.
我试图在我家的一个网站上使用类似的方法(周五晚上,所以在这一点上问我的老板不是最好的主意).我根本无法输出任何东西.我在可见区域尝试了它,但是没有用,所以我想我会把它写在屏幕上:
<p>some text <%# String.Format("meeee {0}", Mybool) %></p>
Run Code Online (Sandbox Code Playgroud)
但我没有得到内联代码的任何输出.出现"some text"但没有"meeee"或bool值.
我在用户控件内执行此操作,此时但不要想象这将是原因.
有什么想法吗?
谢谢
编辑....
好的,感谢Freddy Rios的回复,我可以看到文字出现,但是当我尝试这样做时:
Visible='<%= mybool %>'
Run Code Online (Sandbox Code Playgroud)
我得到编译错误:
无法从其可见属性的字符串表示形式创建System.boolean类型的对象.
我很困惑到底发生了什么.在我没有得到的发动机罩下必须有部分过程.
编辑2:
我在第123行得到错误:
<fieldset class="myclass" id="projectarea" runat="server" visible='<%= ShowProjectSearchArea %>'>
Run Code Online (Sandbox Code Playgroud)
ShowProjectSearchArea是我的bool值,设置为false.
如果我双击错误列表窗口中的错误,我会在弹出窗口中获得以下内容,这是我以前从未见过的:
Cannot open file '%1'. It might not be in the solution.
Run Code Online (Sandbox Code Playgroud) 我在flex中有以下字典,id喜欢按值排序.找不到任何资源.
'1'=>2, '0' =>1, '3'=>4 ..
Run Code Online (Sandbox Code Playgroud)
有任何想法吗 ?我如何按价值排序?