Web Analytics Made Easy -
StatCounter fancybox (stay when scroll) - CodingForum

Announcement

Collapse
No announcement yet.

fancybox (stay when scroll)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • fancybox (stay when scroll)

    anyone know how to get the css to keep the box in the center of the screen even when scrolling?

    http://fancybox.net/

    I know it must be something with position css, but it messes up when I try to use fixed
    thanks.

  • #2
    position:fixed is the way to get it to work. I went to the site you gave and using firebug set that property and it worked fine. Make sure you apply the position to the right div...for the page you gave, I applied it to the #fancybox-content div, not the image contained therein.

    Can you paste the code your trying to use so we can troubleshoot it more if it doesn't work?
    WordPress Designer and theme developer. KlongDesigns - helping bloggers and non-technical folks claim their space on the internet.

    Comment


    • #3
      I don't see anything on their page that stays in the center of the screen when scrolling...

      Do you mean that you want to use fancybox, only have it use position:fixed to keep it centered when scrolling?

      If so, then you need to tamper with the js coding that dynamically changes the setting for "top" when the page is resized (unless there is a built-in option in the script for that, which there might be - I've never used fancybox so I'm not sure). I would think that is all that is needed to get it working. If that's the case then you would need to ask a moderator to move your thread to the javascript forum.

      Or have I misunderstood your request?
      The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
      See Mediocrity in its Infancy
      It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
      Seek and you shall find... basically:
      validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

      Comment


      • #4
        Rowsdower:

        I took the op to mean if you click on one of the "examples", and you get an enlarged view. If you then scroll, the enlarged image scrolls with the page, but they want it to stay in the center. which is why I gave the solution I did.

        But I have been known to be wrong before.
        WordPress Designer and theme developer. KlongDesigns - helping bloggers and non-technical folks claim their space on the internet.

        Comment


        • #5
          I think we're on the same page, resdog. I just note that when I used fixed positioning in firebug on that page and then, for example, closed firebug - the javascript would set the "top" position again based on the new window size and the image would blow right off of the screen.

          That problem would need to be overcome, hence the javascript alteration suggestion.

          Either way, position:fixed is a start so we're in synch on that.
          The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
          See Mediocrity in its Infancy
          It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
          Seek and you shall find... basically:
          validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

          Comment


          • #6
            he would need to alter the positioning in the script becuaser it most likely sets it as absolute, or perhaps fancybox has a plugin option to change to fixed?
            - Firebug is a web developers best friend! - Learn it, Love it, use it!
            - Validate your code! - JQ/JS troubleshooting
            - Using jQuery with Other Libraries - Jslint for Jquery/other JS library users

            Comment


            • #7
              OK, so I think all three of us are saying the same thing now, more or less.

              I just keep finalizing my posts about two minutes after resdog posts basically the same thing. If I had noticed it before posting I would have just deleted my text and gone to another thread.

              I'm now on high alert for resdog posts!
              The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
              See Mediocrity in its Infancy
              It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
              Seek and you shall find... basically:
              validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

              Comment

              Working...
              X