rmlm Posted May 1, 2012 at 08:28 PM Report #452520 Posted May 1, 2012 at 08:28 PM Boas, Eu estou a usar este plugin : http://srobbin.com/jquery-plugins/pageslide/. O plugin funciona bem, mas quando acontece um postback ele deixa de funcionar. JS: $(".first").pageslide({ direction: "right", modal: true }); HTML: <div id="modal" style="display:none"> <div id="ttl_modal"> <asp:ContentPlaceHolder ID="modal_titulo" runat="server"></asp:ContentPlaceHolder> </div> <div id="modal_container"> <asp:ContentPlaceHolder ID="modal_conteudo" runat="server"></asp:ContentPlaceHolder> </div> </div> Botão que chama o plugin: <asp:HyperLink NavigateUrl="#modal" CssClass="first" ID="lbl_editar_guardar" runat="server" Text="Editar"></asp:HyperLink> Alguem sabe como solucionar o problema? Cumps
bruno1234 Posted May 1, 2012 at 08:46 PM Report #452522 Posted May 1, 2012 at 08:46 PM Assim de repente parece-me que o teu postback provoca que o conteúdo da página seja alterado, e sendo assim precisas de voltar a chamar o $( ... ).pageslide(...). Onde estás a chamar isso? no document ready? Se for o caso lê este artigo http://encosia.com/document-ready-and-pageload-are-not-the-same/ e vê se o pageload é mais indicado. Matraquilhos para Android. Gratuito na Play Store. https://play.google.com/store/apps/details?id=pt.bca.matraquilhos
rmlm Posted May 1, 2012 at 08:58 PM Author Report #452524 Posted May 1, 2012 at 08:58 PM Sim, o postback muda o conteudo da minha pagina. Eu estou a seguir o tutorial que esta la na página do plugin. Simplesmente meto o codigo que apresentei no head da página... Ja experimentei no page load fazer isto: if(IsPostBack) { string script = "$('.first').pageslide({ direction: 'right', modal: true });"; ClientScript.RegisterStartupScript(this.GetType(), "modalslide", script, true); } Mas não tive sucesso...
rmlm Posted May 2, 2012 at 10:04 AM Author Report #452634 Posted May 2, 2012 at 10:04 AM Já consegui. Fui pelo artigo que disseste e deu. Foi só meter o meu código assim: function pageLoad() { $(".first").pageslide({ direction: "right", modal: true }); }; Obrigado
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now