Conflict between jQuery slider and iui (iphone)

I am trying to get a slider on iphone web application, I use iui to handle ui. It looks like the slider is causing some kind of conflict with iui.js, when you drag the slider, it tries to open another page. However, it works great when you just click on some part of the panel. I thought this slide event triggers it, but this event fires in both cases, so I got a little stuck. Any help would be greatly appreciated.

A simple test example (click to get a slider):

<head>
    <meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>

    <script type="application/x-javascript" src="http://www.joehewitt.com/iui/iui/iui.js"></script>
    <link href="http://www.joehewitt.com/iui/iui/iui.css" type="text/css" rel="stylesheet" />

    <script type="text/javascript" src="http://jqueryui.com/latest/jquery-1.3.2.js"></script>
    <script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.core.js"></script>
    <script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.slider.js"></script>
    <link type="text/css" href="http://jqueryui.com/latest/themes/base/ui.all.css" rel="stylesheet" />

    <script language="javascript">
        $(document).ready(function(){
            $("#slider").slider()
        });
    </script>
</head>
<body>
    <div class="toolbar">
        <h1 id="pageTitle"></h1>
        <a id="backButton" class="button" href="#"></a>
    </div>
    <ul title="slider test" selected="true">

        <li class="group">Page 1</li>       
        <li>
            <a class="mainnav" href="#page2">page 2</a>
        </li>
</ul>
    <div id="page2" title="foo.inc">
        <div id="slide_container">
            <div id="slider"></div>
        </div>
    </div>
</body>
+3
source share
2 answers

iui, :

, - ( ). , , , ; "_mouseCapture" "_mouseDrag". _mouseDrag "_slide", "_normValueFromMouse". "_mouseCapture", (, , jQuery), , , , .

_mouseDrag, _normValueFromMouse, , , _mouseCapture ( , ), -, iui . , iui , /jQuery, , jQuery , iui.

, jQuery UI "goSomewhere", _mouseDrag. , - (iui) "goSomewhere", _mouseDrag.

, , , iPhone. , .

, .

+2

. - , iui "addEventListener", . '#', . , , , , .

+1

Source: https://habr.com/ru/post/1716298/


All Articles