hello im trying to make something like github treeslider
im new to javascript..
but heres what im working on
jQuery(document).ready(function(){
$('#red-side-menu a').pjax({
container: '#ajax-users-v1',
});
var toggle;
if (typeof toggle != 'undefined') {
toggle = true;
}
if (toggle) {
$('body')
.bind('start.pjax', function() { $('#ajax-users-v1').show("slide", { direction: "right" }); })
.bind('end.pjax', function() { })
toggle = false;
};
if (!toggle) {
$('body')
.bind('start.pjax', function() { $('#ajax-users-v1').show("slide", { direction: "left" }); })
.bind('end.pjax', function() { })
toggle = true;
}
$('#red-edit-full a').pjax({
container: '#ajax-users-v1',
});
});
well before above im useing php to get $_GET[‘infolder’] but it seems its not that good.
the problem now that it keeps slide to left
is there a way to do this?
I think this can be simplified.
The document ready event automatically runs only once. I have commented the code to show when each line or statement block is executed. It’s really important to understand that the code inside the event handlers is the only code that is going to run after the page is finished loading.