1,105,380 Community Members

light box focus problem

Member Avatar
runjel
Newbie Poster
14 posts since Nov 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

i have a problem regarding light box focus.. i have a button that whenever i click the button it will call the light box..

there are 2 function .

function focus_on_lightbox(seconds) {
  var seconds_waited
  seconds_waited = seconds
  document.getElementById(EducationBox).focus(); 
  seconds_waited += 100;

  if (document.getElementById(EducationBox) != document.activeElement && seconds_waited < 2000)
    setTimeout("focus_on_lightbox(" + seconds_waited + ");", 100);
  {
	  
  }
}
function OpenEducation() {
	
		document.getElementById("EducationBox").style.display = "inline";
		document.getElementById("FullScreen").style.display = "inline";
		
}
function CloseEducation() {
		document.getElementById("EducationBox").style.display = "none";
		document.getElementById("FullScreen").style.display = "none";
}

the code above are the 2 functions . one for light box and second is for lightbox focus

how can i call the lightbox focus.

i tried the code below. it will focus to the lightbox but it will not display the lightbox.

<div class="a"><div class="l">&nbsp;</div><div class="r"><input type="submit" value="Add" onclick='OpenEducation(); return false; focus_on_lightbox '/></div></div>
Member Avatar
fxm
Posting Pro
591 posts since Apr 2010
Reputation Points: 23 [?]
Q&As Helped to Solve: 75 [?]
Skill Endorsements: 0 [?]
 
0
 

I don't know what else may be wrong (you have not provided enough to test) but in this statement onclick='OpenEducation(); return false; focus_on_lightbox ' nothing after "return false;" will ever be executed.

Start by moving that to the end of the onclick= string. You will then have to fix the rest of it to call 'focus_on_lightbox()' properly (if that is what you are trying to do).

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article