PDA

View Full Version : Sliding stops when clicking on Image link inside the content slider



hemil_sheth
08-17-2011, 12:16 AM
1) Script Title: Featured Content Glider

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/featuredcontentglider.htm

3) Describe problem:
I have 2 div's which I want to rotate, inside this divs I have a tags which are linked to images. Something like this.


<div id="slider2">
<div id="Badge3a" class="contentdiv badge">
<a href="http://www.google.com" target="_blank">
<img src="images/img1.png" />
</a>
</div>
<div id="Badge3b" class="contentdiv badge">
<a href="http://www.yahoo.com/" target="_blank">
<img src="images/img2.png" />
</a>
</div>
</div>

<div id="paginate-slider2" class="pagination">
</div>
<script type="text/javascript">

featuredcontentslider.init({
id: "slider2", //id of main slider DIV
contentsource: ["inline", ""], // Valid values: ["inline", ""] or ["ajax", "path_to_file"]
toc: "#increment", //Valid values: "#increment", "markup", ["label1", "label2", etc]
nextprev: ["Previous", "Next"], //labels for "prev" and "next" links. Set to "" to hide.
enablefade: [true, 0.3], //[true/false, fadedegree]
autorotate: [true, 3000], //[true/false, pausetime]
onChange: function (previndex, curindex) { //event handler fired whenever script changes slide
//previndex holds index of last slide viewed b4 current (1=1st slide, 2nd=2nd etc)
//curindex holds index of currently shown slide (1=1st slide, 2nd=2nd etc)
}
})
</script>

Everything works fine, except when I click on the any 1 Image link in this slider, the sliding stops and doesnt resume.....
Is it something I am missing.

jscheuer1
08-17-2011, 07:38 AM
Do you mean the Featured Content Glider, or the Featured Content Slider?

Your post says Glider and links to the Glider script, but your code uses the function for the Slider, and the title of your post says Slider.

I'm going to assume you mean Slider for now.

Your question is still confusing because I can't tell if you mean the pagination links or content in the slider itself. Either way, that's the how the script is written. If you click on the pagination links or the content, it switches to manual mode.

If I'm right about which script you're using, and if you're talking about the clicks inside the content divisions, add this (highlighted) after your init:


<script type="text/javascript">

featuredcontentslider.init({
id: "slider2", //id of main slider DIV
contentsource: ["inline", ""], // Valid values: ["inline", ""] or ["ajax", "path_to_file"]
toc: "#increment", //Valid values: "#increment", "markup", ["label1", "label2", etc]
nextprev: ["Previous", "Next"], //labels for "prev" and "next" links. Set to "" to hide.
enablefade: [true, 0.3], //[true/false, fadedegree]
autorotate: [true, 3000], //[true/false, pausetime]
onChange: function (previndex, curindex) { //event handler fired whenever script changes slide
//previndex holds index of last slide viewed b4 current (1=1st slide, 2nd=2nd etc)
//curindex holds index of currently shown slide (1=1st slide, 2nd=2nd etc)
}
})
;document.getElementById('slider2').onclick = function(){};
</script>

If you're talking about something else, please be more specific. And if you want more help:

Please post a link to a page on your site that contains the problematic code so we can check it out.