jquery

Add rows to jQuery table after the the present row

Hello, I wanted to know how do I go about adding rows after a particular row in my datatable. I'm using the jQuery datatables plug-in for this purpose. I can pass the table row Index. that I need to insert the row to my javascript function, as follows: function addNewContact(rCount){ .. } And my HTML code is: table id="exampleTbl"...

jQuery Regular Expression Problem.

Iam using one Jquery Library which takes the Regular expression in json format in on file and tries to validate that from file "Studentnumber":{ regex: "/^[-/@#&$*\w\s]+$/", alertText: "* Invalid Student Number" }, // ... I can use this in my text box field as follows <input type="text" class="validate[required,custom[Studentnu...

This pretty little jQuery code seems to not work.. anyone know why?

If I run it. It returns no errors. And in firebug it does in fact select the proper elements in the DOM. If I break it apart and do something like this : $('img[hspace]').css('marginLeft', ($('img[hspace]').attr('hspace') / 2) + 'px') That works. Here's the monster in its entirety. $('img[hspace]').each(function(el){ var pixel...

Using jquery to hide dynamically added divs

The jquery code below will hide divs ending with -value-wrapper when the page loads. My issue is, that the "Add more values" button will append another row (with the number incremented). When it does, all the divs are revealed. Is there a way to keep the original ones hidden and hide those in the new set as well? The html markup look...

Show an Anchor tag in an ASP.Net page with JQuery

I've got an ASP.Net page in which I have an html anchor tag and I've set the visible property to false. I want to make it visible with JQuery, but can't seem to get it to work. I've tried to use the selector for the anchor tag itself, and also a class selector, but neither has any effect. Here is the markup for the anchor tag: <a run...

Getting index value of cropped Div : Jquery

Ok, so I load a ul with many li's into a div that has overflow:hidden. Click the next btn and it slides the next set of thumbs into view. All the sliding is working fine but I'm trying to figure how to say "if the last li element is being seen, the next btn is not going to work. Since all are loaded at runtime and only cropped out of v...

get a total of jquery's .each()

Hi, I'm using jquery's .each() to iterate over a group of li's. I need a total of all the li's matched. Is the only way to create a count variable outside the .each() and increment this inside the .each()? It doesn't seem very elegant. var count; $('#accordion li').each(function() { ++count; }); ...

$(window).height() reports wrong height in IE8 (jQuery)

I have the code below. IE8 displays a smaller height. The difference is over 100 pixels. It works fine in FireFox. Why doesn't it work right in IE? <html> <body> <script type="text/javascript" src='<%=ResolveUrl("~/includes/jquery-1.4.2.min.js") %>'></script> <script type="text/javascript"> window.onresize = ff; fu...

ASP.NET MVC loading multiple partial views into a single div using JQuery

I am working on a help page which is composed of a navigation tree, content box, and search box. The navigation tree has links to Frequently Asked Questions and Glossary, each of which are linked to an Action which return partial views. To the right of the navigation tree I have a single content div that I would like to contain whicheve...

content disappearing when using jquery slideToggle in IE7

I've seen this question asked several times but haven't seen any answers. I have a ul that I'm expanding and collapsing using slideToggle() with jquery. The code is simple: $('#leftMenu li a.moreLess').click(function() { $(this).next().slideToggle('normal'); }); With markup of: <a class="moreLess">Click here to see more</a> <...

jQuery .focus() and .blur() not working in Chrome or Safari

I am creating a survey form that needs to have each question and set of answers highlighted (by changing the background color) when the user focuses on them. .focus() and .blur() both work in Firefox and IE, but not entirely in Safari and Chrome. I also tried .focusin() and .focusout() with the same results. EDIT: Clicking does not fir...

JQuery $(document).ready ajax load

I looked at quite a few of the related questions and I must be asking this completely different as I saw only a few that seemed to relate. I am loading an entire middle div via JQuery Ajax call and I simply want to be able to do some automatic JQuery on that new area like $(document).ready allows when a DOM is being loaded. I read that l...

How come the answer to every javascript question ends up being "jQuery"

I've been following the javascript questions here for the last few weeks, and I've found a common recurring theme. Almost any question asked on here that involves JavaScript gets answered with: "jQuery can do that" "there's a plugin for that" "jQuery can make your bed for you." Even questions referencing other libraries are answer...

Subgrid Caching or Stopping Subgrid data from being removed (jqGrid)

Is there any way to force jqGrid not to remove the subgrid data when its row is toggled? My current process for loading the datagrid is as follows: 1) Setup main grid, setting subgrid up programatically with an ID that I can use later 2) Load data into main grid locally via json 3) Add data to subgrid locally via json Due to the f...

jqgrid reload grid partially working

Hi, I have a client side managed jqgrid that I reload when some external event are fired. Everything is fine when I reload the grid with more data but when I reload it with less data, the amount of rows is incorrect. For instance, when the is currently 100 rows in the grid and I reload it with 200, then the nav bar shows 200 records. I...

How to use hover property simultaneously with jQuery's mousemove?

I have coded a simple div containing an image that follows the mouse cursor only when the mouse is present within the div using jQuery's mousemove property. It works great, except for I would like the image to be hidden by default, and to only appear when the mouse is present (and then when the mouse leaves, to disappear again.) This cou...

Force re-eval inline and included Javascript

I'm injecting Javascript into a page w/ Greasemonkey, doing some processing on the body content (adding markup) then re-inserting the content. The problem is that all the events in the original content are lost, breaking things like onClick events that were added when the page initially loaded. My original idea was to do this (using jQu...

Storing an Array in localStorage Using JSON.stringify

I just learned about jquery's .makeArray and I am trying to use JSON.stringify to store the array in localStorage but I am having unexpected results. This works: var links = {'one': 1, 'two': 2 }; var setstr = JSON.stringify(links); localStorage.setItem('strlinks', setstr); var getstr = localStorage.getItem('strlinks'); console.log(ge...

How to change Href of custom Ribbon button in SharePoint 2010

Is there a way to change the Href of a custom ribbon button? I'm tring to tie the button to a lightbox, so that the lightbox is displayed when the button is clicked. The ID of the button is Ribbon.Documents.New.Controls.BtnUpload-Large so I tried jQuery('#Ribbon.Documents.New.Controls.BtnUpload-Large').attr('href', href), but that didn...

external flash file loader

hi, i want to show progress bar while the flash file is loading, for example http://www.roketoyun.com/guc-gosterisi.html in this site it's loading file dynamicly. my page like this index.php?file=15 preloader will take the file id and show the progress bar how can i do this ? i searched for jquery but couldn't but i think i can do this w...