PDA

View Full Version : to the time of rotation of the slider 24 hour ( 1 day )



Chester_pro
03-27-2013, 04:23 PM
Hello,

I need help to change the rotation time of a slide. I'd put it on 24 hours.

I modify the following without success


// JavaScript Document


featuredcontentslider.init({
id: "slider1", //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: [" ", " "], //labels for "prev" and "next" links. Set to "" to hide.
revealtype: "click", //Behavior of pagination links to reveal the slides: "click" or "mouseover"
enablefade: [false, 0.2], //[true/false, fadedegree]
autorotate: [true, 86400000], //[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)
}
})

Beverleyh
03-27-2013, 04:37 PM
The Featured Content Slider is more suited to a shorter slide interval - 10 seconds or so, so a visitor can see content changing while they view the page.

For daily content you'd probably be looking for a script like this;
<?php

$wkday = date('D');

if ($wkday == 'Mon') {
echo 'Content for Monday';
}
else if ($wkday == 'Tue') {
echo 'Content for Tuesday';
}
else if ($wkday == 'Wed') {
echo 'Content for Wednesday';
}
else if ($wkday == 'Thu') {
echo 'Content for Thursday';
}
else if ($wkday == 'Fri') {
echo 'Content for Friday';
}
else if ($wkday == 'Sat') {
echo 'Content for Saturday';
}
else if ($wkday == 'Sun') {
echo 'Content for Sunday';
}

?>I'm not sure of a javascript equivalent though - I imagine that a javascript version would be unreliable as it would be based on the client-side clock.

jscheuer1
03-27-2013, 05:20 PM
Less reliable, yes. But there are two here on DD - By the day of the week:

http://www.dynamicdrive.com/dynamicindex17/dowiframe.htm

By the date of the month:

http://www.dynamicdrive.com/dynamicindex17/dowiframe2.htm

Chester_pro
03-28-2013, 02:29 PM
Thank you to me have been answered as quickly,

I forgot to mention that I'm using wordpress for my site . It seems to me that another file involved in the management of the slide.

How is it that I must proceed

Thank you very much for helping me

Chester_pro
04-13-2013, 07:26 PM
Thank Beverley !

thank you for the code, it works very well. But I wonder if it can be adapted for a whole month! thank you in advance .

Beverleyh
04-13-2013, 07:49 PM
It certainly can;
<?php

$month = date('m');

if ($month == '01') {
echo 'Content for Jan';
}
else if ($month == '02') {
echo 'Content for Feb';
}
else if ($month == '03') {
echo 'Content for Mar';
}
else if ($month == '04') {
echo 'Content for Apr';
}
else if ($month == '05') {
echo 'Content for May';
}
else if ($month == '06') {
echo 'Content for Jun';
}
else if ($month == '07') {
echo 'Content for Jul';
}
else if ($month == '08') {
echo 'Content for Aug';
}
else if ($month == '09') {
echo 'Content for Sep';
}
else if ($month == '10') {
echo 'Content for Oct';
}
else if ($month == '11') {
echo 'Content for Nov';
}
else if ($month == '12') {
echo 'Content for Dec';
}

?>

Beverleyh
04-13-2013, 07:56 PM
Or if you mean the days of the month rather than actual whole months;
<?php

$day = date('d');

if ($day == '01') {
echo 'Content for first day of month';
}
else if ($day == '02') {
echo 'Content for second day of month';
}
else if ($day == '03') {
echo 'Content for third day of month';
}
else if ($day == '04') {
echo 'Content for forth day of month';
}

// continue with else if statements...

else if ($day == '31') {
echo 'Content for thirty-first day of month';
}

?>

Chester_pro
04-14-2013, 11:35 AM
Thank Beverley !

big thank you again for your help.