小编Pak*_*Pak的帖子

IE10上的触摸点之间的空间

我正在使用插件flot.touch.js,它在webkit浏览器的图表上添加了触摸交互性(平移和缩放).我想让它在IE10上工作,但我不知道如何检索我的触摸点之间的空间(我需要这个来计算比例).

在webkit浏览器上,我们可以通过使用这些变量来实现:

evt.originalEvent.touches[0].pageX
evt.originalEvent.touches[0].pagey
evt.originalEvent.touches[1].pageX
evt.originalEvent.touches[1].pageY
Run Code Online (Sandbox Code Playgroud)

javascript flot touch internet-explorer-10

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

地理编码服务与 gMap 搜索之间的差异结果

我想获取该地址的纬度和经度:Boulevard de la Marne Zone industrielle, COULOMMIERS, 77120, France

我将 api 添加到我的页面:

<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=true"></script>
Run Code Online (Sandbox Code Playgroud)

当我使用 gmaps 时,结果很好,但是当我想通过 API 检索它时:

 geocoder = new google.maps.Geocoder();
 geocoder.geocode({ 'address': myAdress, 'region': 'FR'}, function (results, status) {...});
Run Code Online (Sandbox Code Playgroud)

它执行以下请求:

https://maps.googleapis.com/maps/api/js/GeocodeService.Search?4sBoulevard%20de%20la%20Marne%20%20Zone%20industrielle%20%20COULOMMIERS%2077120%20&7sUS&9sfr-FR&callback=_xdc_._lsoj9s&token=53058
Run Code Online (Sandbox Code Playgroud)

结果是在巴马科附近......

如果我使用视口边界,它会执行以下请求:

https://maps.googleapis.com/maps/api/js/GeocodeService.Search?4sBoulevard%20de%20la%20Marne%20%20Zone%20industrielle%20%20COULOMMIERS%2077120%20&6m6&1m2&1d40.513799&2d-5.844727000000034&2m2&1d51.727028&2d10.854491999999936&7sUS&9sfr-FR&callback=_xdc_._c84svr&token=29019
Run Code Online (Sandbox Code Playgroud)

更好(在法国)但事实并非如此

该查询在谷歌地图网站上运行良好: https://maps.google.fr/maps? q=Boulevard+de+la+Marne++Zone+industrielle,++COULOMMIERS,+77120&hl=fr&ll=48.487486,3.922119&spn =1.541855,4.22699&sll=50.485474,25.620117&sspn=23.748757,67.631836&hq=大道+de+la+马恩++区+工业区,++COULOMMIERS,+77120&半径=15000&t=m&z=9

似乎获得它的唯一方法是执行以下请求: http://maps.googleapis.com/maps/api/geocode/json ?address=Boulevard%20de%20la%20Marne%20Zone%20industrielle,%20COULOMMIERS ,%2077120&组件=国家:FR&传感器=假

我不明白为什么当我使用视口而不是国家时结果不同(两个结果都在视口的边界内)

javascript google-maps google-maps-api-3 google-geocoder

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

WPF ListView突出显示颜色不改变

我有一个 ListView,每个项目有三个 TextBlock。第一个具有默认颜色(黑色),其他颜色的属性“前景”设置为灰色。

当我选择一个项目时,第一个 TextBlock 的颜色变为蓝色,但其他文本块保持灰色且难以阅读。

我希望在选择该项目时所有文本都变成白色。我该怎么做?

编辑:我的风格:

 <UserControl.Resources>
        <Style TargetType="{x:Type ListViewItem}">
            <Style.Triggers>
                <Trigger Property="IsSelected" Value="True">
                    <Setter Property="Foreground" Value="White"/>
                </Trigger>
            </Style.Triggers>
        </Style>
    </UserControl.Resources>
Run Code Online (Sandbox Code Playgroud)

我的列表视图

        <ListView  x:Name="lvResultat"  Grid.Row="0" Grid.Column="1" Background="{x:Null}"  
                      Margin="4"                       
                      HorizontalContentAlignment="Stretch"
                           ScrollViewer.VerticalScrollBarVisibility="Auto"
                      ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                      IsSynchronizedWithCurrentItem="True"    

                      ItemsSource="{Binding ResultatsRecherche}" SelectedItem="{Binding ResultatSelectione, Mode=TwoWay}" BorderBrush="{x:Null}" MouseDoubleClick="lvResultat_MouseLeftDoubleClick" >
        <ListView.ItemTemplate>
            <DataTemplate DataType="viewModel:ResultatRechercheViewModel">
                <Grid Height="86" Margin="2"  >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="1.5*"/>
                        <RowDefinition Height="1*"/>
                        <RowDefinition Height="1*"/>
                        <RowDefinition Height="0.5*"/>
                    </Grid.RowDefinitions>
                    <TextBlock Text="{Binding Titre}" 
                                       FontSize="20" FontWeight="Bold"  />
                    <TextBlock Text="{Binding SousTitre}" Grid.Row="1" 
                                       FontStyle="Italic" Foreground="Gray"/>
                    <TextBlock Text="{Binding Resume}" Grid.Row="2"  TextTrimming="WordEllipsis"
                                        Foreground="Gray"/>

                </Grid>
            </DataTemplate>
        </ListView.ItemTemplate> …
Run Code Online (Sandbox Code Playgroud)

wpf xaml listview highlight listviewitem

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

fullCalendar 中周视图的自定义 titleFormat

我正在尝试将 fullCalendar 从 1.6 升级到 3.0

以前我的 titleFormat 是:

titleFormat: {
    month: "MMMM yyyy",
    week: "'Week from 'd [MMMM] { 'to' d MMMM  yyyy}",
    day: "dddd d MMMM yyyy"
},
Run Code Online (Sandbox Code Playgroud)

现在我使用titleFormat 文档中描述的视图特定选项:

    views: {
        month: {
            titleFormat: "MMMM YYYY",                  
        },
        week: {
            columnFormat: "dddd d",            
        },
        day: {
            titleFormat: "dddd d MMMM YYYY",
            columnFormat: "dddd d",           
        }
    },
Run Code Online (Sandbox Code Playgroud)

但我无法在一周内重现相同的文本。事实上,根据formatRange文档:

FullCalendar 将智能地使用它来格式化两个日期,中间有一个破折号。

我错过了什么吗?

javascript jquery-plugins fullcalendar

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