Log in

View Full Version : slideshow fade out/fade in



kpk1l
02-14-2013, 07:21 PM
hi:D
I want a slideshow that disappear for 30 seconds and then reappear
can you help me please
thx

Beverleyh
02-14-2013, 07:54 PM
Can you explain more please?

What kind of slideshow? Have you seen an example to show us? Do you want the images to hide/show every 30 seconds or the whole slideshow interface (Although why you'd want that seems a bit unlikely but there you go)?

Please provide more information, and any script/slideshows you're working with or have seen already - if a slideshow uses jQuery you could probably use a hide/delay/show function similar to this: http://stackoverflow.com/questions/4508644/how-can-i-use-delay-with-show-and-hide-in-jquery

kpk1l
02-14-2013, 08:03 PM
i use a slideshow at animationddd.ucoz.net (my website)
i want to hide/show every 20-30 sec the whole slideshow interface
it is possible?

jscheuer1
02-15-2013, 01:44 AM
Put this in the head of the page after the external script tag for jQuery:


<script type="text/javascript">
jQuery(window).load(function(){
var $ = jQuery, secs = 25, $slider = $('.slider'), dir = 'Up';
function showhideslider(){
dir === 'Down' && $slider.parent()['slide' + dir]();
$slider.animate({opacity: dir === 'Up'? 0 : 1}, 'slow', function(){
dir === 'Up' && $slider.parent()['slide' + dir]();
dir = dir === 'Up'? 'Down' : 'Up';
setTimeout(showhideslider, secs * 1000);
});
}
setTimeout(showhideslider, secs * 1000);
});
</script>

kpk1l
02-15-2013, 07:54 AM
thanks a lot John :D

kpk1l
02-15-2013, 08:08 AM
one more question... if i have slider1 and slider2 and i want to see slider1 for 25sec then slider2 for 25 sec...again slider1...etc....
can i change something in this code?

kpk1l
02-15-2013, 08:19 AM
with class .slider for slider1 and .slider2 for slider2

jscheuer1
02-15-2013, 04:20 PM
It would help me to help you if you setup the page with two sliders, both visible at all times (that means without the script code we just worked out), in the spot or spots on the page where you want them to be. This can be a separate temporary page if you like. I probably need to access the second one's parent element by its class or id selector and might (depending upon where they are and the answers to the two below questions) need to do the same with the first one's parent, and/or wrap them both in yet another container, either via jQuery, or more likely by adding some hard coded markup to the page.

To make it clearer for me about this, please put up the requested demo page and answer these two questions:


On the current page with one slider, when it appears the layout shifts in a smooth sliding motion and then the show fades in, when it disappears it fades out then shifts the layout in a smooth sliding motion. With the new setup, are both sliders supposed to occupy the same layout space on the page with no shift in the layout, or are they to be in separate positions with the layout shifting in each of those spots to show/hide that slider?


If they are to occupy the same layout space, they could still smoothly slide into and out of that space, which could physically close and open, or could remain a constant size while the shows slide into and out of it, or could be a constand size with fade in/out only, no sliding. Would it be better to:


a.) have that space expand and contract as the shows change, or

b.) have a constant size and have them each slide into and out of that space, or

c.) simply fade in and out of, rather than also slide into that space?

kpk1l
02-15-2013, 05:08 PM
As you noticed I use the ucoz paltform.
I have 2 modules that I use: one for TV Show(/load) and another for Movies(/publ)
Ucoz don't let me to get, in one slideshow, entries from both modules. So I'm wondering if I can do another slide for second module (in same layout space at the first)
First slide (that i use now) use class .slider
I thought to copy the same class but to call it .slider2 (to be easier to use via jQuery)(I don't have another idea :confused:)

To answer to your question -
they are to occupy the same layout space, they could remain a constant size while the shows slide into and out of it, or could be a constand size with fade in/out only,
I want to try both effects(slide and fade) to see which fits better.

Sorry if I bother you too much.

jscheuer1
02-15-2013, 09:03 PM
No bother. The amount of work I have to do is less the more information I have before I start.

So, it's slide in and fade in into a single space in the layout whose height doesn't change. If you can make the other slideshow and have it work on the page, we can do that.

If you would just setup a page like that with the two slideshows on it and everything (or at least most of everything) else just as you want it to be. Do not use the javascript code I gave you. Put the two slideshows one after the other on the page in the spot where you want them to be - so it ends up being twice as high as you want it and they're both seen all of the time. Let me worry about hiding one to begin with and setting up the code for alternating between them. Do that and I should be able to work it out pretty quickly.

kpk1l
02-15-2013, 09:52 PM
thanks for understanding me :D
i activate the second slider,
if you could do something with this, I would greatly appreciate
if not, tell me what to do
you can choose between slide or fade effect. or one of them , or both. which would look better

i let the same class for slider2 as for slider1, because if i use a copy of .slider i see only first post of it over first slider
(sorry for my english :D)

kpk1l
02-17-2013, 12:22 PM
jscheuer1, it's possible to do something in ucoz system , or not ..because that modules?

jscheuer1
02-17-2013, 03:12 PM
I'm not sure. If we can find where the slider is initialized, we can probably make a second independent one on the page. Or I can study the structure of the generated HTML of the slider. If it lends itself to substitution, we can create two unseen mirrors of that part of it that contains the content. One of these mirrors would be identical, the other we could populate with the content for the second slider and switch those mirrors in and out of the visible slider. If all else fails we should be able to use a different slider and make two of those. In order to figure all that out I will need some time. I have some, but it might require more than I have at the moment. I will get back to you when I have an answer.

kpk1l
02-17-2013, 03:38 PM
can i help you somehow? you need the structure of page with codes or.. i don't know...

kpk1l
02-17-2013, 03:53 PM
code from css:


/* tooltip */

#easyTooltip {
padding:4px;
border: 1px solid #c7c7c7;
/*background:#f1f1f1;*/
background: #ffffff;
border-radius: 6px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
color: #666666;
filter:alpha(opacity=90);
-moz-opacity: 0.9;
-khtml-opacity: 0.9;
opacity: 0.9;
}



.slider {position: absolute;top: 4px; left:4px;width: 980px;}
.slider-item {}
.slider-item-small {width: 355px;height: 73px;background: #2d5a86;overflow: hidden;position: absolute;right: 0;}
.slider-item-small a {display: block;padding: 5px 10px 5px 5px;color: #b1b1b1;text-decoration: none;}
.slider-item-small img {height: 61px;border: 1px #404040 solid;float: left;margin: 0 10px 0 0;}
.slider-item-small a:hover {}
.slider-item-big {display: none;position: absolute;left: 12px;top: 12px;width: 607px;height: 298px;overflow: hidden;}
.slider-item-big img {border: 1px solid #2d5a86;}
.slider-item-big h2 {background: url(../images/transparent-bg.png);position: absolute;bottom: 3px;left: 0px;width: 587px;padding: 12px 10px 12px 10px;color: #fff;line-height: 17px;font-size: 11px;}
.slider-item-big h2 a {color: #fff;}
.slider-item-big-link {background: url(http://animationddd.ucoz.net/images/slider-item-big-link.png) left top no-repeat;display: block;
width: 135px;height: 32px;text-decoration: none;line-height: 32px;color: #2f2f2f;text-align: center;position: absolute;left: 465px;font-weight: bold;}

.slider-item-big-link:hover {background: url(http://animationddd.ucoz.net/images/slider-item-big-link.png) left bottom no-repeat;color: #fff;}
.slider-item-active .slider-item-small {background: #2a5379;}
.slider-item-active .slider-item-small img {border: 1px #fbf6e2 solid;}


and the code from informer: (about informers http://forum.ucoz.com/forum/37-457-1)


<!-- Slider item -->
<div class="slider-item">
<div class="slider-item-small">
<a href="$ENTRY_URL$">
<img src="$IMG_URL1$" width="91" height="61" alt="$TITLE$" />
<br><div align="center"><font size="3">$TITLE$</font></div>
</a>
</div>
<div class="slider-item-big">
<img src="$IMG_URL1$" width="607" height="294" alt="$TITLE$" />
<h2>$TITLE$</h2>

</div>
</div>


the code take image (IMG_URL) from last 4 entries from module File Catalog
structure of informer:
[File Catalog · Entries · Entry date D · Entries: 4 · Columns: 1 · Title length: 90 ]


and this is the code form top part of the website:


<div class="cm-bg">
<div class="slider">$MYINF_1$</div>
</div>


$MYINF_1$ is the code of informer

the second informer code (for slider 2 from another module) is $MYINF_17$

jscheuer1
02-17-2013, 07:39 PM
No, none of that really helps. I've seen all of that already more or less either directly or from the code it produces. What I'm looking for is javascript something like so:


$(.'slider).slide(maybe some stuff here)

The $ might be jQuery or some other variable representing jQuery instead, the .slide is probably .somethingelse, and even the ('.slider') might be expressed as a variable, so it could be very hard to find. In fact it is very hard to find because I'm good at finding stuff like that and I can't find it. At least not yet and I've looked everywhere I can think of for it. I'm like 99% sure it's there somewhere in some form because the slider appears to use jQuery. But I have another idea where we don't need to find it - to put a second slider up there that doesn't get run because it's not inside a class="slider" div, and is not seen because we make it not seen. We can then take its contents and swap it in and out of the working slider. As long as all of the dimensions as well as the number of items are the same as the working slider (they were when I looked at it before), it should be fine.

But I see you took down the second slider. What might help me is if you put it back up, but make it slightly different, it was:


<div class="slider"><!-- Slider item --> <div class="slider-item"> <div class="slider-item-small"> <a href="/publ/genre/adventure/hotel_transylvania_2012/5-1-0-30"> <img src="http://animationddd.ucoz.net/_pu/0/80058646.png" width="91" height="61" alt="Hotel Transylvania (2012)" /> <br><div align="center"><font size="3">Hotel Transylvania (2012)</font></div> </a> </div> <div class="slider-item-big"> <img src="http://animationddd.ucoz.net/_pu/0/80058646.png" width="607" height="294" alt="Hotel Transylvania (2012)" /> <h2>Hotel Transylvania (2012)</h2> </div> </div><!-- Slider item --> <div class="slider-item"> <div class="slider-item-small"> <a href="/publ/genre/action/brave_2012/3-1-0-29"> <img src="http://animationddd.ucoz.net/_pu/0/49804586.jpg" width="91" height="61" alt="Brave (2012)" /> <br><div align="center"><font size="3">Brave (2012)</font></div> </a> </div> <div class="slider-item-big"> <img src="http://animationddd.ucoz.net/_pu/0/49804586.jpg" width="607" height="294" alt="Brave (2012)" /> <h2>Brave (2012)</h2> </div> </div><!-- Slider item --> <div class="slider-item"> <div class="slider-item-small"> <a href="/publ/genre/short_film/day_night_2010/2-1-0-28"> <img src="http://animationddd.ucoz.net/_pu/0/46489362.png" width="91" height="61" alt="Day & Night (2010)" /> <br><div align="center"><font size="3">Day & Night (2010)</font></div> </a> </div> <div class="slider-item-big"> <img src="http://animationddd.ucoz.net/_pu/0/46489362.png" width="607" height="294" alt="Day & Night (2010)" /> <h2>Day & Night (2010)</h2> </div> </div><!-- Slider item --> <div class="slider-item"> <div class="slider-item-small"> <a href="/publ/genre/comedy/partly_cloudy_2009/4-1-0-27"> <img src="http://animationddd.ucoz.net/_pu/0/02610359.png" width="91" height="61" alt="Partly Cloudy (2009)" /> <br><div align="center"><font size="3">Partly Cloudy (2009)</font></div> </a> </div> <div class="slider-item-big"> <img src="http://animationddd.ucoz.net/_pu/0/02610359.png" width="607" height="294" alt="Partly Cloudy (2009)" /> <h2>Partly Cloudy (2009)</h2> </div> </div></div>

At least that's the HTML code that was generated for it. Bring that back, but make the beginning like so (additions/changes highlighted):


<div class="slider2" style="position:absolute; visibility:hidden;">><!-- Slider item --> <div class="slider-item"> <div class="slider-item-small"> <a href="/publ/genre/adventure/hotel_transylvania_2012/5-1-0-30"> <img src="http://animationddd.ucoz.net/_pu/0/80058646.png" width="91" height="61" alt="Hotel Transylvania (2012)" /> <br><div ali . . .

And then I can try working with it. Ordinarily I would create a mock up on my local server. But I've tried that already and it won't load. There are one or more things on that page that apparently require it to be on the server that it is on.

But, if you can put that markup back with the slight change I'm asking for, I should be able to manipulate it via javascript from the console. If I can get it to do what we want from there, I can translate that into an on page script. That's how I did it the first time.

kpk1l
02-17-2013, 07:59 PM
slider2 was a copy of .slider class (class post above)


if this don't work...can you give another slideshow to use with that informer. instead of my actual slideshow

jscheuer1
02-17-2013, 08:16 PM
No. It wasn't a copy, it had different images and text inside of it, and it wasn't calss="slider2" it was class="slider". I'm asking you to bring it back with class="slider2" and the added style I mentioned. Can you do that? If you do, it shouldn't be visible at all, and the current class="slider" should work just as it has been. What it will do if that happens is give me something to work with to help you. If you cannot do it, then I don't think there's anything I can do for you. Except I think that even if you can only do what you had before and can add some javascript right after the second class="slider" we might still be able to make that work.

With the way it is now though, there's nothing I can do with it. Well, that's not true I can inject the HTML code and see if I can work with it from there. But that won't be of much use to you if you cannot generate it. The best way to do so would be how I just asked. If you can only do it the way you did it before though, you can put this script right after it:


<script type="text/javascript">
jQuery('.slider').eq(1).removeClass('slider').addClass('slider2').css({position: 'absolute', visibility: 'hidden'});
</script>

That should give me enough to work with.

kpk1l
02-17-2013, 08:44 PM
I bring it back with class="slider2" and style before you answer. And now I put the script right after it. :)

jscheuer1
02-17-2013, 10:04 PM
Since you put in the class="slider2" and the style, you don't need the script. But it's not hurting anything.

I can work with that. I should know by tomorrow if there's anything that can be done with it.

At least it doesn't look bad for now - Gives me time to work on it.

kpk1l
02-17-2013, 11:12 PM
ok. thanks.

jscheuer1
02-18-2013, 06:38 PM
Put this code in the head of the page after the external tag for jQuery:


<script type="text/javascript">
jQuery(window).load(function(){
var $ = jQuery, secs = 28, $slider1 = $('.slider'), $slider2 = $('.slider2'), $stored1 = $('<div></div>'),
$firstset = $('.slider .slider-item-small'), $wrap = $('<div></div>'), shownum = 0, functions = [
function(){ // #0
$slider1.children().appendTo($stored1);
$slider1.append($slider2.children());
functions[3]();
},
function(){ // #1
$slider1.children().appendTo($slider2);
$stored1.children().appendTo($slider1);
functions[3]();
},
function(){ // #2
$slider1.animate({opacity: 1}, 550);
shownum = (++shownum) % 2;
setTimeout(switchsliders, secs * 1000);
},
function(){ // #3
steps = 0;
$slider1.css({opacity: 0});
$parent.slideDown({duration: 800, step: functions[4], complete: functions[2]});
},
function(){ // #4
++steps === 2 && $slider1.find('.slider-item-small').eq(0).trigger('mouseenter');
$slider1.css({opacity: ($parent.height() / parentheight) * 0.55});
},
function(){ // #5
$slider1.css({opacity: ($parent.height() / parentheight) * 0.7});
}
], $parent = $slider1.parent(), parentheight = $parent.height(), steps, begintimer;
$parent.wrap($wrap.css({height: $parent.outerHeight(), width: $parent.outerWidth()}));
$('.slider2 .slider-item-small').each(function(i, el){
el.style.top = $firstset.eq(i).css('top');
});
function switchsliders(){
$parent.slideUp({duration: 800, step: functions[5], complete: function(){setTimeout(functions[shownum], 200);}});
}
begintimer = setInterval(function(){
if($slider1.children().eq(3).hasClass('slider-item-active')){
clearInterval(begintimer);
setTimeout(switchsliders, 6000);
}
}, 20);
});
</script>

Unfortunately it won't be easy to separate sliding up and down from fading in and out because in order to get them to work together, opacity changes had to be part of each step of the sliding up and down process.

I did make an earlier version that only fades in and out. It would need a little tweaking perhaps as a result of what I've learned combining that with the sliding, but here is the fade only version:


<script type="text/javascript">
jQuery(window).load(function(){
var $ = jQuery, secs = 30, $slider1 = $('.slider'), $slider2 = $('.slider2'), $stored1 = $('<div></div>'),
$firstset = $('.slider .slider-item-small'), shownum = 0, total = 2, functions = [
function(){
$slider1.children().appendTo($stored1);
$slider1.append($('.slider2').children());
$slider1.find('.slider-item-small').eq(0).trigger('mouseenter');
},
function(){
$slider1.children().appendTo('.slider2');
$stored1.children().appendTo($slider1);
$slider1.find('.slider-item-small').eq(0).trigger('mouseenter');
},
function(){
shownum = (++shownum) % 2;
setTimeout(switchsliders, secs * 1000);
}
];
$('.slider2 .slider-item-small').each(function(i, el){
el.style.top = $firstset.eq(i).css('top');
});
function switchsliders(){
$slider1.animate({opacity: 0}, 'slow', functions[shownum])
.delay(500).animate({opacity: 1}, 'slow', functions[2]);
}
setTimeout(switchsliders, secs * 1000);
});
</script>

One thing I added in the combined version is that instead of waiting for the configured seconds (secs variable) to start, it listens to the first slider to see when it has reached the last slide. I'm not sure if this will be better or worse than waiting for the configured secs before beginning. In most cases it will be better. It all depends upon where the slider is when the page signals that it has loaded. It has a 3 in 4, a 75% chance of being in a good spot with the listener, only 25% with the configured timer. In either approach, once the first change has passed, it goes over to the configured timer, which I made a little longer to allow people to see the last slide for more than a second before it switches back to the other slider.

Any questions about any of this, let me know.

The browser cache may need to be cleared and/or the page refreshed to see changes.

kpk1l
02-18-2013, 08:34 PM
i put first code here : animationddd.ucoz.net/
and i make another site. and i put second code : tpm.ucoz.net/

i like first...with slide effects..but the entries of the second slide are behind of entries from first slide
if you can bring the entries from first slide when it's playing...over second slide...and set position..


if you think that slide effect don't work with sliders, you can remove it, or change with fade

jscheuer1
02-18-2013, 08:43 PM
You took away the styles:


<div class="slider2" style="position: absolute; visibility: hidden;">

I never told you to take away those styles. If you put them back things will work much better.

I'm also thinking that document ready might work better than window load. Let's get it working right first before experimenting.

kpk1l
02-18-2013, 09:34 PM
i try with it..but second slider don't show. I thought that's the problem and i try without it.
now i see that at animationddd.ucoz.net/ that the first code with slide works! :D .. I can't figure out why it works now :confused:
but second code don't working - tpm.ucoz.net/

jscheuer1
02-18-2013, 10:20 PM
I left out a trailing }); from the second script. I just went back and fixed it.

Here's a version of the first one that uses document ready. It might be better because it should detect the first loop of the first slider even when the page takes a while to load as sometimes happens I noticed when working on it. However, other information it might need might not be available yet. It's worth a try:


<script type="text/javascript">
jQuery(function($){ // document ready
var secs = 28, $slider1 = $('.slider'), $slider2 = $('.slider2'), $stored1 = $('<div></div>'),
$firstset = $('.slider .slider-item-small'), $wrap = $('<div></div>'), shownum = 0, functions = [
function(){ // #0
$slider1.children().appendTo($stored1);
$slider1.append($slider2.children());
functions[3]();
},
function(){ // #1
$slider1.children().appendTo($slider2);
$stored1.children().appendTo($slider1);
functions[3]();
},
function(){ // #2
$slider1.animate({opacity: 1}, 550);
shownum = (++shownum) % 2;
setTimeout(switchsliders, secs * 1000);
},
function(){ // #3
steps = 0;
$slider1.css({opacity: 0});
$parent.slideDown({duration: 800, step: functions[4], complete: functions[2]});
},
function(){ // #4
++steps === 2 && $slider1.find('.slider-item-small').eq(0).trigger('mouseenter');
$slider1.css({opacity: ($parent.height() / parentheight) * 0.55});
},
function(){ // #5
$slider1.css({opacity: ($parent.height() / parentheight) * 0.7});
}
], $parent = $slider1.parent(), parentheight = $parent.height(), steps, begintimer;
$parent.wrap($wrap.css({height: $parent.outerHeight(), width: $parent.outerWidth()}));
$('.slider2 .slider-item-small').each(function(i, el){
el.style.top = $firstset.eq(i).css('top');
});
function switchsliders(){
$parent.slideUp({duration: 800, step: functions[5], complete: function(){setTimeout(functions[shownum], 200);}});
}
begintimer = setInterval(function(){
if($slider1.children().eq(3).hasClass('slider-item-active')){
clearInterval(begintimer);
setTimeout(switchsliders, 6000);
}
}, 20);
});
</script>

kpk1l
02-18-2013, 10:31 PM
thankyou! i have a question: it's possible to hide that script form you? and no one can see it from source from example

the last code that you give it to me move position of entries from slider 2
animationddd.ucoz.net/

I'll use the second code. i like it :D with that fade effect. thankyou for all help.
if it's possible to hide that script from source page..it's great! :p

jscheuer1
02-19-2013, 05:01 AM
thankyou! i have a question: it's possible to hide that script form you? and no one can see it from source from example

You can make any script external in the usual manner.


the last code that you give it to me move position of entries from slider 2
animationddd.ucoz.net/

I see that. I was worried something like that might happen, but I like the way it responds to the slider when it reaches the end of the first set of slides the first time regardless of how long it takes to load the page. Try this variation:


<script type="text/javascript">
jQuery(function($){ // document ready
var secs = 28, $slider1 = $('.slider'), $slider2 = $('.slider2'), $stored1 = $('<div></div>'),
$firstset = $('.slider .slider-item-small'), $wrap = $('<div></div>'), shownum = 0, functions = [
function(){ // #0
$slider1.children().appendTo($stored1);
$slider1.append($slider2.children());
functions[3]();
},
function(){ // #1
$slider1.children().appendTo($slider2);
$stored1.children().appendTo($slider1);
functions[3]();
},
function(){ // #2
$slider1.animate({opacity: 1}, 550);
shownum = (++shownum) % 2;
setTimeout(switchsliders, secs * 1000);
},
function(){ // #3
steps = 0;
$slider1.css({opacity: 0});
$parent.slideDown({duration: 800, step: functions[4], complete: functions[2]});
},
function(){ // #4
++steps === 2 && $slider1.find('.slider-item-small').eq(0).trigger('mouseenter');
$slider1.css({opacity: ($parent.height() / parentheight) * 0.55});
},
function(){ // #5
$slider1.css({opacity: ($parent.height() / parentheight) * 0.7});
}
], $parent = $slider1.parent(), parentheight, steps, begintimer;
function switchsliders(){
$parent.slideUp({duration: 800, step: functions[5], complete: function(){setTimeout(functions[shownum], 200);}});
}
begintimer = setInterval(function(){
if($slider1.children().eq(3).hasClass('slider-item-active')){
clearInterval(begintimer);
parentheight = $parent.height();
$parent.wrap($wrap.css({height: $parent.outerHeight(), width: $parent.outerWidth()}));
$('.slider2 .slider-item-small').each(function(i, el){
el.style.top = $firstset.eq(i).css('top');
});
setTimeout(switchsliders, 6000);
}
}, 20);
});
</script>


I'll use the second code. i like it :D with that fade effect. thankyou for all help.
if it's possible to hide that script from source page..it's great! :p

Like I said above, you can make any script external in the usual manner, if that's what you mean. Just take the code of the script without the script tags. Using a text only editor like NotePad, save that to a file. Call it something that will help you remember what it is, like for this it could be sliderswitch.js - save it as that. So, for the one you say you like, take only its code:


jQuery(window).load(function(){
var $ = jQuery, secs = 30, $slider1 = $('.slider'), $slider2 = $('.slider2'), $stored1 = $('<div></div>'),
$firstset = $('.slider .slider-item-small'), shownum = 0, total = 2, functions = [
function(){
$slider1.children().appendTo($stored1);
$slider1.append($('.slider2').children());
$slider1.find('.slider-item-small').eq(0).trigger('mouseenter');
},
function(){
$slider1.children().appendTo('.slider2');
$stored1.children().appendTo($slider1);
$slider1.find('.slider-item-small').eq(0).trigger('mouseenter');
},
function(){
shownum = (++shownum) % 2;
setTimeout(switchsliders, secs * 1000);
}
];
$('.slider2 .slider-item-small').each(function(i, el){
el.style.top = $firstset.eq(i).css('top');
});
function switchsliders(){
$slider1.animate({opacity: 0}, 'slow', functions[shownum])
.delay(500).animate({opacity: 1}, 'slow', functions[2]);
}
setTimeout(switchsliders, secs * 1000);
});

Upload that new file (sliderswitch.js) to the same folder as the page. On the page where the script is, replace it with:


<script type="text/javascript" src="sliderswitch.js"></script>

That one can be improved though given what we are learning about the first one. Let me know how things work when you try the code at the top of this post. Depending upon how that goes, I will have an update for the one you say you like. I will either add just the timing mechanism for completion of the first set of slides, or that plus keying off of document ready, if the change at the top of this post fixes the positioning problem (or if it doesn't, if I can figure out some other way to fix that for document ready).

kpk1l
02-19-2013, 05:30 PM
first code that you give it to me , with slide effect, you can see it here: tpm.ucoz.net/--now it works :D
and second code , with fade effect: nimationddd.ucoz.net/ --it looks great! ;)
i like it more. i like how you can see the fade effect from slider1 to slider2.

thankyou very much and sorry that i will use only this fade effect, since you have worked hard at the first code with slide effect


++
I will have an update for the one you say you like. I will either add just the timing mechanism for completion of the first set of slides,
can i change the time of occurrence of entry? now takes about 8 sec./entry. i want it to 4-5 maybe

jscheuer1
02-19-2013, 05:45 PM
In that case, use:


<script type="text/javascript">
// Custom Switch Slider Script (c)2013 John Davenport Scheuer
// as first seen in http://www.dynamicdrive.com/forums/
// username: jscheuer1 - This Notice Must Remain for Legal Use
jQuery(function($){
var secs = 30, $slider1 = $('.slider'), $slider2 = $('.slider2'), $stored1 = $('<div></div>'),
$firstset = $('.slider .slider-item-small'), shownum = 0, begintimer, functions = [
function(){
$slider1.children().appendTo($stored1);
$slider1.append($('.slider2').children());
$slider1.find('.slider-item-small').eq(0).trigger('mouseenter');
},
function(){
$slider1.children().appendTo('.slider2');
$stored1.children().appendTo($slider1);
$slider1.find('.slider-item-small').eq(0).trigger('mouseenter');
},
function(){
shownum = (++shownum) % 2;
setTimeout(switchsliders, secs * 1000);
}
];
function switchsliders(){
$slider1.animate({opacity: 0}, 'slow', functions[shownum])
.delay(500).animate({opacity: 1}, 'slow', functions[2]);
}
begintimer = setInterval(function(){
if($slider1.children().eq(3).hasClass('slider-item-active')){
clearInterval(begintimer);
$('.slider2 .slider-item-small').each(function(i, el){
el.style.top = $firstset.eq(i).css('top');
});
setTimeout(switchsliders, 6000);
}
}, 20);
});
</script>

Please keep the credit notice. You can still make it external if you want to hide it, I can even minify it for you if you like. That won't save many bytes, but will make it harder to copy.

The sliding one fades, it's just a little harder to notice because it's also sliding as it's fading. But you can notice it. You would also notice if it didn't fade. On the page you're using it on now, there's a gray background that shows through when it slides. That color can be changed.

kpk1l
02-19-2013, 05:53 PM
i will hide it. it's good right that! :D thanks.


The sliding one fades, it's just a little harder to notice because it's also sliding as it's fading. But you can notice it. You would also notice if it didn't fade. On the page you're using it on now, there's a gray background that shows through when it slides. That color can be changed.
i see it now :D
that website it's for test only. however on the principal site it's look different 'cause of blue background

kpk1l
02-19-2013, 06:32 PM
i hide it with js but time /entry remain 8 sec..why? before was 6-7. it's possible to 4sec/entry?

i put that in js


// Custom Switch Slider Script (c)2013 John Davenport Scheuer
// as first seen in http://www.dynamicdrive.com/forums/
// username: jscheuer1 - This Notice Must Remain for Legal Use
jQuery(function($){
var secs = 30, $slider1 = $('.slider'), $slider2 = $('.slider2'), $stored1 = $('<div></div>'),
$firstset = $('.slider .slider-item-small'), shownum = 0, begintimer, functions = [
function(){
$slider1.children().appendTo($stored1);
$slider1.append($('.slider2').children());
$slider1.find('.slider-item-small').eq(0).trigger('mouseenter');
},
function(){
$slider1.children().appendTo('.slider2');
$stored1.children().appendTo($slider1);
$slider1.find('.slider-item-small').eq(0).trigger('mouseenter');
},
function(){
shownum = (++shownum) % 2;
setTimeout(switchsliders, secs * 1000);
}
];
function switchsliders(){
$slider1.animate({opacity: 0}, 'slow', functions[shownum])
.delay(500).animate({opacity: 1}, 'slow', functions[2]);
}
begintimer = setInterval(function(){
if($slider1.children().eq(3).hasClass('slider-item-active')){
clearInterval(begintimer);
$('.slider2 .slider-item-small').each(function(i, el){
el.style.top = $firstset.eq(i).css('top');
});
setTimeout(switchsliders, 6000);
}
}, 20);
});

jscheuer1
02-19-2013, 06:33 PM
Here's the minified version (right click and 'Save As'):

4945

Then you upload it to the same folder as your page and put this on the page where the script is now:


<script type="text/javascript" src="sliderswitch.min.js"></script>

I can't test the minified version, so if there are any problems, let me know, I'm sure they will be easy to fix.

kpk1l
02-19-2013, 07:23 PM
i put it. i think i let it how it's now. looks good so :P

jscheuer1
02-20-2013, 06:46 AM
i hide it with js but time /entry remain 8 sec..why? before was 6-7. it's possible to 4sec/entry?

I missed this before for some reason. And I don't understand what entry is. What do you mean by entry?

kpk1l
02-20-2013, 10:00 AM
sorry. i'm not so good with english.
entry is what i post. the slider have 4 entries (posts) . i don't know how to explain

jscheuer1
02-20-2013, 10:20 AM
If you have time, then something happens during that time. Do you mean the amount of time each image is seen? That did seem to get a little longer. I don't think any of the code we added could affect that unless having 8 total images instead of 4 does that somehow. But I think we had 8 before it got longer. I'm also not sure it got longer. The one thing I'm sure of is that the time we can see the last image in each slider got longer. Is there any documentation for the slider?

kpk1l
02-20-2013, 01:24 PM
Do you mean the amount of time each image is seen?
yes. normal, it's about 8 sec per post.

having 8 total images instead of 4
I don't want 8 images. i want 4 but I was wondering if there's any solution can reduce time of each post

anyway..I let it as it's now if it's not possible. thanks

jscheuer1
02-20-2013, 03:44 PM
You have 8 images. 4 in one slider, 4 in another slider. The slider script sees it as one big slider with 8 images. But because 4 of them are in the slider2 div it won't play those unless you hover them. You can't hover them because we hid them. What I did was set it up so that the four hidden ones replace the four seen ones and then they switch back every 30 seconds - enough time to go through all 4, not including the time it takes to fade one set out and the other in. So each one is showing for probably about 7.5 seconds. I think it was closer to 6 before, but I'm not sure, it could have been about 7.5 all along. What we did shouldn't have changed that. How long an image shows for must be determined by the slider script and we haven't been able to find that. If it has instructions, those might help us.

Are there any instructions for the slider script? If so, where are they?

kpk1l
02-20-2013, 07:23 PM
I understand now. I don't know if there is anyscript, just that informer and I don't know how to change it.

Thank you very much for helping me :D