views:

25

answers:

1

I have the image at specific position e,g

img {

position:absolute;
top:150px;

}

Is there any to scroll the image with text scrolling so that image always stays at same position with respect to screen.

I don't want to use position fixed

+1  A: 

You need to give it fixed position:

img {
  position:fixed;
  top:150px;
  left:200px;
}

And then adjust the top and left values accordingly.

No need for jQuery but if you still want, you can do like:

$(function(){
  $('#img_id').css({
   position:'fixed',
   top:'150px',
   left: '200px'
  });
});
Sarfraz