Solved

Bootstrap slider help

Posted on 2015-01-07
10
177 Views
Last Modified: 2015-01-08
Hello- Please see here: test.magickitchen.com/responsive/

The slider at the top, I would like two changes.

1. I'd like the picture to be smaller, The size is: 1,140px × 450px (scaled to 1,583px × 625px). I guess that's because of my screen size.  I'd like it to be smaller in height, it doesn't really work well on a mobile either.

2. I'd like it to scroll automatically.

Thanks in advance for your help.
0
Comment
Question by:mel200
  • 5
  • 5
10 Comments
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 40537606
1. I'd like the picture to be smaller, The size is: 1,140px × 450px (scaled to 1,583px × 625px). I guess that's because of my screen size.  I'd like it to be smaller in height, it doesn't really work well on a mobile either.
Because the site is responsive, the image fills the width of the screen.  If you want the height of the image to be different you either need to reduce the width of the image or post another image with a different ratio of width to height.

2. I'd like it to scroll automatically.
I'm assuming it's this plugin?  => http://dimsemenov.com/plugins/royal-slider/documentation/#api 

in your
$(document).ready(function() {
   ...
    slider.startAutoPlay();
   ...
});
0
 

Author Comment

by:mel200
ID: 40537714
Thanks! I'm attaching the js code, could you help me with where to put it?

custom.js
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 40537730
In the section (I've added the code at the end):
if($('.animated-fullwidth').length){
		jQuery.rsCSS3Easing.easeOutBack = 'cubic-bezier(0.175, 0.885, 0.320, 1.275)';
		$('.animated-fullwidth').each(function(index, el) {
			$(this).royalSlider({
				arrowsNav: true,
				arrowsNavAutoHide: false,
				fadeinLoadedSlide: false,
				controlNavigationSpacing: 0,
				controlNavigation: 'bullets',
				autoScaleSlider: true, 
				autoScaleSliderWidth: 960,     
				autoScaleSliderHeight: 350,
				imageScaleMode: 'fill',
				imageAlignCenter:false,
				blockLoop: true,
				loop: true,
				numImagesToPreload: 6,
				transitionType: 'fade',
				keyboardNavEnabled: true,
				block: {
					delay: 400
				}
			});	
// You can get slider instance from royalSlider data:
var slider = $(this).data('royalSlider');
slider.startAutoPlay();
		});
	}

Open in new window

0
 

Author Comment

by:mel200
ID: 40537824
I believe I added it correctly, but it isn't auto-playing:  http://test.magickitchen.com/responsive/js/custom.js
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 40538442
That's ok, we'll try a different tact. Instead of trying to call a function, just add the autoplay as another option when creating it:

autoPlay: {
                // autoplay options go gere
                enabled: true,
                pauseOnHover: true
          }
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:mel200
ID: 40538735
test.magickitchen.com/responsive/js-plugins/royalslider/royalslider.css

I added it there, but I'm not sure that's what you mean?
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 40539033
No...add it to the .js not the .css

Same place you put my code before http:#a40537730, except within the initialization

Ie

if($('.animated-fullwidth').length){
		jQuery.rsCSS3Easing.easeOutBack = 'cubic-bezier(0.175, 0.885, 0.320, 1.275)';
		$('.animated-fullwidth').each(function(index, el) {
			$(this).royalSlider({
				arrowsNav: true,
				arrowsNavAutoHide: false,
				fadeinLoadedSlide: false,
				controlNavigationSpacing: 0,
				controlNavigation: 'bullets',
				autoScaleSlider: true, 
				autoScaleSliderWidth: 960,     
				autoScaleSliderHeight: 350,
				imageScaleMode: 'fill',
				imageAlignCenter:false,
				blockLoop: true,
				loop: true,
				numImagesToPreload: 6,
				transitionType: 'fade',
				keyboardNavEnabled: true,
				block: {
					delay: 400
				},
autoPlay: {
                // autoplay options go gere
                enabled: true,
                pauseOnHover: true
          }
			});	

		});
	}

Open in new window

0
 

Author Comment

by:mel200
ID: 40539115
Beautiful! Can I slow it down?
0
 
LVL 42

Accepted Solution

by:
Rob Jurd, EE MVE earned 500 total points
ID: 40539184
absolutely, just add a delay option in milliseconds where 5000 = 5sec: http://dimsemenov.com/plugins/royal-slider/documentation/#autoplay

taking just the autoplay section:

autoPlay: {
                // autoplay options go gere
                enabled: true,
                pauseOnHover: true,
                delay: 5000
          }
0
 

Author Closing Comment

by:mel200
ID: 40539209
Perfect, thanks for your help- and your patience!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
This video teaches users how to migrate an existing Wordpress website to a new domain.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now