Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scrollable div is not scrollable when hovering over image

Tags:

html

css

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?

like image 795
William Stocks Avatar asked Aug 22 '13 14:08

William Stocks


People also ask

How do I enable scrolling on a div?

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.

How can I fix div while scrolling?

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.

How do you make scrollbar only visible when scrolling?

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.


1 Answers

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.

like image 121
Steve Putala Avatar answered Oct 14 '22 09:10

Steve Putala