jquery

jQuery: using css selector to compare position values ?

Can I use the following code to compare the value of the attribute "left" ? if ($('.pager').css('left') < 100 + 'px') Or should I different code ? (My issue is how to deal with 'px', if I should remove it or at least use it consistently in the code. thanks ...

Jquery check if parent has an ID

Hi i'm trying to check if a parent element contains an ID Here is my list <ul> <li></li> <li id="selected"> <ul> <li></li> <li></li> </ul> </li> <li></li> </ul> Don't know how to make a correct list in here? if (jQuery(LiElement).parent("#selected")) { //If parent has id=selected } else { //If parent ...

Adding Jquery to an new Window "window.open"

Hi there, what about adding jquery to a page. Like this: Clicking on a bookmark (which loads the same url into a new window) Adding Jquery.js Run some jquery.. ...

Check if copy and paste is enabled

On Firefox (at least) JavaScript copy and paste functions are disabled by default. Is there anyway to check if the functionality is available so i can hide some buttons if its not? ...

jQuery selecting the 3rd, 4th and 5th TD in every row with ID

Hi, I am having some difficults selecting the proper cells in a table. I got a soccer games tables. Each table starts with ID 'game' and then the serial number, i.e: id='game122238' . Each table has two rows. On the first row I have 5 cells. On the second one I got one team. On the third one I got the result. On the Fourth I got the se...

jQuery: How can I detect the position of a specific item in the list ?

How can I detect the position of a specific item in the list ? I have the following list: <ul> <li> <li> <li class="current"> <li> </ul> I need to know in which position the current item is. In this case the result should be 3. thanks ...

javascript, jquery time format

Hi everybody , I have a question, how can I change time from 24hr format to 12, the easiest way, in javascript or Jquery . This is what I have : TempDate = $.datepicker.formatDate('MM dd, yy', TempDate); var ChangeDate = TempDate + " " + TradeTime; now TradeTime= 15:59 , but I wanna be 3:59PM What is the easiest way , or can I...

How to disable, enable, then disable again scrolling in ipad/iphone with e.preventDefault(); ?

I have it disabled already, and I can enable it again. I used: document.ontouchmove = function(e){ e.preventDefault(); } In the document.ready(); to disable it. And I used this to enable it. function doTouchMove(state) { document.ontouchmove = function(e){ return state; } } I have it so when a user doubl...

asp.net jquery add row (clone row) with text box and drop down dynamically

When the user click's the add box attribute the row(i.e the row with 2 dropdown and textbox needs to be added) row with above needs to be dynamically created using jquery(so that there is no post back). User will be allowed to add as many attirbutes as he wants and when they click the check box that row needs to be deleted. How this can...

jquery ajaxSubmit question

I am having a little bit of a trouble with the following: <script> $(document).ready(function() { $('#sform').validate({ rules: { firstName: {required:true}, lastName: {required:true}, emailAddress: {required:true, email:true} }, messages: { firstName: '<br/><span style="color:red;">Please enter your first name!</spa...

Jquery Datepicker not changing value

I am using the jquery datepicker and unfortunately when I click on a date, it is not changing the value of the input text box. When I click on a date, it changes the text but the value doesn't change when I inspect it. Any suggestions on how to resolve this? EDIT: It turns out this is not a problem at all. There was a duplicate records ...

JavaScript API -- support for IE 5.5 onwards

Hi: jQuery spoiled me a lot ;-) I am one of the early adapters of jQuery and I can't think anything other than that. Recently I am involving in a project, where I need to support any browsers, say from IE 5.5 onwards. Is there any other JavaScript API supports IE 5.5? I know what you are thinking about IE 5.5, some of the end users are ...

jQuery livesearch not working when loading asynchronously

Hi I have a livesearch and it uses an unordered list, like this: <input id="search"/> <ul id="list> <li>1</li> <li>2</li> </ul> Now I have the liveSearch function put on these items: $('#search').liveUpdate('#list').focus(); At first I was testing with a static list, it worked like charm. Now I'm trying to load it asynchronous...

deploying my first mobile site : 3 newbie questions

I have created a mobile version of a my website which is a one-page webapp. I'm working with php server side and js+jquery on the front end. how can i auto-redirect mobile browsers to the mobile web-app in a way that's transparent to search engines? should i allow only mobile bots on the mobile site? (with robots.txt) do i need to f...

how to select a div who have a class and a specific id

i have a html mark up page who have a div ex:- <div id="1" class="classic">i am text</div> <div id="2" class="classic">i am text</div> <div id="3" class="classic">i am text</div> <div id="4" class="classic">i am text</div> how can i select a div who have this class and a specific id like 1. are you can show me how in jqury ...

Js : Set field items for each items I create

I would like to set manually each items when I create them. I'm a newbie in Js but I search for a long time and no find the answer : I need some help please. When I make a new annonce, how reach each field ? function annonce() { return { // scroll: 'vertical', items: [{ xtype: 'fieldset', title: 'Annonce', ...

JQuery append closing tag before data

Hi I am creating a Adobe Air application with jQuery support. However, the recursive function that I have closes the tag first and writes the data afterwards. My code is, function displayTodoItems(id) { id = parseInt(id) if(!id) $("#todoLists").empty(); var list = fetchTodoItems(id); if(list.data == null) return; var numRec...

jQuery closest TR selection

Hope someone can advise. Having issues trying to remove a row once a link has been clicked. HTML <table> <tr><td>Some Data</td><td><a href="#" class="remove-row>Remove Row</a></td></tr> <tr><td>Some Data</td><td><a href="#" class="remove-row">Remove Row</a></td></tr> </table> Now the JS $("a.remove-row").live('click', function(...

Call PHP function from jQuery?

I have a PHP function on my site which takes a couple of seconds to complete. This holds the whole page up which I don't want. Would it be possible with jquery to call this PHP function after the page has loaded and display the results in a div? Also to display an ajax loader image until the PHP function has completed? I've been lookin...

How to add a basic jQuery table

How do I add a simple table (2 columns, 10 rows) into a section of a page. It has 10 rows because there will be 10 entries that will be dynamic (changed upon manual refresh) that come from the back-end DB. (Irrelevant but the second column will be a bit.ly address to the entry, per each entry)? Sorry if this sounds terribly stupid, but ...