jquery

jquery nth child that is currently visible

I can style every 4th 'item' div like so jQuery(".item:nth-child(4n)").addClass("fourth-item"); and that works fine, but then I hide some items, show some others and want to re-do this styling, but only styling every 4th item that is visible. So I have a function that will remove this styling and reapply it, but I need to specify in...

How to get label of select option with jQuery?

<select> <option value="test">label </option> </select> The value can be retrieved by $select.val(). What about the label? Is there a solution that will work in IE6? ...

How to handel error In $.get()-jquery

Hi All, I have a jquery code in which I am using get() and calling some remote url/file. Now I want to know what the best way is to handle errors from this. What I am doing is: $(document).ready(function() { $.ajaxSetup({ error: function(x, e) { if (x.status == 0) { alert(' C...

create a chat application in php

im tryig to create a chat system using php and javascript .i wonder how the chat in gmail works, will will remain in the same position even if we are going through dirrerent pages.it will be greatful if anyone clan explain me how it works. And at the same time please give some ideas to create a chat s/m, like creation f the popup window...

Json Value undefined when converting datatable into json format

I want to retreive the data from database and assign it to dropdownlist. For that I'm using the following jquery in the onclick event function getcountry() { try { $.ajax({ type: "POST", url: "/JsonWebServiceWithJQuery/jsonwebservice.asmx/getcountry", ...

Jquery validate: re-validate a validated form after checkbox changed with different rules

I am trying to validate a form with a couple of elements being required if a checkbox is NOT checked. Now if I submit the form the rules fire - and then I check the checkbox on - the validation rules have already fired - and even though the checkbox is now checked - the validation rules still apply and the form will not submit until I ...

map .css() method results into an array in jquery

in my program, I try to copy an element, using .clone() method, but this method doesnt copy the element's styles, so I have to translate them one by one like this : var style = { "position":"absolute", "color": $(demo[i][1]).css("color"), "width": $(demo[i][1]).width(), ...

Detect when window vertical scrollbar appears

Is there a simple and reliable solution for detecting window vertical scrollbar appears/disappears? window.onresize isn't triggered when after JavaScript DOM manipulation page becomes high enough for appearing scrollbar. In this very similar post Detect if a page has a vertical scrollbar described solution how to detect whether scrollb...

Retrieve tr from table

How can i retrieve all the tr with class="ccc" from a table with id"=iii"? ...

Jquery Facebox plugin doesn't work

I downloaded facebox from famspam.com/facebox. Then I added facebox.js to be in public/javascripts folder, and facebox.css in public/stylesheets Then I included this files in my application.html.erb AFTER original Jquery library ver 1.4 The last, I set a rel attribute to my a href tags to try to use Facebox, but it doesn't appear. When...

Javascript won't execute after load.

My website contains links and when I click on a click, the target HTML content is loaded into a "div" using JQuery, no problem so far. My problem is when my search page below is loaded for the third time, the script will not execute: <h1><span>Search</span></h1> <p class="bigtext">Entity</p> <input type="text" id="searchfield"> <p clas...

jQuery troubles with each() and custom function

$(function(){ $(".test").each(function(){ test(); }); }); function test(){ $(this).css("border","1px solid red").append(" checked"); } why is this not working? what am I missing? this is my test html: <p>test</p> <p>test</p> <p class="test">test</p> <p>test</p> ...

Clear button for form input field using JQuery and JQTouch

I have a site built using JQTouch and want to add the little cross buttons within text input fields to clear out text on press. I've tried emulating Google's technique from their google.com iPhone site. Also I've read about that approach over here http://stackoverflow.com/questions/613114/little-x-in-textfield-input... I have this part...

Fading between two classes in jquery

I would like to be able to fadeout this class <h2 class="care-home-fees"><a title="Care Home Fees" href="#">Text</a></h2> and fade in this <h2 class="care-home-fees-over"><a title="Care Home Fees" href="#">Text</a></h2> Notice there are two separate images Here is my current markup which doesnt seem to work $(document).ready(func...

Background positioning with jquery doesn't work in IE7

My script is supposed to dynamically change the background-position when clicking on a button (adding or substracting 1 percent from the current value). Works fine in Fx and Chrome, and ie8 too (i believe), though not in ie7. Here's my code: function makeClicker(index) { $('#leftbutton' + index).click(function() { var bPos ...

How to dynamically enable or disable the textbox by using jQuery in ASP.NET MVC?

I have a ASP.NET MVC project with a large list of input textboxes which I want the user to control them independently. Here is the link how it looks like now. Here are some things I want to have: Each enable/disable link only controls each row. The number of rows is not fixed and it will be generated dynamically. It can be 10 or 2...

jQuery - Add ID instead of Class

I'm using the current jQuery: $(function() { $('span .breadcrumb').each(function(){ $('#nav').addClass($(this).text()); $('#container').addClass($(this).text()); $('.stretch_footer').addClass($(this).text()) $('#footer').addClass($(this).text()); }); }); It applies the text held in the breadcrum...

TinyMCE not loading when using JQuery

I'm busy working on a project that has a main page, on that main page have a tabs, everytime I click on a tab it loads a page into a div tag with ID content. One of the pages I'm loading into the div tag contains a textarea where I need to have TinyMCE in working. I'm loading the pages into the div the following way using JQuery $('#...

How to realize jQuery async treeview in PHP?

Hello, I want to integrate an async treeview in PHP. Now i want to know how to generate a source php file with PHP. Now my database structure is like this: Create table School( id int(10) NOT NULL AUTO_INCREMENT, name varchar(50), primary key(id) ); Create table Class( id int(10) NOT NULL AUTO_INCREMENT, name varchar(50), school_i...

jquery tools - tabs mouseover - adding a link

I love this tool to show text when moving the mouse over the pix: http://flowplayer.org/tools/demos/tabs/mouseover.htm Now I'm trying to open a link, when one of the pix is clicked by the mouse. I tried this way: original: <'img src="http://static.flowplayer.org/img/commerce/commercial.png" alt="Commercial version" />' adding link: <...