Lytebox problem onload

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • colinod
    Contributor
    • Nov 2007
    • 347

    Lytebox problem onload

    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



    thanks

    colin
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    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.

    Comment

    • colinod
      Contributor
      • Nov 2007
      • 347

      #3
      sorry i dont understand what return false is

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        If you want to prevent a link from being followed, add "return false;" onclick:
        Code:
        <a href="some-destination.html" ... onclick="return false;">

        Comment

        • colinod
          Contributor
          • Nov 2007
          • 347

          #5
          will that not always make the link not work, i will want the links to work when the page has loaded?

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            I don't know. I haven't really looked at the code, but it could easily be changed onload if required.

            Comment

            • colinod
              Contributor
              • Nov 2007
              • 347

              #7
              hi thanks for your help i have put a OnLoad return true in the line and it works

              Comment

              • acoder
                Recognized Expert MVP
                • Nov 2006
                • 16032

                #8
                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.

                Comment

                • colinod
                  Contributor
                  • Nov 2007
                  • 347

                  #9
                  My link code is like this

                  Code:
                  <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

                  Comment

                  • acoder
                    Recognized Expert MVP
                    • Nov 2006
                    • 16032

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

                    Comment

                    Working...