Your search did not match any results.
Popup

Scrolling

Documentation

To implement scrolling in the Popup widget, do the following:

  1. Wrap the content in the ScrollView widget and place it in the Popup container.

  2. Set the height and width of the ScrollView to 100% of the popup content area.

Copy to CodePen
Apply
Reset
$(function(){ $("#popup").dxPopup({ width: 550, height: 350, visible: true, showTitle: false, closeOnOutsideClick: false, contentTemplate: function (container) { var scrollView = $('<div />'); scrollView.append($('<img />', { src: '../../../../images/Popup-Scrolling-Image.jpg', class: 'center' })); scrollView.append($('<div id="textBlock" />').html(longText)); scrollView.dxScrollView({ width: '100%', height: '100%' }); return scrollView; } }); });
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>DevExtreme Demo</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script>window.jQuery || document.write(decodeURIComponent('%3Cscript src="js/jquery.min.js"%3E%3C/script%3E'))</script> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/20.1.3/css/dx.common.css" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/20.1.3/css/dx.light.css" /> <script src="https://cdn3.devexpress.com/jslib/20.1.3/js/dx.all.js"></script> <script src="data.js"></script> <link rel="stylesheet" type="text/css" href="styles.css" /> <script src="index.js"></script> </head> <body class="dx-viewport"> <div id="popup"></div> <div id="button"></div> </body> </html>
#textBlock { padding-left: 20px; padding-right: 20px; line-height: 1.6em; } .center { display: block; margin-left: auto; margin-right: auto; padding-top: 20px; width: 300px; }
var longText = "The <b>ScrollView</b> allows users to scroll its content vertically. To enable horizontal and vertical scrolling, set the <b>direction</b> option to <i>\"both\"</i>. Horizontal scrolling is available only if the content is wider than the <b>ScrollView</b>. Otherwise, the content adapts to the widget's width.<br/><br/>The <b>ScrollView</b> uses native scrolling on most platforms, except desktops. To use it on all platforms, assign <b>true</b> to the <b>useNative</b> option. If you assign <b>false</b>, scrolling is simulated on all platforms.";