Connecting Tech Pros Worldwide Help | Site Map

Lytebox problem onload

  #1  
Old July 9th, 2009, 01:17 PM
colinod's Avatar
Familiar Sight
 
Join Date: Nov 2007
Posts: 172
Hi everyone.

I am using lytebox to load a page into the lyteframe part of the script.

the problem is that if you click on the link before the page is fully loaded it just loads into a normal window without using the lytebox script, does any one have any ideas on hoe to get round this

can be viewed at

http://www.yaketyyakallmouth.com/pages/boys.asp?id=All

thanks

colin
  #2  
Old July 9th, 2009, 01:56 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,522
Provided Answers: 12

re: Lytebox problem onload


The Lytebox script initiates onload, so you'll have to make the links "dead" if you want to avoid this problem. Use "return false" to stop a link following its destination.
  #3  
Old July 9th, 2009, 03:19 PM
colinod's Avatar
Familiar Sight
 
Join Date: Nov 2007
Posts: 172

re: Lytebox problem onload


sorry i dont understand what return false is
  #4  
Old July 9th, 2009, 03:32 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,522
Provided Answers: 12

re: Lytebox problem onload


If you want to prevent a link from being followed, add "return false;" onclick:
Expand|Select|Wrap|Line Numbers
  1. <a href="some-destination.html" ... onclick="return false;">
  #5  
Old July 9th, 2009, 03:49 PM
colinod's Avatar
Familiar Sight
 
Join Date: Nov 2007
Posts: 172

re: Lytebox problem onload


will that not always make the link not work, i will want the links to work when the page has loaded?
  #6  
Old July 9th, 2009, 03:56 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,522
Provided Answers: 12

re: Lytebox problem onload


I don't know. I haven't really looked at the code, but it could easily be changed onload if required.
  #7  
Old July 9th, 2009, 04:17 PM
colinod's Avatar
Familiar Sight
 
Join Date: Nov 2007
Posts: 172

re: Lytebox problem onload


hi thanks for your help i have put a OnLoad return true in the line and it works
  #8  
Old July 9th, 2009, 05:45 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,522
Provided Answers: 12

re: Lytebox problem onload


I'm not entirely sure how you've got it working with that. Can you post the code for clarification? Anyway, glad to see you've got it working.
  #9  
Old July 9th, 2009, 06:07 PM
colinod's Avatar
Familiar Sight
 
Join Date: Nov 2007
Posts: 172

re: Lytebox problem onload


My link code is like this

Expand|Select|Wrap|Line Numbers
  1. <a href="anypage.htm" rel="lyteframe" OnClick="return false;" OnLoad="return true;" rev="width: 1000px; height: 600px; scrolling: auto;">
It seems to work the links go nowhere unless the page has finished loading

Its a shome that in IE the window that loads causes the Flash part of the pash to flutter and move when you roll over the edge of the window
  #10  
Old July 9th, 2009, 06:42 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,522
Provided Answers: 12

re: Lytebox problem onload


Actually, onload is not a link event, so you can remove that and it should still work.
Reply