2012-03-19 74 views
0

我想弄清楚是否有一個css屬性(或任何其他方法真的),可以在Windows Phone 7的瀏覽器中使用,以防止它平移頁面,如果你觸摸在某個元素的內部。防止在Windows Phone 7瀏覽器上頁面平移

具體而言,我有一個Canvas元素,用於簽署驅動程序應用程序,目前Windows Phone 7是唯一不能運行的移動設備。

因此,它的要點是有一個畫布元素登錄,它的功能在android和iphone上,但在wp7設備上它只是移動頁面。

回答

0

在網上嘗試了一些建議和研究後,似乎目前沒有辦法做我想做的事。它看起來像微軟沒有內置iPhone/Android中使用的所有觸摸元素。

0

像這樣?

/// <summary> 
     /// Wraps a Html segment with html and body tags, and sets the viewport to prevent zooming. 
     /// </summary> 
     /// <param name = "html">The html segment to wrap</param> 
     /// <returns>A wrapped string with html and body tags</returns> 
     public static string WrapHtmlAndDisableZooming(string html) 
     { 
      return html == null 
         ? null 
         : string.Format(html, 
             "<html><head><meta name='viewport' content='width=320,user-scalable=no'/></head><body>{0}</body></html>", 
             html); 
     } 
+0

如果元素在表單的內部,這個函數將會嗎?對不起,我從來沒有嘗試過像你所提到的任何事情。另外我不需要/想要防止縮放,我需要屏幕在用手指觸摸畫布元素時不會移動。 – Jared 2012-03-19 16:06:34

+0

@Jared我不知道,你可以試試。我只用它來顯示EULA – 2012-03-19 17:22:39

相關問題