Openui5 Carousel javascript örneği

Paylaş.

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv=”X-UA-Compatible” content=”IE=edge” />
<meta http-equiv=’Content-Type’ content=’text/html;charset=UTF-8’/>

<title>Carousel</title>

<script src=”https://sapui5.hana.ondemand.com/resources/sap-ui-core.js”
id=”sap-ui-bootstrap”
data-sap-ui-libs=”sap.m”

data-sap-ui-theme=”sap_belize”></script>

<script type=”text/javascript”>

var appCarousel = new sap.m.App(“myApp”, {initialPage:”carouselPage”});

var carouselPage = new sap.m.Page(“carouselPage”,
{title: “Carousel”,
enableScrolling: false }
);

var page1 = new sap.m.Page(“page1”,
{title: “Carousel Test Page 1”,
enableScrolling: false }
);

var page2 = new sap.m.Page(“page2”,
{title: “Carousel Test Page 2”,
enableScrolling: false }
);

var carousel = new sap.m.Carousel(“myCarousel”, {

activePage: page1,
loop: true,

pages: [page1, page2]
});

//Listen to ‘pageChanged’ events
carousel.attachPageChanged(function(oControlEvent) {
console.log(1);
console.log( “sap.m.Carousel: page changed: old: ” + oControlEvent.getParameters().oldActivePageId );
console.log(” new: ” + oControlEvent.getParameters().newActivePageId );
});

carouselPage.addContent(carousel);
appCarousel.addPage(carouselPage);
appCarousel.placeAt(“content”);

sap.ui.getCore().applyChanges();

</script>

</head>
<body class=”sapUiBody”>
<div id=”content”></div>
</body>
</html>

 

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)