PDA

View Full Version : audio in carousel



hemant1
20 Jul 2011, 2:28 AM
Hi,

Is it possible to add a audio tag in carousel object

here is my code



var obj;
var xmlDoc;
var x;
var main_content;
var total;
var index = 0;
var i = 10;
var page_count = 1;


demos.Carousel = new Ext.Carousel({
cls: 'cards',
id: 'carousel2',
layout: 'card',
direction: 'vertical',
defaults: {
flex: 1
},
items: [
{
html:'<iframe src="Slide0.htm" height="100%" width="100%" style="border:none"></iframe>'
},
{
html: '<iframe src="Slide1.htm" height="100%" width="100%" style="border:none"></iframe>'
},
{
html: '<iframe src="Slide2.htm" height="100%" width="100%" style="border:none"></iframe>'
},
{
html: '<iframe src="Slide3.htm" height="100%" width="100%" style="border:none"></iframe>'
},
{
html: '<iframe src="Slide4.htm" height="100%" width="100%" style="border:none"></iframe>'
},
{
html: '<iframe src="Slide5.htm" height="100%" width="100%" style="border:none"></iframe>'
},
{
html: '<iframe src="Slide6.htm" height="100%" width="100%" style="border:none"></iframe>'
},
{
html: '<iframe src="Slide7.htm" height="100%" width="100%" style="border:none"></iframe>'
},
{
html: '<iframe src="Slide8.htm" height="100%" width="100%" style="border:none"></iframe>'
},
{
html: '<iframe src="Slide9.htm" height="100%" width="100%" style="border:none"></iframe>'
}
],
dockedItems: [{
xtype: 'toolbar',
dock: 'bottom',
items: [{
ui: 'back',
text: 'Backward',
handler: function () {
var tmp1 = demos.Carousel.items.indexOf(demos.Carousel.layout.activeItem);
tmp1 = tmp1 - 1;
if (tmp1 < 0) {
alert('There is no Previous Page availabe');
}
else {
demos.Carousel.setActiveItem(tmp1);
}
}
}, {
text: 'Forward',
ui: 'forward',
handler: function () {
var tmp = demos.Carousel.items.indexOf(demos.Carousel.layout.activeItem);
tmp = tmp + 1;
if(tmp>=i)
{
alert('Next Page is Not available');
}
else
{
demos.Carousel.setActiveItem(tmp);
}
}
}, //{ xtype: 'spacer' },
{
text: 'Pages ' + page_count + '/ ' + i,
handler: function () {
}
},
{
xtype: 'sliderfield',
value: 0,
minValue: 0,
maxValue: 100,
width: 350,
trackWidth: 150
},
{
xtype: 'audio',
url : "0.mp3"
}
]
}],
listeners: {
cardswitch: function (container, newcard, oldcard, index) {
page_count = demos.Carousel.items.indexOf(demos.Carousel.layout.activeItem);
page_count = page_count + 1;
var tmp = page_count.toString();
var tmp1 = i.toString();
demos.Carousel.dockedItems.items[0].items.items[2].setText('Pages ' + page_count + '/ ' + i);
}
},
});