Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Change banner slider to fade

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 03-31-2016, 04:16 PM
 
tstone tstone is offline
 

Member
  
Join Date: Mar 2016
Posts: 21
 

Default Change banner slider to fade

How can I change the banner/carousel/slider (whatever it's called) to fade instead of slide on xc5.2.23 Noblesse single collumn? Sorry if this is a repeat, but several searches did not return anything.
__________________
x-cart5.2.13
Reply With Quote
  #2  
Old 03-31-2016, 10:45 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Change banner slider to fade

Never tried it before! Thanks for the suggestion.

So the first step is to override skins/default/en/banner_rotation/body.tpl

CHANGE:
Code:
<div id="banner-rotation-widget" class="carousel slide banner-carousel">

TO:
Code:
<div id="banner-rotation-widget" class="carousel carousel-fade banner-carousel">

Then you need to add this CSS:
Code:
/* Bootstrap Carousel Fade Transition (for Bootstrap 3.3.x) CSS from: http://codepen.io/transportedman/pen/NPWRGq and: http://stackoverflow.com/questions/18548731/bootstrap-3-carousel-fading-to-new-slide-instead-of-sliding-to-new-slide Inspired from: http://codepen.io/Rowno/pen/Afykb */ .carousel-fade .carousel-inner .item { opacity: 0; transition-property: opacity; display: inline-block; position: absolute; left: 0; top: 0; } .carousel-fade .carousel-inner .item:first-child { position: relative; } .carousel-fade .carousel-inner .active { opacity: 1; } .carousel-fade .carousel-inner .active.left, .carousel-fade .carousel-inner .active.right { left: 0; opacity: 0; z-index: 1; } .carousel-fade .carousel-inner .next.left, .carousel-fade .carousel-inner .prev.right { opacity: 1; } .carousel-fade .carousel-control { z-index: 2; } /* WHAT IS NEW IN 3.3: "Added transforms to improve carousel performance in modern browsers." Need to override the 3.3 new styles for modern browsers & apply opacity */ @media all and (transform-3d), (-webkit-transform-3d) { .carousel-fade .carousel-inner > .item.next, .carousel-fade .carousel-inner > .item.active.right { opacity: 0; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } .carousel-fade .carousel-inner > .item.prev, .carousel-fade .carousel-inner > .item.active.left { opacity: 0; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } .carousel-fade .carousel-inner > .item.next.left, .carousel-fade .carousel-inner > .item.prev.right, .carousel-fade .carousel-inner > .item.active { opacity: 1; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } }
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote

The following user thanks totaltec for this useful post:
qualiteam (04-03-2016)
  #3  
Old 04-01-2016, 09:35 AM
 
tstone tstone is offline
 

Member
  
Join Date: Mar 2016
Posts: 21
 

Default Re: Change banner slider to fade

Thanks, I'll give that a shot and see how it works. [edit] Just tried it and it works like a charm. I'll have to experiment with some of the settings to change speed etc. [edit 2] Any idea what to add (or remove) for a slower, crossfade? I checked the references above and I couldn't discern who was correct and who was not as none of the crossfades worked for me.
__________________
x-cart5.2.13
Reply With Quote
  #4  
Old 04-01-2016, 10:35 PM
 
Ezekush Ezekush is offline
 

Member
  
Join Date: Mar 2016
Posts: 27
 

Default Re: Change banner slider to fade

Great topic but i would like to ask, where do you add this CSS code given above? Anyone knows?
__________________
5.2.13
Reply With Quote
  #5  
Old 04-02-2016, 05:45 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Change banner slider to fade

Quote:
Originally Posted by Ezekush
Great topic but i would like to ask, where do you add this CSS code given above? Anyone knows?
The proper place to add the code would be in your own module's CSS. When we build sites with X-Cart 5, or just modify an existing client site, we build them a module specific for their business. So if the site is 123cars.com we will build a 123cars module and use it to contain all of the customizations that make that site unique.

Another place it could be added would be in the custom CSS section of Look and Feel in the admin. But this is amateur hour if you are customizing the site that way. It feels too transient for me.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #6  
Old 04-02-2016, 05:50 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Change banner slider to fade

Quote:
Originally Posted by tstone
Thanks, I'll give that a shot and see how it works. [edit] Just tried it and it works like a charm. I'll have to experiment with some of the settings to change speed etc. [edit 2] Any idea what to add (or remove) for a slower, crossfade? I checked the references above and I couldn't discern who was correct and who was not as none of the crossfades worked for me.
Changing speed... need to adjust the transition.
Code:
.carousel-fade .carousel-inner .item { opacity: 0; transition-property: opacity; display: inline-block; position: absolute; left: 0; top: 0; }
See the bolded line in the code above?

transition-property just defines what property to apply a transition to.

You could define it like this:
transition: opacity 3s ease;

The first declaration tells what to transition, opacity, the second determines the speed in seconds, the third determines what type of animation curve to apply.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote

The following user thanks totaltec for this useful post:
qualiteam (04-03-2016)
  #7  
Old 04-02-2016, 11:52 AM
 
tstone tstone is offline
 

Member
  
Join Date: Mar 2016
Posts: 21
 

Default Re: Change banner slider to fade

Thanks for the update and instructions for changing the fade speed. I thought that might be the place to do it. Oh, and also thanks for reminding me that I'm an amateur, as the Custom CSS is exactly where I placed the code. hee hee
__________________
x-cart5.2.13
Reply With Quote

The following user thanks tstone for this useful post:
totaltec (04-02-2016)
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 06:14 PM.

   

 
X-Cart forums © 2001-2020