|
Rank: Member
Groups: Registered
Joined: 2/26/2014 Posts: 9
|
I have <ul><li> elements structure as below:
<ul class="tabs js-tabs"> <li class="current"><a href="#tab-Diagnosis">Diagnosis</a></li> <li><a href="#tab-Procedures">Procedure</a></li> <li ><a href="#tab-Notes">Sample Notes</a></li> <li><a href="#tab-Review">Review</a></li> </ul>
<Div> sections have been created for every href ID.
Problem: I have registered RapidSpell-AYT.js on the web page. It is working for the text boxes on the page except those inside the div elements associated with above tabs. Please let me know how to fix it.
|
|
Rank: Member
Groups: Registered
Joined: 4/22/2006 Posts: 216
|
|
|
Rank: Member
Groups: Registered
Joined: 2/26/2014 Posts: 9
|
I tried to add "rapidSpell.ayt_setupTextBoxes(true);" function on tabClick event in my javascript file but it did not work for me. TabClick function is executed on every tab click. Code:
function onTabClick(event) { event.preventDefault();
// If hashtag enabled if ($.fn.updateTabs.enabledHash) { // Retrieve hash parts var element = $(this); var hash = $.trim(window.location.hash || ''); if (hash.length > 1) { // Remove hash from other tabs of the group var hashParts = hash.substring(1).split('&'); var dummyIndex; while ((dummyIndex = $.inArray('', hashParts)) > -1) { hashParts.splice(dummyIndex, 1); } while ((dummyIndex = $.inArray('none', hashParts)) > -1) { hashParts.splice(dummyIndex, 1); } element.parent().parent().find('a[href^="#"]').each(function (i) { var index = $.inArray($(this).attr('href').substring(1), hashParts); if (index > -1) { hashParts.splice(index, 1); } }); } else { var hashParts = []; }
// Add current tab to hash (not if default) var defaultTab = getDefaultTabIndex(element.parent().parent()); if (element.parent().index() != defaultTab) { hashParts.push(element.attr('href').substring(1)); }
// If only one tab, add a empty id to prevent document from jumping to selected content if (hashParts.length == 1) { hashParts.unshift(''); }
// Put hash, will trigger refresh window.location.hash = (hashParts.length > 0) ? '#' + hashParts.join('&') : '#none'; } else { var li = $(this).closest('li'); li.addClass('current').siblings().removeClass('current');
li.parent().updateTabs(); } rapidSpell.ayt_setupTextBoxes(true); // rapidSpell.ayt_spellCheck(); -- also tried this but did not work };
|
|
Rank: Member
Groups: Registered
Joined: 2/26/2014 Posts: 9
|
Just to add - I am using Client Side method ( By referencing RapidSpell-AYT.js) on the page.
|
|
Rank: Member
Groups: Registered
Joined: 4/22/2006 Posts: 216
|
Thanks - does this code Code: // Put hash, will trigger refresh window.location.hash = (hashParts.length > 0) ? '#' + hashParts.join('&') : '#none';
get run, and does it (as it looks) reload the page? Regards. -Harry -Harry
|
|
Rank: Member
Groups: Registered
Joined: 2/26/2014 Posts: 9
|
Yes, it reloads the page to make keep that tab open by default.
|
|
Rank: Member
Groups: Registered
Joined: 4/22/2006 Posts: 216
|
Ok, so in that case calling rapidSpell.ayt_setupTextBoxes(true); after the window.location.hash call is not going to work, because the page is reloading when that line is called. You will probably need to call it after the tabs are initialized (when the textboxes in the new tab are actually shown), when the page has reloaded. If you need help with that, please prepare a simple page the I can run which reproduces it, and I can work on it for you. You can post the code here or email to me via support @ keyoti.com -Harry -Harry
|
|
Rank: Member
Groups: Registered
Joined: 2/26/2014 Posts: 9
|
Thanks Harry ! It worked for me.
|
|