jquery

Change Input val. and type using jQuery

<input name="myusername" type="text" id="u" class="blackle u" value="Username..." /> <input name="mypassword" type="text" id="p" class="blackle p" value="Password..." /> Using jQuery... Onfocus - if #u has val "Username..." then change it to "" (blank) OnBlur - if #u has val "" (blank) then change it back to "Username..." Onfocus - ...

jQuery: show() keeps adding display:block

I'm having a little issue right now that has turned into a festering wound. I've recreated Google Business Hours for setting which hours during the week that a company is open, or whether they are closed on that day. Now, if they are closed, the user can select a checkbox and the times DIV hides. Right now I'm using .show() and .hide() ...

Need to explicitly call .button() to apply JQuery UI style?

We have a couple <button> elements which we style with JQuery UI like this: $("#my-button" ).button();. Is there a way to have JQuery UI automatically style the buttons without explicity writing that code? ...

Load Google Map through JQuery Load?

Where in the flow of execution does the initialize() function need to appear in the code to allow a Google Map v3 API map to be loaded through a JQuery .load call. The code I have at the moment looks like this $('#maplink').click(function(){ $('.fades').fadeOut('slow'); $('#googleMap').show(); $('#googleMap').load("map.html"); initiali...

How to enable/disable jquery ui comboboxes?

I use jquery UI. I have 3 comboboxes and I need to enable each field if the previous one filled. jQuery(document).ready(function(){ $("#box1").combobox(); $("#box2").combobox(); $("#box3").combobox(); }); ...

JQuery-equivalent to prototypes Down()-function

I'm porting a webapp from prototype to jquery in which I often used the prototype Down() function. (selecting the first child of a given element) Glancing over the JQuery-api one of the ways to do this would be: prototype: $('abc').down(); jquery: $('abc').children().first(); However, since this first fetches all children and ap...

jQuery positioning issue

Good Day, I have a web form against a white background that allows the user to make certain selections. Depending on the selection that the user makes, this form could grow very long lengthwise. (Although I advised against it, the client was adamant). The form works fine and I'm happy. However, at the bottom of the form is a div fo...

jqGrid - make all columns not sortable?

Is there a way to make all columns on a grid NOT sortable other than adding sortable:false to each column? I know you can set global options at the grid level but didn't know if you could do it at the colModel level. ...

PHP + Jquery - page move on top after an ajax call

Hi. I make this code that, after 9 seconds, it call an ajax function, and print the result elaborated from the server to the client. This is the JS code : function changeSponsor() { $.ajax({ type: 'POST', cache: false, url: './auth/ajax.php', data: 'id=changespon', success: function(msg) { ...

JQgrid Clear Search Criteria

Hi Everyone, I am hoping that one of the jqgrid gurus can help me here. Here is my problem. Currently I have a grid set up with the search enabled. When I run a search everything works fine and I can return good data back to the grid. I see that the "_search" parameter on the url is set to "true" and all is well. However, when finished...

How can I write this jQuery snippet more beautiful

$("#rightCol").children().children().children("div.entry").length I tried this $("#rightCol").children().eq(1).children("div.entry").length or this $("#rightCol").children(":eq(1)").children("div.entry").length with no success. ideas? ...

setting variable to be used with jquery click function

My apologies if this is just another question that gets asked over and over. I've found some similar questions, the examples just haven't gotten me exactly where I need to be. This is similar to http://stackoverflow.com/questions/359467. $('a.highslide').each(function() { hsGroup = $(this).attr("rel"); if(hsGroup.length > 1){ ...

Split up default.aspx

Hi, I have dynamic page which hides and shows a lot of stuff, div's, depending of what the user is clicking. It works great however the default.aspx gets a bit messy with all that html so I wounder if it is possible to split up the html into smaller parts and still keeping the structure of the page? Thanks M ...

Getting the offset height of a div using javascript

We're trying to alter msdropdown ( http://www.marghoobsuleman.com/jquery-image-dropdown) to "drop up" if the menu will go off the frame. In order to figure if that's going to happen we need to check the location of the drop down box relative to the frame that it's in. From there it's easy make the thing open upwards, but the location is ...

is it good to put a javascript preloader for a website ?

Why do most of the websites doesn't have a preloader? I am thinking to put a preloader for my website, but I wonder why many website which needs a preloader for their heavy content but they don't have one ? And I am looking for a good preloader tutorial. ...

jquery animate function - make it toggle

I have the following snippet of code (see below) and want to make the function toggle - what is the best way to go about this?? Thank-you. <html> <head> <title></title> <script type="text/javascript" src="js/jquery.js"></script> <script> $(document).ready(function() { $("#left_pane").css("left","-300px"); $("#middle_pane").c...

using jQuery .each() method on single-element id-selector

Explaining jQuery dialogs in the Nemikor Blog, Scott González uses the .each() method on an id selector: $('#page-help').each(function() { var dialog = $('<div></div>') .load($(this).attr('href')) .dialog( ... ); $(this).click(function() { ... }); }); Since an id selector can only return a single element, what is the purpo...

Javascript stop drag event for panorama photos

I've built a simple panorama photo viewer in jquery, see live example here: http://alafiariver.org/alafia/view/aldermans-ford How can I prevent this from being dragged too far? These photos vary in width, so the solution needs to be dynamic. ...

Create new window using jquery

Hi, I'm working on a little project in JavaScript/jQuery. In order to display results from a calculation done in javascript, I'd like to open a new window with some predefined content and modify this content in order to display the results: Im using code like this: var resultwindow = window.open('result.html') var doc = $('body', res...

jquery - submit of a bunch of slider values

So I have 5 sliders on a web page. Any brilliant solutions as to how to grab their values and submit them to the server (rails in this case) (ajax is ok)? One solution is to use hidden fields and on each slider change to update the corresponding hidden field. Seems kinda lame. The sliders all have a class of "slider", so I was hoping...