I am still a newbie at JavaScript and don't have years of experience using JavaScript on Web Development. JavaScript is very messy considering nesting of functions and sometimes objects and things like passing function calls as a variable.
My HTML has a div tag to contain a JQuery widget.
HTML:
<div id="slide"></div>
The slider displays as per normal but it is not done with the options set with the widget factory. The lab requirement is such that I must use widget factory.
JavaScript
// slider with widget factory
$(document).ready(function()
{
$(function() {
$.widget("custom.slider",{
options: {
value: 50,
max: 175,
min: 1,
orientation: "vertical",
// Callbacks
change: null,
log: null
},
_create: function () {
this.options.value;
this.options.max;
this.options.min;
this.options.orientation;
}
});
});
$("#slide").slider();
});
I noticed JavaScript has a lot of programming concepts that I have never faced before compared to the usual programming languages. So the learning curve steepens exponentially.
sliderwidget. Please see: learn.jquery.com/jquery-ui/widget-factory/extending-widgets