I positioned a form to the right of a document showing only a part of it
<form class="right-form">
<textarea></textarea>
<input type="submit" value="submit"></div>
</form>
and I styled like this(simplified example)
body{
height: 100%;
width: 100%;
}
.right-form{
position:absolute;
rigth: -220px;
width: 250px
transition: width 0.5s ease 0s, right 0.5s ease 0s;
}
.right-form:hover{
right: 0px;
}
Everything works well except the scroll bar at the bottom appears to scroll left to the right when the form is hidden, and I do not want it to appear. Someone knows how to deal with this css problem? Hope the problem is understandable...
Thanks a lot
EDIT: with the overflow rule proposed by matthias.p the user can still press the arrow key pad a scroll to the right
Use the below code, the 100% + the default margin is causing the issue
Usage of overflow does still allow the usage of arrow keys.. You can kill the usage of arrow keys like this:
Add
to the body rule.
Edit: You could do this:
Instead of changing the
right
value I have changed the width of the form and did theoverflow
on the form instead on the body. Now you cannot use the arrow keys anymore to display the form when not hovering.