This is a migrated thread and some comments may be shown as answers.

data-zoom

3 Answers 136 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mat-Moo
Top achievements
Rank 1
Mat-Moo asked on 17 Jan 2013, 05:39 PM
I've got a view with data-zoom="true" and an image in it for pinch and zoom... however I'd like to add a legend which I don't want zooming. is it possible to do that?

3 Answers, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 18 Jan 2013, 10:11 AM
Hello,

You can achieve this by having the legend outside of the view (in your html) and adding it to the view once it's shown.

I've maid a sample for you - create a kendo project in Icenium and simply replace the body of the page with the following:

<body>
    <div id="view" data-role="view" data-title="Photo viewer" data-zoom="true" data-show="onViewShown">
        <header data-role="header">
            <div data-role="navbar">
                <span data-role="view-title"></span>
                <a data-align="right" data-role="button" class="nav-button" href="#index">Index</a>
            </div>
        </header>
 
        <div data-role="content">
            <img src="http://demos.kendoui.com/content/mobile/shared/faces.jpg" style="display: block" />
        </div>
    </div>
 
    <div id="legend">
        The contents of this mobile view are zoomable using pinch/zoom gestures. <br />
        To test this, open the Kendo UI demos on a mobile device, which supports multi-touch gestures.
    </div>
 
    <style scoped>
        #legend {
            position: absolute;
            width: 200px;
            bottom: 50px;
            left: 5px;
            padding: 20px;
            background: black;
            color: white;
            border: 2px solid white;
            -webkit-border-radius: 10px;
            -webkit-opacity: 0.5;
        }
    </style>
 
    <script>
        var app = new kendo.mobile.Application(document.body);
        function onViewShown() {
            // here we move the legend into the view
            $("#view .km-content").append("#legend");
        }
    </script>
</body>

I hope this is helpful for you.


Regards,
Nikolay Tsenkov
the Telerik team

Share feedback and vote for features on our Feedback Portal.
Want some Kendo UI online training - head over to Pluralsight.
0
Mat-Moo
Top achievements
Rank 1
answered on 19 Jan 2013, 10:21 PM
Thanks, ended up adding a legend button with a drop down from the menu :) Good reference material though for the future. Out of interest if I have an image map on a zoomable image, and add popups on click, will they be zoomed?
0
Nikolay Tsenkov
Telerik team
answered on 21 Jan 2013, 09:00 AM
Hello,

You are welcome.

About the popups - they shouldn't be zoomed.

Regards,
Nikolay Tsenkov
the Telerik team

Share feedback and vote for features on our Feedback Portal.
Want some Kendo UI online training - head over to Pluralsight.
Tags
General Discussions
Asked by
Mat-Moo
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Mat-Moo
Top achievements
Rank 1
Share this question
or