# Solved: Basic jQuery slider (bjqs) won't automatically start!



## JiminSA (Dec 15, 2011)

I'm using jQuery's Slider (bjqs.1.3.js) and have set it to start automatically (line 33)

```
automatic       : true,     // enable/disable automatic slide rotation
```
However, guess what, that's right it don't auto-start

I've tried to bind the "fade" to the page load thus:

```
$(window).bind("load", function() {
		jQuery(document).ready(function($) {

			$('#banner-fade').bjqs({
			height      : 360,
			width       : 640,
			responsive  : true,
			automatic   : true
			});

		});
	});
	</script>
```
 and even stuck another automatoc : true in for good measure, all to no avail ...
If I do a page refresh it kicks off tickety-boo, but who needs (or knows) to do that. Any ideas?

Incidentally, you can see it in non-action on my personal website ( it's on the work page ), link below.


----------



## ckphilli (Apr 29, 2006)

Try this:


```
$(function(){
   $('#banner-fade').bjqs({
			height      : 360,
			width       : 640,
			responsive  : true,
			automatic   : true
			});
});
```
Essentially the same minus the .bind on load.


----------



## JiminSA (Dec 15, 2011)

Thanks for that tip Chris, but the end result was it didn't render even after refresh
Whilst researching, I came across this snippet ...


> Activation
> 
> The final step is to invoke the plugin and attach it to the outer-most dom element. You can then pass in a variety of key : value pairs to configure the slider.




```
jQuery(document).ready(function($) {
    $('#banner-fade').bjqs({
        'height' : 320,
        'width' : 620,
        'responsive' : true
    });
});
```
 at this link and it's as clear as mud to me, but maybe it makes sense to you ...


----------



## ckphilli (Apr 29, 2006)

Did you fix it? Just looked and it faded in for me on clicking your bespoke link.


----------



## ckphilli (Apr 29, 2006)

Just tried it again, definitely working.


----------



## JiminSA (Dec 15, 2011)

The slider is in the second slideshow (the LCD screen, not the Carousel) and it doesn't start for me in Chrome. What browser are you using where it renders?


----------



## JiminSA (Dec 15, 2011)

Aha! It's a known Chrome issue, which can be resolved with a page refresh, until it's sorted!

I've put a clunky:down: bit of html in my site to cater for it ...


----------



## JiminSA (Dec 15, 2011)

Thanks for your input, Chris.:up:
As usual, you put me on the right track! Just to elucidate for interested parties I put the following code into my site just before the jQuery Slider ...

```
<p>... or click 'em at your leisure ...</p>
				<br />
<?php	
	$browser = $_SERVER['HTTP_USER_AGENT'];
	$chrome = '/Chrome/';

	if (preg_match($chrome, $browser))
	{
//    Chrome/Opera
		if(!isset($_SESSION['slider_on']))
		{
			$_SESSION['slider_on'] = true;
?>
				<p style="color:red">Oops! Sorry, but there's a bug in certain Browsers which prevents the following Image Slider kicking-off automatically!<br />
				So if you wish to, just click here <a href="javascript:void();" title="Turn on the Telly!"><img src="images/on.png" align="top" onClick="document.location.reload(true)"></a> to start it off ...</p>
				<br />			
<?php
		}
	}
?>
				<div id="slide_container">
```
It is simply checking the Browser the user is using and if it's Chrome, it will provide the user with a display "fix" - i.e. a javascript Page Refresh


----------



## ckphilli (Apr 29, 2006)

Glad you got it sorted Jim!


----------

