0
I set the system, for when the screen is smaller, format the grid, to have horizontal scroll bar, is working perfectly. But beyond the scroll bar, I wanted a button or a link so that when the user clicked the grid would move to the right. I tried that way, but it didn’t work out:
<script type="text/javascript">
function move() {
document.getElementById('mobile').scrollLeft += 30;
}
</script>
Here I call the function:
<input name="btnImprimir" type="button" onclick="move();" value="ScrollLeft" />
And I put my Gridview inside the mobile div.
@media only screen and (max-width: 414px) {
.mobile {
overflow-x: scroll;
width: auto;
height:300px;
}
}
But when I click the button, no action happens.
Tobias, I did exactly as you said, putting the code on my page, but when you click on the button nothing happens. The same thing happens.
– Mariana
@marianac_costa becomes difficult to help you, without being able to reproduce the problem. Then edit your question, creating a Snippet (Crtl+M) with the relevant parts of your code and that reproduces the problem.
– Tobias Mesquita
Tobias, I am trying to adapt this code http://jsfiddle.net/josiahmccracken/pgeQR/4/ to my project.
– Mariana
Look at this answer, maybe I’ll give you some insight Scroll of window size
– Tobias Mesquita
Tobias, if you could help me, I played your example on Jsfiddle and it works, just my code that doesn’t, I copied and pasted exactly, for my project, only nothing happens either. Could it be in the JS statement ?
– Mariana