Controlling the presentation with mouse scroll
1. Create your presentation as usual.
2. Open the "WebSite Properties" window.
3. Press "HTML Code(body)" and type:
Code:
<script type="text/javascript">
window.addEventListener("wheel", function(e) {
if (e.deltaY < 0)
{
xr_prev();
}
else if (e.deltaY > 0)
{
xr_next();
}
});
</script>
4. Press "OK". Then "Apply"
5. Export document as a presentation.
Thats all.
But let's try to do a little better and slow down the reaction on mouse wheel:
6. In folder where you exported the presentation, find the file "prs4.js"
7. Open prs4.js in any text editor.
8. Find this string:
Code:
setTimeout("xr_spatrl1("+n+","+l+",'"+layer+"')", 20);
and change "20" to "300".
Save file.
Open you index.htm and try to scroll the mouse wheel.
That's all.
Applying you imagination can achieve very interesting results with this method.
Sorry for bad English).
Re: Controlling the presentation with mouse scroll
Thank you for this Mark. Your English is fine. :)
Re: Controlling the presentation with mouse scroll
Sorry, my mistake. I forgot one more option.
You must make another edit to prs4.js.
Find this text:
Code:
setTimeout("xr_spatr1("+n+","+l+","+p+","+cln+",'"+cll+"')", 20)
and chabge "20" to "300"
This parameter is responsible for the delay of response to scrolling of the mouse when switching pages.
And that option is what I wrote in a previous post - the delay of response to scrolling of the mouse when switching between steps on page.
Re: Controlling the presentation with mouse scroll
Thank you for the code.
It would be better not to have to alter the prs4.js file as you need to do this every update to the design file.
Would it not be better to add the delay to the wheel event?
Acorn
Re: Controlling the presentation with mouse scroll
The mouse scroll events are queued and the delay in processing the scroll results only delays of all(!) wheel clicks. And it doesn't work the way you want it to.)
Try it. Maybe you can make it better. I will only be grateful!
Re: Controlling the presentation with mouse scroll
maksimon,
Code:
<script>var lastExecution;
var sampleRate = 5 // per second
addEventListener("wheel", function(event) {
var now = Date.now();
if (now - lastExecution < 1000/sampleRate) return;
lastExecution = now;
if (event.deltaY < 0)
{
xr_prev();
}
else if (event.deltaY > 0)
{
xr_next();
}
}, false);
</script>
This seems to work.
Thank you for the concept.
Acorn
Re: Controlling the presentation with mouse scroll
Acorn
Everything became much easier=D>. Thank you!
Re: Controlling the presentation with mouse scroll
Tell me, is there a way to disable the ability to turn pages?
Disable even the ability to scroll through the arrows and pgup pgdown, but leave the ability to follow the links. On each page separately. On one turn on, on the other turn off. Is there any hack for this?
Re: Controlling the presentation with mouse scroll
Quote:
Originally Posted by
maksimon
Tell me, is there a way to disable the ability to turn pages?
Disable even the ability to scroll through the arrows and pgup pgdown, but leave the ability to follow the links. On each page separately. On one turn on, on the other turn off. Is there any hack for this?
Untick the Web Properties > Website > Presentation website.
Not sure what you mean by
Quote:
On one turn on, on the other turn off.
Acorn
Re: Controlling the presentation with mouse scroll
I will try to explain in more detail. For example: I have a 10-page presentation. I want the presentation to work as usual, BUT if I was on the third page, it was impossible to go to the fourth with the arrow keys on the keyboard.