Tricks: Get the content of the slider via Ajax

HTML Code

In order to keep the loading time of the page as low as possible, you should load the content of the slider via Ajax. Of course there should be initial content.

<ul id="slider">
	<li>default content</li>
</ul>

Call of Rhinoslider

To perform the Ajax request you have to modify the call.

$(document).ready(function(){
	// store the jquery object
	var $slider = $('#slider');
	$.get('/content-of-slider.php', function(data){
		$slider.append(data).rhinoslider();
	});
});

Example content

The file you get should contain something what is shown below.

<li>Content of a single slide</li>
<li>Content of a single slide</li>
<li>Content of a single slide</li>