CSS or jQuery to right align image in Viewport and still allow scrolling to left -


i'm working on html page webkit, , have image wider viewport (2048 x 1536px). i'd have right half of image appear in viewport starting point, , allow scrolling left see rest of image.

i've tried few things in css (float, negative margin offsets) without luck.

<!doctype html> <html laneg="en"> <head> <title>viewport example</title>     <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=0.44, maximum-scale=1.0, target-densitydpi=device-dpi"/>  </head> <body> <img src="image25.jpg" width="4800" height="2400" /> </body> </html> 

visual representation: http://i44.tinypic.com/351j1pw.jpg

you might want force browser scroll. scroll 4800px horizontally make sure it's on right on every device. or use image's width instead of specifiying number.

<script type="text/javascript">     window.scrollto(4800,0); </script> 

Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -