Hey there, I'm trying to use a RadRotator to create functionality where whenever an image is clicked, an accompanying DIV is shown or hidden. This is a different DIV depending on the image which is clicked, and only one can be shown at a time. If the onclick javaScript event changes the style to 'block' I want the rotator to be paused, and only resume when the div is changed to 'none' style. This works fine for a couple seconds, however when I leave it for half a minute (to read the text in the div for example) and then click the image in the rotator it'll shoot over to another image (so the image will change on click) and the DIVs won't show or collapse. I am yet to find a pattern in the behaviour, but I feel like the rotator isn't fully paused but rather still going underwater - and we just can't see it.
I have added the code below, if you guys could tell me which function to use or what else to try that'd help immensely!
.aspx:
<div style="padding: 10px 10px 10px 10px;" id="ImageRotatorDiv">
<telerik:RadRotator OnClientLoad="onRotatorLoadHandler" runat="server" ID="ImageCarouselRotator" Name="CarouselRotator" Width="1000" Height="550" CssClass="rotatorStyle" Style="cursor: default; margin: 0 auto;" ItemWidth="1000" ItemHeight="550" RotatorType="SlideShow" ScrollDirection="Right" FrameDuration="3000" SlideShowAnimation-Duration="500" SlideShowAnimation-Type="Fade" PauseOnMouseOver="False">
<Items> //I add the images dynamically from a certain SiteFinity image folder
</Items>
</telerik:RadRotator>
</div>
//Example of one of the divs
<div class="hiddenDiv" id="DivShow1">
<h1>Diginissim</h1>
<p>In a mauris posuere, hendrerit nisi ut, rhoncus leo. Donec viverra mi ac ipsum placerat bibendum. Cras vel lacus nec augue laoreet maximus vel ac ex. Cras eu rhoncus dui, id iaculis risus. Aliquam consequat ex erat, sit amet consequat mi varius ac.</p>
<p>Integer luctus nunc ut porttitor dignissim. Pellentesque efficitur, nibh in euismod mattis, enim urna efficitur massa, id venenatis dui dui at ex.</p>
</div>
JavaScript:
function showHide(id) {
for (var divName in divNamesArray) { //gets all the (currently hidden) divs on the page
if (divNamesArray.hasOwnProperty(divName)) {
var div = document.getElementById(divNamesArray[divName]);
if (div === null || div === undefined) { //check
continue;
}
if (divNamesArray[divName] === id) { //each image gets the correct DIV name attached to it on load, this all works fine
if (div.style.display === 'none') {
div.style.display = 'block';
oRotator.pause(); //Wrong function?
} else {
div.style.display = 'none';
oRotator.resume();
}
}
}
}
}
I'm looking forward to hearing your ideas!