小编Ed *_*tes的帖子

jQuery测试element1是否为element2的后代

有没有人知道一种好方法来测试存储在var中的一个元素是否是另一个元素的后代,也存储在var中?

我不需要element1.isChildOf('selector'),这很容易.
我需要element1.isChildOf(element2)

element2.find(element1).size() > 0 似乎没有用.

我不想写一个插件.each用于测试每个孩子,如果我可以避免它.

jquery

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

WPF控件默认大小

在为wpf应用程序定义自定义资源主题时,我可以设置宽度/高度等...如何找到这些属性的默认值(即框架中提供的控件中使用的值)?

wpf wpf-controls

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

从WPF listview拖动多个项目

我有一个列表视图,显示目录中的文件.
用户可以将列表视图中的每个项目拖动到文件夹/桌面,并在那里复制关联的文件.
这很好用.问题是 - 我想对多个项目这样做 - 因此用户可以选择多个listviewitems并将它们拖放并复制在一起.ListView设置为SelectedMode = Multiple-但它不会复制所有选定的项目.这是我的代码:

    private void FileView_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
    {
        this.start = e.GetPosition(null);
    }

    private void FileView_MouseMove(object sender, MouseEventArgs e)
    {
        Point mpos = e.GetPosition(null);
        Vector diff = this.start - mpos;

        if (e.LeftButton == MouseButtonState.Pressed &&
            Math.Abs(diff.X) > SystemParameters.MinimumHorizontalDragDistance &&
            Math.Abs(diff.Y) > SystemParameters.MinimumVerticalDragDistance)
        {
            if (this.FileView.SelectedItems.Count == 0)
            {
                return;
            }

            // right about here you get the file urls of the selected items.  
            // should be quite easy, if not, ask.  
            string[] files …
Run Code Online (Sandbox Code Playgroud)

wpf binding drag-and-drop

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

是否有可能将嵌套的DIV z-index更高(显示在'上方')然后在IE7中对根DIV进行z-index?

UPDATE!

建议的答案是不正确的,我的错误.#container DIV应该有"float:left;".请验证Firefox和IE7中的HTML.你可以看到差异!

我不能让一个DIV嵌套使用的z-index显示上方的较高层次的嵌套DIV ...叠加保持在铺设即使底部嵌套DIV具有较高的z-index较低DIV嵌套...这是甚至可能在IE7中?

以下显示Firefox中绿色#overlay上方的蓝色#details,但在IE7中,蓝色#details位于绿色#overlay下方

UPDATE2:价格 :添加"z-index:99;" #container样式使得类.item div出现(在Firefox中,IE搞砸了:无论如何都不能正确显示),而它们应该在叠加下!如果没有#container z-index设置,它会在Firefox中正确显示,但不能在IE中显示....

<html>
    <body>
        <style type="text/css">
            .item {
                float:left;width:75px;height:75px;background-color:red;
            }
        </style>
        <div id="main" style="position:relative;">
            <!-- this one should overlay everything, except #details -->
            <div id="overlay" style="position:absolute;
                                     top:0px;
                                     left:0px;
                                     width:500px;
                                     height:500px;
                                     z-index:1;
                                     background-color:green;"></div>
            <div id="container" style="position:relative;float:left;">
                <!-- these ones should display UNDER the overlay: so NOT visible -->
                <div class="item"></div>
                <div class="item"></div>
                <div class="item"></div>
                <div class="item"></div>
                <div class="item"></div>
                <!-- this one should display above the overlay -->
                <div id="details" style="position:absolute;
                                         width:200px;
                                         height:200px; …
Run Code Online (Sandbox Code Playgroud)

html css z-index

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

标签 统计

wpf ×2

binding ×1

css ×1

drag-and-drop ×1

html ×1

jquery ×1

wpf-controls ×1

z-index ×1