I have this example:
<div class="container">
<div class="box">
<object class="object" data="http://www.marketingvox.com/wp/wp-content/uploads/2009/12/darpa-balloon.thumbnail.jpg">
<img class="image" src="http://www.marketingvox.com/wp/wp-content/uploads/2009/12/darpa-balloon.thumbnail.jpg">
</object>
</div>
</div>
.container {
width: 200px;
height: 500px;
overflow: scroll;
background: red;
}
.box {
top: 20px;
left: 20px;
width: 50px;
height: 1000px;
position: relative;
}
.object {
position: absolute;
}
.image {
top: 50px;
position: absolute;
cursor: pointer;
}
}
http://jsfiddle.net/aS972/1/
Hover over the image, and you won't be able to scroll, hover outside of image, and you can scroll. I need to be able to scroll even when hovering over the image.
What am I doing wrong?
For vertical scrollable bar use the x and y axis. Set the overflow-x:hidden; and overflow-y:auto; that will automatically hide the horizontal scroll bar and present only vertical scrollbar. Here the scroll div will be vertically scrollable.
To make div fixed scrolling to that div with CSS, we can use the position: sticky CSS property. position: -webkit-sticky; position: sticky; top: 0; z-index: 1; to set position to sticky and z-index to 1 to make the element with the sticky position show on top after we scroll to it.
To scroll only horizontally, we need to use the overflow-x property as we mentioned above and set the width and border properties. Also, we add a <p> element inside the <div> tag and then add style to it in the CSS section.
A lot of times with flash video you have to add a <param name="wmode" value="transparent" />
inside the <object>
tag to get html to render over it and events (like scrolling) to be fired.
Hopefully that can steer someone to the correct answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With