问题列表 - 第48186页

使用toggleClass()的jQuery toggle()

我有一个按钮可以打开和关闭DIV层.我正在尝试向按钮添加一个类,以便当它在其上切换时显示不同,但是我无法使其工作,在切换按钮时不会添加该类.

该按钮是列表项,例如开/关

这是我的代码:

$("#btninformation").click(function () {
  $("#map-items-category-one").toggle("slow", function() {
    $(this).toggleClass("toggled-on");
  });
});
Run Code Online (Sandbox Code Playgroud)

任何想法都有错吗?

谢谢扎克

jquery toggle toggleclass

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

每个Android屏幕的大小是多少

我正在寻找每个Android大小的内容区域的所有大小:

  • QVGA(240x320)
  • WQVGA400(240x400)
  • WQVGA432(240x432)
  • HVGA(320x480)
  • WVGA800(480x800)
  • WVGA854(480x854)

我所说的"内容区域"是没有通知栏的屏幕.我无法在任何地方找到此信息(内容区域大小或通知栏的高度).

虽然我可以在模拟器中加载所有大小并计算每个屏幕的大小,但我确信其他人已经完成了它.:)

android

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

如何在c#中重置单例实例?

是否有办法在用户更新数据库时强制单例实例重置?

public class Example{
      private Dictionary<int, string> _list;

      private Example(){
        _list = new Dictionary<int, string>();
        //Get data from database here and add the data to _list
      }

      private class Nested{ 
          static Nested(){}
          internal static readonly Example Instance = new Example();
      }

      public static Dictionary<int, string> GetExample(){
         return Nested.Instance._list
      }

}
Run Code Online (Sandbox Code Playgroud)

那么,我在更新数据库时重置_list?

谢谢!

c# singleton

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

在CATiledLayer -setNeedsDisplay之后,并非所有图块都重新绘制

我的观点有一个CATiledLayer.视图控制器具有自定义缩放行为,因此-scrollViewDidEndZooming需要重新绘制每个图块.但是,即使-setNeedsDisplay在每次缩放后在图层上调用,也不是所有的图块都被重绘.这导致视图在缩放后有时看起来有问题.(应该只出现在1个图块中的东西出现在多个地方).它经常在另一次变焦后自行修正.

这是相关的代码.updatedRects用于测试 - 它存储请求绘制的唯一矩形-drawLayer.

CanvasView.h:

@interface CanvasView : UIView
@property (nonatomic, retain) NSMutableSet *updatedRects; 
@end
Run Code Online (Sandbox Code Playgroud)

CanvasView.m:

@implementation CanvasView

@synthesize updatedRects; 

+ (Class)layerClass 
{
    return [CATiledLayer class];
}

- (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)context
{
    CGRect rect = CGContextGetClipBoundingBox(context); 
    [updatedRects addObject:[NSValue valueWithCGRect:rect]]; 

    CGContextSaveGState(context); 
    CGContextTranslateCTM(context, rect.origin.x, rect.origin.y); 
    // ...draw into context...
    CGContextRestoreGState(context); 
}

@end
Run Code Online (Sandbox Code Playgroud)

MyViewController.m:

@implementation MyViewController

- (void)viewDidLoad 
{
    [super viewDidLoad];

    canvasView.updatedRects = [NSMutableSet set]; 
}

- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale
{ …
Run Code Online (Sandbox Code Playgroud)

iphone cocoa-touch ipad catiledlayer ios

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

如何在Perforce中撤消集成,并且仍然可以重做它?

我在perforce中有一个糟糕的集成更改列表.我想支持它,并且更仔细地重做(并且可能以较小的增量).

我使用Perforce的rollback命令恢复到以前版本的文件,但是当我尝试重做集成时,Perforce声称没有什么可做的.显然,回滚只是简单地还原文件,但对相关的集成相关元数据没有任何作用.因此,当我尝试重新集成时,Perforce认为"您之前已经集成了两个版本 - 现在无所事事".

有什么方法可以撤消涉及集成的变更列表,并让仓库处于我可以实际再次进行集成的状态吗?

这是一个大型项目,集成超过2,000个文件,所以我真的不想被卡住这样做.

perforce

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

IIS 7 中的另一个 404 页面问题

我有一个现有的网站,我需要迁移到 IIS 7。该网站(我不想重写)使用 404 错误来提供数据库中的页面。IOW,像http://crimson/pages/myPage这样的 url会导致 404,然后转到 site404.aspx,后者从数据库生成 html。

在 IIS6 中,我设置了一个映射到 aspnet_isapi.dll 的通配符处理程序,并将 404 映射到指向我的 site404.aspx 并且一切正常。

我在带有 IIS 7 的新开发服务器上做了同样的事情,但无法让它工作。

我正在使用 Classic.net AppPool 通配符处理程序看起来像这样

<add name="WildCardHandler" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv2.0,bitness64" />
Run Code Online (Sandbox Code Playgroud)

CustomErrors 看起来像这样:

<customErrors mode="Off" defaultRedirect="url">
        <error statusCode="403" redirect="NoAccess.htm" />
        <error statusCode="404" redirect="/site404.aspx" />
    </customErrors>
Run Code Online (Sandbox Code Playgroud)

在站点的错误页面选项卡上,404 映射到 aspx 页面,类型设置为执行 URL

尽管如此,我收到以下错误:

HTTP 错误 404.0 - 未找到
您要查找的资源已被删除、更名或暂时不可用。详细错误信息Module IIS Web Core
通知 MapRequestHandler 
处理程序静态文件 
错误代码 0x80070002 
请求的 URL http://srvr:80/crimson/articles/index 
物理路径 C:\inetpub\wwwroot\Crimson\articles\index 
匿名登录方法 
登录用户匿名 

感谢您的任何见解。

asp.net iis-7 http-status-code-404

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

如何在 ms access 2007 查询中声明和设置变量

我想在 ms access 2007 数据库查询中声明和设置变量。我想将 2 个数据库查询结果存储在 2 个变量中,因为它们在执行后是整数或字符串类型。我想知道如何声明和设置变量?

SQL server 等价物是这样的

declare @var1 varchar(50)
set @var1 = 'select * from table'
Run Code Online (Sandbox Code Playgroud)

ms-access

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

从查询字符串中删除"+"

我已经在互联网上搜索了这个答案.我有一个字符串数组,看起来像这样:

[0] Cinnamon+Chocolate+Twists
[1] 3.25+Ounce+Croissant 
Run Code Online (Sandbox Code Playgroud)

我需要从这些字符串中删除所有"+"字符,而是插入一个空格.以下代码不起作用:

nameProduct[1] = nameProduct[1].replace("+"," ");
Run Code Online (Sandbox Code Playgroud)

我尝试了.replace方法的几种变体,但没有运气.有任何想法吗?

javascript string

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

在C#/ WPF中获取PathGeometry(行)的长度

如果我有一条封闭的路径,我可以Geometry.GetArea()用来近似我的形状区域.这很棒,节省了我很多时间.但周围有什么可以帮助我找到一条未封闭路径的长度吗?

我现在能够想出的最好PathGeometryGetPointAtFractionLength方法是确保我正在使用并多次调用该方法,获得积分并累加所有这些点之间的距离.

码:

    public double LengthOfPathGeometry(PathGeometry path, double steps)
    {
        Point pointOnPath;
        Point previousPointOnPath;
        Point tangent;

        double length = 0;

        path.GetPointAtFractionLength(0, out previousPointOnPath, out tangent);

        for (double progress = (1 / steps); progress < 1; progress += (1 / steps))
        {
            path.GetPointAtFractionLength(progress, out pointOnPath, out tangent);
            length += Distance(previousPointOnPath, pointOnPath);
            previousPointOnPath = pointOnPath;
        }
        path.GetPointAtFractionLength(1, out pointOnPath, out tangent);
        length += Distance(previousPointOnPath, pointOnPath);

        return length;
    }

    public static double Distance(Point p0, Point p1)
    { …
Run Code Online (Sandbox Code Playgroud)

c# wpf path pathgeometry

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

WordPress:获取post_parent标题

我创建了一个自定义侧边栏来抓取后父级页面:

query_posts("post_type=page&post_parent=6"); 
Run Code Online (Sandbox Code Playgroud)

我想抓住post_parent的标题(即"关于").the_title将无法正常工作,因为它是子页面的标题.

如何输出post_parent标题?

wordpress parent title

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