onSelect event
</> Source
<!DOCTYPE html>
<html>
<head>
<title>onSelect event</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<link rel="stylesheet" type="text/css" href="../../../codebase/fonts/font_roboto/roboto.css"/>
<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
<script src="../../../codebase/dhtmlx.js"></script>
<style>
div#carouselObj {
position: relative;
margin-top: 20px;
margin-left: 20px;
width: 350px;
height: 400px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
div#eLog {
position: relative;
width: auto;
height: 180px;
padding: 2px;
border: 1px solid #dfdfdf;
font-family: Roboto, Arial, Helvetica;
font-size: 14px;
color: #404040;
margin-left: 10px;
margin-top: 50px;
overflow: auto;
}
</style>
<script>
var myCarousel;
var eLog;
var eCount = 0;
function doOnLoad() {
myCarousel = new dhtmlXCarousel({
parent: "carouselObj",
item_width: 290,
item_height: 340,
offset_item: 45,
offset_left: 30,
offset_top: 15
});
eLog = document.getElementById("eLog");
myCarousel.attachEvent("onSelect", function(id){
logEvent("onSelect", id);
});
for (var q=1; q<=3; q++) {
var id = myCarousel.addCell("cell_"+q);
myCarousel.cells(id).attachURL("../common/test_pages/test_page_"+q+".html", true);
}
}
function logEvent(name, id) {
eLog.innerHTML = (++eCount)+") event fired: "+name+", id: "+id+"<br>"+eLog.innerHTML;
eLog.scrollTop = 0;
}
</script>
</head>
<body onload="doOnLoad();">
<div id="carouselObj"></div>
<div id="eLog"></div>
<div><br><br></div>
</body>
</html>
Documentation
Check documentation to learn how to use the components and easily implement them in your applications.