我在缩略图上使用以下代码作为悬停函数:
$(function (){
$('.button').hover(function() {
if ($(this).is(":not(animated)")) {
$(this).animate({opacity: 0.7}, 'fast');
}
},
function() {
$(this).animate({opacity: 1}, 'fast' );
});
});
Run Code Online (Sandbox Code Playgroud)
问题是,当我过快地翻过拇指时,效果会持续闪烁一段时间...有什么东西我可以添加到if块来防止这种情况吗?
为什么这不起作用?当我尝试使用-l或-s作为第一个参数时,if语句不会使用.他们总是去发表其他声明.
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
int main(int argc, char* argv[])
{
if (argv[1] == "-l")
{
printf("Yay!\n");
}
else if (argv[1] == "-s")
{
printf("Nay!\n");
}
else
{
printf("%s\n", argv[1]);
}
return 0;
}
Run Code Online (Sandbox Code Playgroud) 我正在使用带有“安装后启动应用程序”复选框的WiX进行安装。目标是对设置复选框和取消设置复选框有反应。如果选中了此复选框,则需要运行一个应用程序。如果未设置该复选框,则需要使用命令行参数运行相同的应用程序。
这是我的WiX脚本的一部分。
<CustomAction Id="StartConfigManagerOnExit"
FileKey="ParamsShower.exe"
ExeCommand=""
Execute="immediate"
Impersonate="yes"
Return="asyncNoWait" />
<CustomAction Id="StartUpgradeConfigOnExit"
FileKey="ParamsShower.exe"
ExeCommand="/upgrade"
Execute="immediate"
Impersonate="yes"
Return="asyncNoWait" />
<UI>
<Publish Dialog="ExitDialogEx"
Control="Finish"
Order="1"
Event="DoAction"
Value="StartConfigManagerOnExit">LAUNCHAPPONEXIT = 1</Publish>
<Publish Dialog="ExitDialogEx"
Control="Finish"
Order="1"
Event="DoAction"
Value="StartUpgradeConfigOnExit">LAUNCHAPPONEXIT = 0</Publish>
<Publish Dialog="ExitDialogEx"
Control="Finish"
Event="EndDialog"
Value="Return"
Order="999">1</Publish>
<Dialog Id="ExitDialogEx"
Width="370"
Height="270"
Title="[ProductName] Setup">
<Control Id="LaunchCheckBox"
Type="CheckBox"
X="135"
Y="190"
Width="220"
Height="40"
Property="LAUNCHAPPONEXIT"
Hidden="yes"
CheckBoxValue="1"
Text="Launch an app">
<Condition Action="show">NOT Installed</Condition>
</Control>
</Dialog>
<InstallUISequence>
<Show Dialog="ExitDialogEx"
OnExit="success" />
</InstallUISequence>
<AdminUISequence>
<Show Dialog="ExitDialogEx"
OnExit="success" />
</AdminUISequence>
</UI>
Run Code Online (Sandbox Code Playgroud)
设置LaunchCheckBox时,安装会启动应用程序。但是如果未设置复选框,它不会运行。
这些天我正在努力学习JSF + Facelets.我有一个BackingBean和一个Facelet xHTML页面.当我请求facelet页面(只有一次)时,会多次调用backing-bean方法.
这可能是什么原因?
我看不到什么特别的东西.提前致谢.
这是facelet:
<?xml version="1.0" encoding="UTF-8" ?>
<!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" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Insert title here</title>
</head>
<body>
<ui:composition template="index.xhtml">
<ui:define name="content">
<h:form>Name: <h:inputText id="nameFilterPattern" value="#{kundenBackingBean.nameFilterPattern}" /><h:commandButton value="Suchen"/></h:form>
<h:dataTable var="kunde" value="#{kundenBackingBean.kunden}" rowClasses="rowHighlight, rowOrdinary">
<h:column>
<f:facet name="header">
<h:outputText value="Kundennr" />
</f:facet>
<h:outputText value="#{kunde.kundenNr}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Name" />
</f:facet>
<h:outputText value="#{kunde.name}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Vorname" />
</f:facet>
<h:outputText value="#{kunde.vorname}"/>
</h:column> …Run Code Online (Sandbox Code Playgroud) 如何在今年之前生成给定年份的选择列表?我这样做了
{assign var=thisyear value=$smarty.now|date_format:"%Y"}
{if !$firstyear}
{assign var=firstyear value="2003"}
{/if}
{if !$loop}{assign var=loop value=$thisyear}{/if}
<select name='{$id|default:year}' id={$id|default:year} style='width:70px;'>
{section name=yearValue max=$year start=$firstyear loop=$thisyear step=-1}
<option{if $year==$smarty.section.yearValue.index} selected="selected"{/if}>{$smarty.section.yearValue.index}</option>
{/section}
</select>
Run Code Online (Sandbox Code Playgroud)
不幸的是,这产生了0到2003年,但我希望它产生2003年至2010年我该怎么办?
我刚刚在VS 2010 RC中玩EF 4,刚发现当属性类型为bool并且新值为false时,ApplyCurrentValues不起作用!!!
并且它在新值为真时起作用.
我不知道这是一个错误还是我错过了一些东西,但我只是在处理一个非常丑陋的工作:
public void UpdateProduct(Product updatedProduct)
{
using (model)
{
model.Products.Attach(new Product { ProductID = updatedProduct.ProductID });
model.Products.ApplyCurrentValues(updatedProduct);
Product originalProduct = model.Products.Single(p => p.ProductID == updatedProduct.ProductID);
originalProduct.Discontinued = updatedProduct.Discontinued;
model.SaveChanges();
}
}
Run Code Online (Sandbox Code Playgroud)
任何想法或更好的解决方案?
我目前在使用Delphi中的记分板时遇到问题.
我有一系列形式是个别问题.如果问题得到正确回答,则得分为1.否则得分为-1.
在我的记分牌上,我有12个标签,其中11个包含每个表格的分数.我想要做的是将每个标签中的数字相加,并将最终得分输出到第12个标签中.
有办法做到这一点吗?任何帮助将不胜感激.
我在服务器上运行批处理作业时遇到问题,而在我的开发工作站上从Eclipse运行正常.
我已经使用Roo设置了我的Spring环境,创建了一个实体,并制作了一个可以完成某些工作的批处理,并在我的开发框中进行了测试.我初始化我的上下文并完成工作,但是当我在服务器上运行我的批处理时,上下文没有正确初始化.这是代码:
public class TestBatch {
private static ApplicationContext context;
@SuppressWarnings("unchecked")
public static void main(final String[] args) {
context = new ClassPathXmlApplicationContext("/META-INF/spring/applicationContext.xml");
try {
@SuppressWarnings("unused")
TestBatch app = new TestBatch();
} catch (Exception ex) {
ex.printStackTrace();
}
}
public void TestBatch() { /** Do Something using the context **/ }
}
Run Code Online (Sandbox Code Playgroud)
这是日志和例外:
2010-02-16 11:54:16,072 [main] INFO org.springframework.context.support.ClassPathXmlApplicationContext - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@6037fb1e: startup date [Tue Feb 16 11:54:16 CET 2010]; root of context hierarchy
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.springframework.context.support.AbstractRefreshableApplicationContext.createBeanFactory(AbstractRefreshableApplicationContext.java:194)
at …Run Code Online (Sandbox Code Playgroud)