Welcome to TalkGraphics.com
Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Apr 2008
    Location
    Rostov region
    Posts
    84

    Default 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).

  2. #2
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    41,486

    Default Re: Controlling the presentation with mouse scroll

    Thank you for this Mark. Your English is fine.

  3. #3
    Join Date
    Apr 2008
    Location
    Rostov region
    Posts
    84

    Default 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.

  4. #4
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,744

    Default 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
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  5. #5
    Join Date
    Apr 2008
    Location
    Rostov region
    Posts
    84

    Default 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!

  6. #6
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,744

    Info 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
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  7. #7
    Join Date
    Apr 2008
    Location
    Rostov region
    Posts
    84

    Default Re: Controlling the presentation with mouse scroll

    Acorn
    Everything became much easier. Thank you!

  8. #8
    Join Date
    Apr 2008
    Location
    Rostov region
    Posts
    84

    Default 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?

  9. #9
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,744

    Question Re: Controlling the presentation with mouse scroll

    Quote Originally Posted by maksimon View Post
    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
    On one turn on, on the other turn off.
    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  10. #10
    Join Date
    Apr 2008
    Location
    Rostov region
    Posts
    84

    Default 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.

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •