Connecting Tech Pros Worldwide Forums | Help | Site Map

Lytebox problem onload

colinod's Avatar
Familiar Sight
 
Join Date: Nov 2007
Posts: 182
#1: Jul 9 '09
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

acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#2: Jul 9 '09

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.
colinod's Avatar
Familiar Sight
 
Join Date: Nov 2007
Posts: 182
#3: Jul 9 '09

re: Lytebox problem onload


sorry i dont understand what return false is
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#4: Jul 9 '09

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;">
colinod's Avatar
Familiar Sight
 
Join Date: Nov 2007
Posts: 182
#5: Jul 9 '09

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?
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#6: Jul 9 '09

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.
colinod's Avatar
Familiar Sight
 
Join Date: Nov 2007
Posts: 182
#7: Jul 9 '09

re: Lytebox problem onload


hi thanks for your help i have put a OnLoad return true in the line and it works
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#8: Jul 9 '09

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.
colinod's Avatar
Familiar Sight
 
Join Date: Nov 2007
Posts: 182
#9: Jul 9 '09

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
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#10: Jul 9 '09

re: Lytebox problem onload


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