mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
bring the Demo's into master for testing & Automate the updates to gh-pages branch
This commit is contained in:
65
demos/expandable-widgets.html
Normal file
65
demos/expandable-widgets.html
Normal file
@ -0,0 +1,65 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Demo » Expandable widgets » gridster.js</title>
|
||||
<link rel="stylesheet" type="text/css" href="assets/css/demo.css">
|
||||
<link rel="stylesheet" type="text/css" href="../dist/jquery.gridster.min.css">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
|
||||
<script src="../dist/jquery.gridster.min.js" type="text/javascript" charset="utf-8"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>Expandable widgets</h1>
|
||||
|
||||
<p>Expand widgets when hover on them using <code>resize_widget</code> method.</p>
|
||||
|
||||
|
||||
<div class="gridster">
|
||||
<ul>
|
||||
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">0</li>
|
||||
<li data-row="1" data-col="2" data-sizex="1" data-sizey="1">1</li>
|
||||
<li data-row="1" data-col="3" data-sizex="1" data-sizey="1">2</li>
|
||||
<li data-row="1" data-col="4" data-sizex="1" data-sizey="1">3</li>
|
||||
<li data-row="2" data-col="1" data-sizex="1" data-sizey="1">4</li>
|
||||
<li data-row="2" data-col="2" data-sizex="1" data-sizey="1">5</li>
|
||||
<li data-row="2" data-col="3" data-sizex="1" data-sizey="1">6</li>
|
||||
<li data-row="2" data-col="4" data-sizex="1" data-sizey="1">7</li>
|
||||
<li data-row="3" data-col="1" data-sizex="1" data-sizey="1">8</li>
|
||||
<li data-row="3" data-col="2" data-sizex="1" data-sizey="1">9</li>
|
||||
<li data-row="3" data-col="3" data-sizex="1" data-sizey="1">10</li>
|
||||
<li data-row="3" data-col="4" data-sizex="1" data-sizey="1">11</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function getRandomInt (min, max) {
|
||||
return Math.floor(Math.random() * (max - min + 1)) + min;
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var gridster;
|
||||
|
||||
$(function () {
|
||||
|
||||
gridster = $(".gridster ul").gridster({
|
||||
widget_base_dimensions: [100, 100],
|
||||
widget_margins: [5, 5],
|
||||
helper: 'clone'
|
||||
}).data('gridster');
|
||||
|
||||
|
||||
// resize widgets on hover
|
||||
gridster.$el
|
||||
.on('mouseenter', '> li', function () {
|
||||
gridster.resize_widget($(this), 3, 3);
|
||||
})
|
||||
.on('mouseleave', '> li', function () {
|
||||
gridster.resize_widget($(this), 1, 1);
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user