jquery

How to add background image in a textbox using jquery.

I have a textbox I want to change the watermark on focus. Please correct me: $('body').ready(function() { $('#edit-submitted-full-name').focus(function() { $(this).css({background:'#FFFFFF'}); }); $('#edit-submitted-full-name').blur(function() { if ($(this).val() == '') { $(this).css({background...

appendTo div between li

Hi, I have the following code <div id="element1" style="display:none"></div> <ul> <li id="item1">Item 1</li> <li id="item2">Item 1</li> </ul> On click I want to move element1 after item1 <ul> <li id="item1">Item 1</li> <div id="element1" style="display:none"></div> <li id="item2">Item 1</li> </ul> If I use ...

Jquery - JSON.stringify, array is empty

Hi, i hope somebody can help me, the array value is empty in the post. $(function start() { c_all = new Array('#div { font-color:#ff0000; border:1px solid #00ff00; }', '#div_2 { font-color:#ff0000; }', '.line2 { font-color:#00ffff; }'); css(c_all); }); function css(x) { values = new Array(); for (i = 0; i < x.le...

Canonical jQuery approach to dynamically enabling/disabling form submit buttons

I'm writing some JavaScript to handle the common scenario of dynamically enabling a form submit button when some text is entered in an associated text field. I've been using the Prototype framework for years but am moving over to jQuery. So I was surprised to discover that the jQuery version of my code seems kind of clunky. Is there a w...

how can reload the new data in the grid on clicking the buton?

The scenario is like this ...say i have a grid and on clicking that button it will send that data to the grid and it will refresh automatically with new data display in the data... $("#wics").click( function(){ var grid = jQuery("#list10"); var ids = grid.jqGrid('getGridParam','selarrrow'); if (ids.length>0) { var na...

Is there any way to see what part of a code is making a webpage slower?

It is all of the sudden much slower then it was. Is there any way I could use some sort of tool that will tell me what part of my code is making my page slow? Thanks ...

best Pop-up box plug-in of jquery .

i use facebox.js to pop-up div on my site , but i don't think it is the best one , so what plug-in of jquery are you using for pop-up , thanks ...

Do not round .width() in jQuery

Hi everyone, I've searched around and couldn't find this. I'm trying to get the width of a div, but if it has a decimal point it rounds the number. example: #container{ background: blue; width: 543.5px; height: 20px; margin: 0; padding: 0; } if I do $('#container').width(); it will return 543 instead of 543.5. How do I get it to ...

jQuery check empty field doesn't check all fields

For example, I'm using the script below to check for empty fields : $('a.submit').click(function() { if ($('.LoginData').val() == "") { $('input:text[value=""]').attr('style', 'border-color:#FF0000;'); } else { $(this).parents('form').submit(); } }); All the input elements have the class LoginData, so I used the jQuery class s...

Put Div into another if page view ends

Hey guys, So what I want is to have some tables like this <ul> <li>Some Text, Links whatever</li> </ul> ordered by the page view. So if the page ends (on the bottom) in the view I wanna have a new table on the right of the first like this: <div class="left_1 table"> <ul> <li>First Some Text, Links whatever</li> </ul> </d...

jQTouch execute code when AJAX page is loaded

When the content is static: <a href="#nearme">Click</a> <script>$('#nearme').bind('pageAnimationEnd', function(event, info){});</script> When the content is AJAX: <a href="page.html">Click</a> How do I bind something to occur after the AJAX (page.html) is loaded? ...

Jquery Cycle Slider - Quick Clicks Break Slider

I've created somewhat of a complicated slider with jquery Cycle. You can see it running perfectly here However, when you click it a bunch of times (before the slide has finished its transition), it starts to go wacky and even hides the text.. Here is my code: $('#dmzSlideHolder').cycle({ fx: 'uncover', pager: '#slideN...

jquery looping question

I am in the the each() loop of a given <tr> on my page. How do I loop through all the <th> within $(this) i.e. within the current <tr>: $('#my_table > tbody > tr').each(function() { // how to loop through all the <th>'s inside the current tr? }); ...

How do I target an input when 5 characters have been entered?

What I want to do is take an input for a zipcode and in jQuery if input#zip has 5 characters then function. Also same for a list box when the user chooses one of the choices, might be simpler? ...

Add element to change with existing onblur

I would like a separate DIV that's holding the input to also change in background color. How would I add it to my existing code that works? <script type="text/javascript"> jQuery(document).ready(function() { jQuery("input:[type=text]").focus(function () { jQuery(this).addClass("highLightInput"); }); jQuery("input:[type=text]").blur(f...

How to find parent form from element?

I am trying to find parent form from element using code below: <form id="f1" action="action1.html"> form1 <button id="btn1" onclick="testaction(this); return false;" >test form 1</button> </form> <script type="text/javascript" > function testaction(element) { var e = $(element.id); var form = e.parent('form'); alert(form....

Oembed & jQuery - my video file is not updated with new value

Hi all, I'm using Oembed for the first time with the Oembed jQuery plugin. Everything is working fine when the page loads, my default video is loaded fine, but when I click on a thumbnail to load another file the new movie isn't loaded. I'm not getting any errors and it doesn't look like anything is being run. Here's the code I am using...

Why does my jQuery UI Dialog lose the focus when it finishes the open effect?

I'm using jQuery UI Dialog for adding some news to my site. Every time I click add news button, the dialog should open with the text area. Actually, I'm using ckeditor replacing the textarea and it happens that I can't type inside the text editor due to focus issue (at least I think this is the problem). Check it out. As just as I clic...

Flickr API - Latest Photos from a Set?

I'm currently using this JSON to get the latest flickr photos of an ID: http://api.flickr.com/services/feeds/photos_public.gne?id=49107890@N06&amp;tagmode=any&amp;format=json&amp;jsoncallback=? Now I need to change my code to display a set instead of an ID. I can get some JSON return with this: http://api.flickr.com/services/rest/?met...

jquery - problem with synchronize ajax and dialogbox in function

Hello, I have problem with synchronizing results of function I get with AJAX with that function. The idea is that I send AJAX request, then after reciving answer I open dialogbox, and after user confirmation function returns proper value. Problem is that my function (even if I set ajax request not to be async) doesn't wait for response a...