jquery-selectors

jquery:How do i attach an array to form request and send it to php in Jquery

var subtbl = $(this).attr('data-counter'); var stunbr = $(this).attr('data-stunbr'); var m = 0; var checkedlines = new Array(); $.each($("#sub-table"+subtbl+" "+"input:checked"),function (m){ var chk_value = $("#chk_"+stunbr+"_"+m).attr('value'); ...

jQuery search ID for certain text

I am looking for a way to search for an ID on the current clicked element. Example: $('.t_element').click(function(){ if(!$('.t_element [id*=meta]')) { transModal($(this)); translateText(); } }); I basically need to say if the clicked element id does not contain the word...

asp.net+css+jQuery - how does it all work together?

Hi, I would like to understand how can I use jQuery to work with asp.net and css. When I'm writing asp.net code and for example I'm adding to a page DropDownList, I can't see it in the source when I'm opening source of a page in web browser. Instead of dropdownlist I can see select tag. When does the "magic" is done to change asp.net ta...

JQuery selector for table cells except first/last row/column

Hi, is there a way to directly select all 'inner' table cells (<td> elements) of a table (i.e. all cells except the ones in the first and last row and column) using a jquery selector expression? Thanks Martin ...

what is difference between different syntax in jQuery?

what is the difference between: $(function() { //..... }); and $(document).ready(function() { //...... }); in jQuery coding? ...

How to select any element (inputs, selects, textareas) with an specific name with JQuery

Hello, all! I have various inputs, selects and textareas in a form. I'd like to select one of them based on name without knowing the type of the element with jQuery. I know I can do something like $("input[name=foo], textarea[name=foo], select[name=foo]") but I wonder if I can do it in a more concise way. What do you say? ...

JQuery UI TabPanel Ajax loaded page not working properly

Hi, I'm using Django and lastest JQuery, and JQuery UI in my project. Created a tabpanel using UI widgets, its loading sub pages with Ajax. But loaded pages with javascripts is broken and redirects back to current URL I.E $('#tabs1').tabs({ cache:false, cookie: { expires: 1 }, ...

compare jquery selectors performance

Looking at improving the performance of my jquery selectors. so any tips or articles as the best per formant jquery selectors? For example selecting the a div's id. Anywhere online I can provide html and compare the different selectors I can use to select the required element. ...

jQuery: Given a selector, find only its visible elements

Hi all, This should be an easy one. I have a variable that I've already declared called $listItems. The declaration looks like this: var $listItems = $ul.children('li'); // $ul is just a selected unordered list Later in my code, I'd like to only get the ones that are currently visible. How would I go about that? Something like: $lis...

How to get a copy of whole element in jQuery?

I want to get the selected element and then insert it's copies in few places. var template = $("#info-" + country + " > .stats > .template").clone(); $(template).insertBefore("#info-" + country + " > .stats > .template"); What I'm doing wrong that it doesn't copy the element and insert it? P.S. The element which I'm selecting to copy...

jQuery: Removing HTML-element while keeping it's children

Hi, I want to add HTML like this: <div><img src="item.png"/>&nbsp;<a href="#"><span>Hello</span></a></div> but in some cases I need to get rid of the wrapping a-element, so it looks like this: <div><img src="item.png"/>&nbsp;<span>Hello</span></div> This a-element could be anywhere in arbitrary HTML-fragments. I grab it by a[href=...

jQuery preventing functions with stopPropagation

I have an input field in a form. On 'keyup' I display a suggestion list (like many search boxes). The results in the suggestionbox are clickable. Now I want to hide the suggestion list when I click anywhere but the list, but the single suggestions still have to be responsive. In another thread/question I read the answer to use stopPro...

Is there a shorter way to write this script? (Targeting multiple elements to run the same function)

So I have this nice slider script that I want to use on this page: http://tuscaroratackle.com/rods for several instances on the page. (In other words each rod posting will have it's own slider, a total of about 11 sliders on the page) In order to run the script I have to include this function declaration: $(document).ready(function(){...

Selecting numbers with jQuery

Hi, In a given DIV I wish to apply a SPAN to all numbers and only them. Is there a way to select numbers with jQuery ? ...

Please Recommend: jQuery simple gallery, expanding div and portrait or landscape images

Hi All, I would like to know if anyone out there has had experience with any simple lightweight jQuery galleries. My requirements for this particular project are quite simple, and I have made a genuine attempt to roll my own code, however this is just a bit puzzling for a beginner. I have a large div that loads with an initial image. ...

jquery checkbox with li

I have a series of checkboxes, and everything works except their default behavior has been altered unintentionally so I can no longer check them which is odd since the reason I was using this bit of jquery was to highlight the li around them when they got checked in the first place. Any ideas? //Tag cloud $(".tag-cloud li").toggle( f...

jQuery .each question

Hello Community, I am working on a project, which requires me to select a item from the categories navigation, which contains a "rel" attribute like (category-action, category-adventure, etc). As you can see from my demo: My Demo Script, it works on the first two categories, however, it does not work with the last two. Why is this? and h...