Note that there are some explanatory texts on larger screens.

plurals
  1. POLoad ifame onclick and KeyPress event
    text
    copied!<p>I have tabs in my aspx page, currently i have designed it to load on onclick event. I am trying it to load on keypress event. The keypress event is not firing, if i try moving down/Up arrows, tabs are navigating. Can anyone please help on ot. </p> <pre><code> &lt;%@ Page Title="" Language="C#" MasterPageFile="~/NIT.Master" AutoEventWireup="true" CodeBehind="Initiative.aspx.cs" Inherits="NIT_AMPO.Initiative" %&gt; &lt;asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"&gt; &lt;title&gt;Initiative&lt;/title&gt; &lt;script type="text/jscript" &gt; $(function () { $("#tabs").tabs().addClass("ui-tabs-vertical ui-helper-clearfix"); }); $(document).ready(function () { if ('&lt;%=Session["ProjectID"]%&gt;' != "") { $('#Contacts').attr('href', '#ContactsPage'); $('#Comments').attr('href', '#CommentsPage'); $('#RiskSummary').attr('href', '#RiskAssessmentSummaryPage'); $('#RiskAssessment').attr('href', '#tabs-3'); $('#Approvals').attr('href', '#tabs-3'); $('#Task').attr('href', '#tabs-3'); $('#Documents').attr('href', '#tabs-3'); $('#PostLaunch').attr('href', '#tabs-3'); $('#LinkedInititatives').attr('href', '#tabs-3'); } else { $('#Contacts').prop('disabled', true); ; $('#Comments').prop('disabled', true); $('#RiskSummary').prop('disabled', true); $('#RiskAssessment').prop('disabled', true); $('#Approvals').prop('disabled', true); $('#Task').prop('disabled', true); $('#Documents').prop('disabled', true); $('#PostLaunch').prop('disabled', true); $('#LinkedInititatives').prop('disabled', true); } }); &lt;/script&gt; &lt;script type="text/javascript"&gt; function loadIframe(iframeName, url) { var $iframe = $('#' + iframeName); if ($iframe.length) { $iframe.attr('src', url); return false; } return true; } function refreshPage() { //document.getElementById("ifrm").contentWindow.location.reload(true); document.getElementById("ifrm").contentWindow.location.href = document.getElementById("ifrm").contentWindow.location.href } function iframeLoaded() { var iFrameID = document.getElementById('ifrm'); if (iFrameID) { iFrameID.height = ""; var height = iFrameID.contentWindow.document.body.scrollHeight if (height &lt; 600) { iFrameID.height = "600px"; } else { iFrameID.height = height + "px"; } } } function iframeBlur() { window.focus(); } $(function () { $('a:first').focus var id = $('a:first').focus(); }); $(document).on('keydown', function (e) { if (e.which == 40) { id = $("*:focus"); id.parents('li').next().find('a').focus(); } else if (e.which == 38) { id = $("*:focus"); id.parents('li').prev().find('a').focus(); } }); &lt;/script&gt; </code></pre> <p></p> <pre><code>&lt;asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"&gt; &lt;div id="tabs"&gt; &lt;ul&gt; &lt;li&gt;&lt;a id="Main" href="#iframeInitiative" onclick="return loadIframe('ifrm', 'Main.aspx')"&gt;Main&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a id="Contacts" href="#iframeInitiative" onclick="return loadIframe( 'ifrm', 'Contacts.aspx')" onfocus="return loadIframe( 'ifrm', 'Contacts.aspx')"&gt;Contacts&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a id="Comments" href="#iframeInitiative" onclick="return loadIframe( 'ifrm', 'Comments.aspx')" onfocus="return loadIframe( 'ifrm', 'Comments.aspx')"&gt;Comments&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a id="RiskSummary" href="#iframeInitiative" onclick="return loadIframe('ifrm', 'RiskAssessmentSummary.aspx')" onfocus="return loadIframe( 'ifrm', 'RiskAssessmentSummary.aspx')"&gt;Risk Assessment Summary&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a id="RiskAssessment" href="#iframeInitiative" onclick="return loadIframe('ifrm', 'RiskAssessment.aspx')"&gt;Risk Assessment&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a id="Approvals" href="#iframeInitiative" onclick="return loadIframe('ifrm', 'Approvals.aspx')"&gt;Approvals&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a id="Task" href="#iframeInitiative" onclick="return loadIframe('ifrm', 'ImpactTaskSummary.aspx')"&gt;Impact/Task Summary&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a id="Documents" href="#iframeInitiative" onclick="return loadIframe('ifrm', 'Documents.aspx')"&gt;Documents&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a id="PostLaunch" href="#iframeInitiative" onclick="return loadIframe('ifrm', 'PostLaunch.aspx')"&gt;Post Launch&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a id="LinkedInititatives" href="#tabs-3"&gt;Linked Initiatives&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div id="tabs-3"&gt; &lt;div id="left"&gt; &lt;img id="Logo" src="Images/Website_Page_Under_Construction.jpg" alt="AmEx Logo" height="200" width="200" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="iframeInitiative"&gt; &lt;iframe name="ifrm" id="ifrm" src="Main.aspx" frameborder="0" width="900px" onload="iframeLoaded()" &gt; &lt;/iframe&gt; &lt;/div&gt; &lt;/div&gt; &lt;telerik:RadScriptManager ID="RadScriptManager1" runat="server"&gt; &lt;/telerik:RadScriptManager&gt; &lt;telerik:RadWindowManager ID="ParentRadWindowManager1" runat="server" EnableShadow="true" Behaviors="Close" Style="z-index: 7000"&gt; &lt;Windows&gt; &lt;telerik:RadWindow ID="RiskQuestionnaireDialog" runat="server" ReloadOnShow="true" VisibleStatusbar="false" ShowContentDuringLoad="false" Modal="true" BorderStyle="None" Height="560" Width="1000" OnClientClose="refreshPage"&gt; &lt;/telerik:RadWindow&gt; &lt;telerik:RadWindow ID="ImpactDetailsDialog" runat="server" ReloadOnShow="true" Height="540" Width="700" OnClientClose="refreshPage" ShowContentDuringLoad="false" Modal="true" BorderStyle="None" VisibleStatusbar="false"&gt; &lt;/telerik:RadWindow&gt; &lt;telerik:RadWindow ID="SendMailDialog" runat="server" ReloadOnShow="true" Height="460" Width="800" VisibleStatusbar="false" ShowContentDuringLoad="false" Modal="true" BorderStyle="None"&gt; &lt;/telerik:RadWindow&gt; &lt;/Windows&gt; &lt;/telerik:RadWindowManager&gt; </code></pre> <p></p>
 

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