问题列表 - 第41095页

fancybox自动调整大小限制

所以我们都知道fancybox已经调整了功能,这很好,但如果内容大于你的屏幕,它也会调整大小,你必须向下滚动浏览器滚动条,而不是fancybox滚动条.

要在没有快速混乱的情况下调整大小,我确实喜欢这样.

<script type="text/javascript">
    jQuery(document).ready(function() {
        $('MyTagValue').fancybox(
        {
            'titlePosition' : 'inside',
            'transitionIn'  : 'fade',
            'transitionOut' : 'fade',
            'onStart' : function()
            { 
                $('#MyTagStyle').css(
                {
                    marginLeft: '-10000px'
                }); 
            }, 
            'onComplete' : function()
            { 
                $.fancybox.resize(); 
                $('#MyTagStyle').css(
                {
                    marginLeft: '0px'
                }); 
            }  
        });
    });
</script>
Run Code Online (Sandbox Code Playgroud)

所以我的问题是如何在浏览器屏幕中调整大小,或者只是一个特定的值,f.ex我想自动调整大小,但不超过宽度:800px; 和身高:900px;

为了说明我现在拥有的东西,以及我想要实现的目标,这里有一些屏幕:

当前: 替代文字

通缉: 替代文字

有任何想法吗?

html jquery fancybox

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

声明字符串public static readonly与public const vs public static const

在每个项目中,我们都有一个文件用于存储该项目中使用的各种SQL语句.关于如何声明类以及如何声明字符串,有一些变体.

示例类声明:

internal sealed class ClassName
internal static class ClassName
public sealed class ClassName
public static class ClassName
internal class ClassName
Run Code Online (Sandbox Code Playgroud)

示例字符串声明:

internal const string stringName
internal static string stringName
public static readonly string stringName
public static string stringName
public const string stringName
Run Code Online (Sandbox Code Playgroud)

我不明白不同声明之间的性能影响.这种情况/场景是否有最佳实践?

c# string

34
推荐指数
3
解决办法
2万
查看次数

如何在Ruby on Rails中验证activeRecord模型中的字段值?

是这样的:


validates_value_of :verified,:with=>1

验证模型上的布尔字段?

validation activerecord ruby-on-rails

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

Filemaker计算以在列表中正确显示逗号

我有一个项目列表,如果它们被标记,我需要在报告中显示.正如您在下面的代码中看到的,它只不过是用逗号分隔的数字列表.问题是如果#1不在列表中,则列表前面总是以逗号开头.我可以将逗号移到最后但是如果它不是我计算中的最后一个数字,那么在最后一个数字之后我会遇到同样的问题.有没有人知道如何调整这个,所以逗号只出现在数字之间?如果我能在最后一个数字之后获得一段时间,那将会很棒.

//备件计算

如果($ {1} ="备用"且panelSize≥1;"1";"")&

如果($ {2} ="Spare"且panelSize≥2;",2";"")&

如果($ {3} ="Spare"且panelSize≥3;",3";"")&

如果($ {4} ="Spare"且panelSize≥4;",4";"")&

filemaker

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

Android:长按一个按钮 - >执行操作

我想使用相同的按钮来执行2种不同的方法.用户单击它时的一种方法和用户LONG单击它时的第二种方法(不同).

我用它来进行单击(这非常有效):

Button downSelected = (Button) findViewById(R.id.downSelected);
        downSelected.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                method();
                }
            }

        });
Run Code Online (Sandbox Code Playgroud)

我试图添加一个longClickListener但它没有用.

欣赏有关如何解决这个问题的任何想法.

谢谢!

android

57
推荐指数
3
解决办法
11万
查看次数

核心数据轻量级迁移问题

我的应用程序目前在应用程序商店中,我正在使用单个添加的属性更新数据模型.我添加了一个模型版本并将其设置为当前版本.

一切正常但是当我测试在包含数据的旧版本上安装新版本的应用程序时,应用程序无法加载而没有错误消息.它将继续失败(只是在屏幕上短暂闪烁),直到我重新启动设备,或者通过XCode或iTunes再次安装更新的应用程序,然后应用程序运行正常并且数据已正确迁移.

我担心,如果这种情况发生在客户身上,他们会在重新安装之前删除该应用并丢失所有数据.有没有人有任何见解?任何帮助表示赞赏

谢谢,我在App Delegate中使用以下代码进行数据迁移:

- (NSManagedObjectModel *)managedObjectModel {
    if (managedObjectModel != nil) {
        return managedObjectModel;
    }
    NSString *path = [[NSBundle mainBundle] pathForResource:@"DataStore" ofType:@"momd"];
    NSURL *momURL = [NSURL fileURLWithPath:path];
    managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:momURL];
    return managedObjectModel;
}
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator {
    if (persistentStoreCoordinator != nil) {
        return persistentStoreCoordinator;
    }
    NSString *storePath = [[self applicationDocumentsDirectory] stringByAppendingPathComponent: @"DataStore.sqlite"];
    NSFileManager *fileManager = [NSFileManager defaultManager];
    if (![fileManager fileExistsAtPath:storePath]) {
        NSString *defaultStorePath = [[NSBundle mainBundle] pathForResource:@"DataStore" ofType:@"sqlite"];
        if (defaultStorePath) {
            [fileManager copyItemAtPath:defaultStorePath toPath:storePath error:NULL];
        } …
Run Code Online (Sandbox Code Playgroud)

iphone

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

轻松实施模板

假设我在某处编写了类模板声明collector.h:

template <class T, int maxElements>
class collector {

    T elements[maxElements];
    int activeCount;

public:

    collector();
    void process();
    void draw();

};
Run Code Online (Sandbox Code Playgroud)

并在collector.cpp以下方面实施其三种方法:

template <class T, int maxElements> 
collector<T, maxElements>::collector(){
    //code here
}

template <class T, int maxElements>
void collector<T, maxElements>::process(){
    //code here
}

template <class T, int maxElements>
void collector<T, maxElements>::draw(){
    //code here
}
Run Code Online (Sandbox Code Playgroud)

有没有办法不写作template <class T, int maxElements><T, maxElements> 每个功能的实现?像这样的东西:

template <class T, int maxElements>{

    collector<T, maxElements>::collector(){
        //code here
    }

    void collector<T, maxElements>::process(){ …
Run Code Online (Sandbox Code Playgroud)

c++

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

SQL Server 2008

我有一张这样的桌子

ID          NAME
----------- -----------
1           JON
2           JIM
3           BOB

(3 row(s) affected)
Run Code Online (Sandbox Code Playgroud)

我需要它的代码来选择一个不在列ID中退出的数字并将其放到一个文件中,所以在这个实例中它将是"4".

我需要它做的是从1开始然后检查2,3,依此类推,直到找到表中不存在的数字.

此代码必须在SQL Server 2008中

sql-server-2008

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

C#MVVM DataGrid绑定策略?

有什么区别:

<DataGrid
    ItemsSource="{Binding MyCollection}"
/>
Run Code Online (Sandbox Code Playgroud)

和...

<CollectionViewSource x:Key="CollectionData" Source="{Binding MyCollection}"/>
...
<DataGrid
    DataContext="{StaticResource CollectionData}"
    ItemsSource="{Binding}"
/>
Run Code Online (Sandbox Code Playgroud)

他们似乎都工作.唯一的区别是第二个片段,我无法绑定到SelectedItem.那么为什么有人会选择一种策略呢?为什么有人不会只使用第一个片段?谢谢.

c# data-binding wpf datagrid mvvm

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

使用传递的数据帧名称作为绘图标题

我有一个函数foo,它将数据帧作为输入,并返回一个ggplot对象作为输出.我需要使用数据框的名称作为绘图的标题.我无法弄清楚如何做到这一点.

如果我没有将它传递给函数,我知道我可以使用它deparse(substitute(df))来获得所需的标题.但是我无法在函数内部执行此操作.

有关如何做到这一点的任何想法?

r ggplot2 dataframe

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