Note that there are some explanatory texts on larger screens.

plurals
  1. POExpanding a Div in Firefox loading the Xap inside it twice
    primarykey
    data
    text
    <p>I have a div that holds a Silverlight object tag. From the code on some user action (click on a button) I am expanding the Div to total browser window. I am doing it through Jquery addClass and Remove class. In those classes the difference is position absolute , height width 100% and increased z-index.</p> <p>It is running well in Ie7 and IE8. But while running through FF it is reloading the Xap when doing it. What can be the reason ? and any solution?</p> <p>Thanks.</p> <p>Edit: After some investigation it seems that the reason is because position:absolute. Changing position from relative to absolute is giving the problem. Also once I go from normal mode to fullscreen mode then normal mode. Then expanding it does not load it twice.</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; </code></pre> <p> SilverlightApplication1</p> <pre><code>&lt;style type="text/css"&gt; .slhost { width: 642px; height: 500px; position: relative; } .bigsl { width: 100%; height: 100%; position: absolute; } &lt;/style&gt; &lt;script src="jquery-1.3.2.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function openOverlay() { $("#silverlightControlHost").addClass("bigsl"); $("#silverlightControlHost").removeClass("slhost"); } function closeOverlay() { $("#silverlightControlHost").removeClass("bigsl"); $("#silverlightControlHost").addClass("slhost"); } &lt;/script&gt; </code></pre> <p> </p> <pre><code>&lt;UserControl x:Class="SilverlightApplication1.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"&gt; &lt; Grid x:Name="LayoutRoot" Background="Red" MouseLeftButtonDown="LayoutRoot_MouseLeftButtonDown"&gt; &lt;/Grid&gt; </code></pre> <p></p> <pre><code>using System.Windows; </code></pre> <p>using System.Windows.Controls; using System.Windows.Input; using System.Windows.Browser;</p> <p>namespace SilverlightApplication1 { public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); Deployment.Current.Dispatcher.BeginInvoke(() => HtmlPage.Window.Alert("Application Loaded")); }</p> <pre><code> private bool _flip; private void LayoutRoot_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (_flip) { Deployment.Current.Dispatcher.BeginInvoke(() =&gt; HtmlPage.Window.Invoke("closeOverlay", null)); } else { Deployment.Current.Dispatcher.BeginInvoke(() =&gt; HtmlPage.Window.Invoke("openOverlay", null)); } _flip = !_flip; } } </code></pre> <p>}</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload