UNPKG

jqwidgets-scripts-custom

Version:

jQWidgets is an advanced jQuery, Angular 7, Vue, React, ASP .NET MVC, Custom Elements and HTML5 UI framework.

48 lines (41 loc) 2.13 kB
<!DOCTYPE html> <html lang="en"> <head> <title id='Description'>Rating Custom Element DefaultFunctionality</title> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1 minimum-scale=1" /> <meta name="description" content="This is an example of the default functionalities in Custom Element Rating." /> <link rel="stylesheet" href="../../../jqwidgets/styles/jqx.base.css" type="text/css" /> <link rel="stylesheet" href="../../../styles/demos.css" type="text/css" /> <script type="text/javascript" src="../../../scripts/webcomponents-lite.min.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxcore.elements.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxrating.js"></script> <script type="text/javascript" src="../../../scripts/demos.js"></script> <script> JQXElements.settings['ratingSettings'] = { theme: 'classic' }; window.onload = function() { var myRating = document.querySelector('jqx-rating'); var myLog = document.querySelector('#rate'); myRating.addEventListener('change', function(event) { var rate = myLog.nativeElement; myLog.innerHTML = '<span> ' + event.value + '</span>'; }); }; </script> </head> <body> <div class="example-description"> The Custom element Rating control represents a widget that allows you to choose a rating. You can configure the rating item's size, image and the number of displayed items. </div> <div id='jqxWidget' style="font-size: 13px; font-family: Verdana;"> <jqx-rating settings="ratingSettings"></jqx-rating> <div style='margin-top:10px;'> <div style='float: left;'>Rating:</div> <div style='float: left;' id='rate'></div> </div> </div> </body> </html>