I have the following script.
$(function () {
$('#slider').slider({
value: 50,
min: 10,
max: 100,
step: 10,
slide: function (event, ui) {
$("#slider-value").html(ui.value);
$("#hiddenbox").val(ui.value);
},
change: function (event, data) {
$("#slider-value").html($('#slider').slider('value'));
var sliderValue = hiddenbox.value;
$("#div1").load(bob, {sliderValue: sliderValue}, function(responseTxt,statusTxt,xhr){
if(statusTxt=="error")
alert("Error: "+xhr.status+": "+xhr.statusText);
});
}
});
$("#show-slider").click(function() {
$('#slide').toggle("slow");
});
});
I am determining which file to load using the variable (bob). This should then cause the JquerySlider to alter the contents of Div1 to the page specified in bob.
A click event on another menu option should reassign the variable :
$(document).ready(function(){
$("#sport").on("click", function(){
var page = "sport.php";
var sliderValue = hiddenbox.value;
var bob = "sport.php";
$("#div1").load("sport.php", {sliderValue: sliderValue, page: page}, function(responseTxt,statusTxt,xhr){
if(statusTxt=="error")
alert("Error: "+xhr.status+": "+xhr.statusTexe. t);
});
});
});
However at the moment all that happens is the slider does nothing. If you move it and page transition then changes occur but apart from that it's unresponsive.
Have declared bob using:
$(document).ready(function(){
var bob;
});