How to make an image horizontally scrollable but vertically fixed??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ashwani Sharma
    New Member
    • Nov 2008
    • 46

    How to make an image horizontally scrollable but vertically fixed??

    There is a page with both horizontal and vertical scrolling and there is an image too which have its fix position but what I need is it should get fixed with its position when scrolling page vertically but it should move with the page when scrolling horizontally.

    Please give your precious suggestions to help me out with this problem.

    Thanks in advance,
    Ashwani Sharma
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    It does work that way with 'position:fixed ' so there is something else in your markup causing this but without the complete listing or a link, it's just a wild guess.

    Comment

    • Ashwani Sharma
      New Member
      • Nov 2008
      • 46

      #3
      Here is the markup:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
      <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      <title>Untitl ed Document</title>
      </head>

      <body style="width:20 00px; height:1200px;" >
      <div style="width:20 0px; height:200px; display:block; border:solid 1px #000000; background:#cac aca; position:fixed; "></div>
      </body>
      </html>

      Now I need this div to move with scrolling horizontally but not vertically ..

      Comment

      • drhowarddrfine
        Recognized Expert Expert
        • Sep 2006
        • 7434

        #4
        Now that I'm awake, I realize I misunderstood the horizontal part. Fixed positioning is just absolute positioning so you could tinker with things there. Otherwise, a javascript solution can do this.

        Comment

        Working...