javascript-ej1-demos/tooltip/methods.html

227 строки
7.6 KiB
HTML

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Essential JS 1: Tooltip - Methods</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" charset="utf-8" />
<link href="../content/bootstrap.min.css" rel="stylesheet">
<link href="../content/ejthemes/default-theme/ej.web.all.min.css" rel="stylesheet" />
<link href="../content/default.css" rel="stylesheet" />
<link href="../content/default-responsive.css" rel="stylesheet" />
<link href="../content/bootstrap.min.css" rel="stylesheet" />
<!--[if lt IE 9]>
<script src="../scripts/jquery-1.11.3.min.js" type="text/javascript" ></script>
<![endif]-->
<!--[if IE 9]><!-->
<script src="../scripts/jquery-3.4.1.min.js" type="text/javascript"> </script>
<!--<![endif]-->
<script src="../scripts/ej.web.all.min.js" type="text/javascript"></script>
<script src="../scripts/properties.js" type="text/javascript"></script>
</head>
<body>
<div class="content-container-fluid">
<div class="row">
<div class="cols-sample-area">
<div class="frame">
<div class="ctrl">
<table>
<tr>
<td>
<div id="backBtn">
<button id="back">Back</button>
</div>
</td>
<td>
<input type="text" class="e-textbox" placeholder="Search for...">
</td>
<td>
<div id="goBtn">
<button id="go">Go</button>
</div>
</td>
<td>
<div id="reloadBtn">
<button id="reload">reload</button>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="sampleProperties">
<div class="prop-grid">
<div class="row">
<div class="col-md-6"> Target Element </div>
<div class="col-md-6">
<select id="refresh">
<option value="back">Back Button</option>
<option value="go">Go Button</option>
<option value="reload">Reload Button</option>
</select>
</div>
</div>
<div class="row">
<div class="col-md-6"> Disable\Enable </div>
<div class="col-md-6">
<input type="button" id="btnEnable" />
</div>
</div>
<div class="row">
<div class="col-md-6"> Show\Hide </div>
<div class="col-md-6">
<input type="button" id="hideButton" />
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var target, value, count = 0;
$("#sampleProperties").ejPropertiesPanel();
$(function () {
$("#temp").hide();
target = $("#reload").ejTooltip(
{
isBalloon: false,
content: "Reload current page",
position: {
target: {
horizontal: "center", vertical: "bottom"
},
stem: {
horizontal: "left", vertical: "top"
}
}
}).data("ejTooltip");
$("#go").ejTooltip(
{
content: "search",
position: {
target: {
horizontal: "center", vertical: "bottom"
},
stem: {
horizontal: "left", vertical: "top"
}
}
});
$("#back").ejTooltip(
{
content: "Go back one page",
position: {
target: {
horizontal: "center", vertical: "bottom"
},
stem: {
horizontal: "left", vertical: "top"
}
}
});
$("#back").ejButton({
width : "100%"
});
$("#go").ejButton({
width: "100%"
});
$("#reload").ejButton({
width: "100%",
contentType: "imageonly",
prefixIcon: "e-icon e-uiLight e-reload"
});
$("#refresh").ejDropDownList({
selectedIndex: 2,
width: "125px",
change: "onEffectChange"
});
$("#btnEnable").ejButton({
showRoundedCorner: true,
width: "107px",
click: "onEnableDisable",
text: "Disable",
enabled: false
});
$("#hideButton").ejButton({
showRoundedCorner: true,
width: "107px",
click: "onShowHide",
text: "Show",
});
});
function onEffectChange(args) {
var btnObj = $("#hideButton").data("ejButton");
target.show($("#" + args.value));
$('#hideButton').ejButton({ text: "Hide" });
}
function onEnableDisable(args) {
var text;
var btnObj = $("#hideButton").data("ejButton");
var DropDownListObj = $("#refresh").data("ejDropDownList");
if (args.model.text == "Disable") {
target.disable();
text = "Enable";
btnObj.disable();
DropDownListObj.disable();
}
else {
target.enable();
text = "Disable";
btnObj.enable();
DropDownListObj.enable();
}
$('#btnEnable').ejButton({ text: text });
}
function onShowHide(args) {
var text;
var DropDownListObj = $("#refresh").data("ejDropDownList");
var value = DropDownListObj.getSelectedValue();
enableBtn = $("#btnEnable").data("ejButton");
if (args.model.text == "Hide") {
target.hide();
text = "Show";
enableBtn.disable();
}
else {
target.show($("#" + value));
text = "Hide";
enableBtn.enable();
}
$('#hideButton').ejButton({ text: text });
}
</script>
<style>
.frame {
width: 100%;
height:250px;
box-sizing: border-box;
}
.ctrl{
margin-top: 80px;
}
table{
width: 100%;
}
.material input{
width: 100%;
height: 36px;
}
.office-365 input{
width: 100%;
}
</style>
</body>
</html>