Skip to main content

Posts

jquery whole page/window slider

I'm interested in making a whole page slider like in http://littlemonsters.com/ for example. I've looked around at their code and am trying to figure out -how they did this whole page slide (which I guess is just a very big slider), and also -how although the individual 'pages' are stacked on top of each other (like a normal page), when they slide, they are sliding left and right (part of the whole slider problem I guess) It seems that for many slider plugins, they somehow horizontalize list items (whereas when I do sliders by hand I make a really really long wide list with like width 9999px and have an overflow hidden viewing window--this is probably not the best way). here's some js I found on the above site that I think holds the key but I can't understand too well/incomplete. step = (id) -> width = $(window).width() dir = 1 dir = -1 if id < curId curId = id $(".boxDisplay").animate left: -1 * dir * width , 500, "

How do I resend a failed ajax request?

I have multiple ajax requests some request data every minute others are initiated by the user through a ui. $.get('/myurl', data).done(function( data ){ // do stuff.. }); The request might fail due to an authentication failure. I've setup a global .ajaxError() method for catching any failed requests. $(document).ajaxError(function( e, jqxhr ){ // Correct error.. }); After I catch the error I reset authorization. Resetting the authorization works but the user has to manually re initiate the ajax call (through the ui). How do I resend the failed request using the jqxhr originally sent? (I'm using jQuery for the ajax)

jQuery Sortable UI Syntax Issue

Im not quite sure what to search for to sort out this problem. I am getting syntax error with the following code because i have 2 (no idea what to call them) in the .sortable options. Would you be able to tell me what i have done wrong with this code? Im using a placeholder and also a connectWith from this page http://jqueryui.com/demos/sortable/#portlets and there doesnt seem to be any examples showing how to write both of them at the same time. The syntax error is not there when i comment out placeholder: "placeholder-highlighting" or connectWith: ".sortable-content" My code is below: $(function() { $( ".sortable-content" ).sortable({ placeholder: "placeholder-highlighting" connectWith: ".sortable-content" }); $( ".sortable" ).disableSelection(); }); Bonus points for telling me what they are called!

How to retain a selected value in dynamically generated dropdown box to the next jsp page?

I have a drop down box where the options are coming from the configured properties file.The options are generated on load of the page.I have used the following code. In JSP <select name="IDNo" id="IDNo"> </select> function loading() { var d = document.getElementById("system"); var df=document.getElementById("IDNo"); var i = 0; var disp = document.getElementById("Range"); var numberOfOptions = df.options.length; for (i = 0; i < numberOfOptions; i++) { df.remove(0); } if (d.value == "Apple") { df.options[df.options.length] = new Option("ALL",""); for(i=1;i<=disp.value;i++) { var option = document.createElement("option"); option.text=i; option.value=

How to check every checkboxes in a jquery datatable?

I have a table with checkboxes in the first column. I use the jQuery DataTable plugin display my table. I made 2 links to select/unselect every checkboxes. Here's the one to select all : <a href="" name="CheckAll" onClick="checkAll(document.email_list_form_inviter.getElementsByClassName(\'email_checkbox\'), event)" >Select all</a> And the javascript : function checkAll(field, event) { event.preventDefault(); for (i = 0; i < field.length; i++) field[i].checked = true ; return false; } But the datatable enables pagination and my function select only the visible checkboxes, not those of the other pages. How can do to select every checkboxes in my data table? Thanks :) Solution : Ok I did this with fnGetNodes, thank you amccausl! $("a[name='CheckAll']").click(function(event) { event.preventDefault(); var nodes = datatable.fnGetNodes( ); $('.email_checkbox&#

I want to show the lightbox on only homepage of my blog.but somethings wrong

I have this code: <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js'/> <script src='https://gj37765.googlecode.com/svn/trunk/html/[www.gj37765.blogspot.com]jquery.colorbox-min.js'/> <link href='https://gj37765.googlecode.com/svn/trunk/html/%5Bwww.gj37765.blogspot.com%5Dfbpopup.css' rel='stylesheet' type='text/css'/> <script type='text/javascript'> jQuery(document).ready(function(){ if (document.cookie.indexOf(&#39;visited=flase&#39;) == -1) { var fifteenDays = 1000*60*60*24*30; var expires = new Date((new Date()).valueOf() + fifteenDays); document.cookie = &quot;visited=false;expires=&quot; + expires.toUTCString(); $.colorbox({width:&quot;400px&quot;, inline:true, href:&quot;#mdfb&quot;}); } }); </script> The code is for a Facebook-like box which appears when a use