jquery

Binding a jQuery click event to each element within a foreach loop

I am building a plugin which matches an element, finds a link within it and makes the parent element go to that location upon a click. I have a loop in the main body: return this.each(function(options) { $to_link = $(this); //matched object link_href = $('a', $to_link).attr('href'); //link location $($to_link,$parent)...

jQuery validation form not working

MY .js file: //rounded corners $(document).ready(function() { $("#topbar").corner("bl br 5px"); $("#mainbar").corner("5px"); $("#sidebar").corner("5px"); $("#bottombar").corner("5px"); }); //form $(document).ready(function(){ $("#commentForm").valid...

jquery animate, scroll top top slow

Hello everybody, I'd like my page to go to the top when certain anchor is clicked, I had this done before but I lost the code somewhere, here is how I tried to do it but its not working its scrolling usual super fast. $('a[href=#top]').click(function () { $('body').animate({ scrollTop: 0 }, 50); ...

Jquery write on the fly in a div

I am trying to create a sudoku game using jquery and php. I have all the game logic done am now working user end of it. So what I need to do is be able to click on an empty cell which will be a div which will make that div the active one. Then use the numbers on the key board to enter the number the user would like. They would also h...

Is there a better way of inserting my element into text using Jquery?

Hi, I've written some jquery to solve this problem. Although it works, I can't help think my jquery is terrible & was hoping somebody can tell me that I'm missing something and correct my code to use something more awesome. In particular the string concat that I'm doing (commented as looking 'vomit') is lame. Can anyone unlame it? The...

jQuery problem with .appendTo and ie?

Im not sure if this is an issue with .appendTo() or the way im using it, I've gone over the docs in the api several times now and its still unclear so I figured I would turn it over to the handsome geniuses at SO. I am trying to move some error li's generated by django and everything works fine so far in firefox however when the followi...

jQuery Validator's "required" not working when value is set at statup

Hello, I have a problem with jQuery Validator. I want to use "required" property on a text input. It doesn't work when input has set value attribute by HTML code (tested on Firefox (3.5), and on IE 8 - on IE it works a bit better). Story: 1. Page loads; 2. value is cleared; 3. focus is changed. 4. Nothing happens but the error message s...

Prepend a DIV already hidden so I can animate a slide in

Hello, I use an ajax call to retrieve a div that I want to prepend to my results DIV. I don't want to add the style display:none to the div before it is returned because I use the same code elsewhere and don't want that style attached. That being said how do I prepend an element to a div already hidden so I could use the fadeIn or sli...

Jquery Width / Height Calculator based on aspect ratio?

Hi there, I have a requirement to have a small form with some text boxes on them and a button at the end which with a specified aspect ratio (in hidden textbox) enable the user to type in a value into the width box for example and when the user changes the value the height textbox will change also..also when you type in the height box t...

How to fire event handlers after AJAX content has loaded in JQuery

I'm trying to use an AJAX request to load some information into a table using JQuery. I can load the content easily but I am having problems adding event handlers to apply style on the loaded content. I am applying a striping widget to the table. However when my AJAX request comes back and my information is appended to the table body it...

jQuery 1.4 Dynamically created images aspect ratio incorrect in IE8 and max-width

After upgrading to jQuery 1.4, when I try to add an image to a page dynamically using jQuery 1.4 in IE8, the image will lose the correct aspect ratio. This appears to affect only IE8 (IE7 and Firefox work fine) with jQuery 1.4 (1.3.2 works fine). Including the jQuery compatability file does not fix the problem. <!DOCTYPE html PUBLIC "-...

jTruncate / live()

Hello, I been looking at http://blog.jeremymartin.name/2008/02/jtruncate-in-action.html. It doesn't seem to work for html added to the page after page load. Does anyone know how that would work or if there is a better solution? ...

Linking/unlinking jquery object to an element

I'm using a jquery flowplayer tools plugin http://flowplayer.org/tools/tooltip.html 1)I want a tooltip to be created when user clicks on an element. 2)When the user clicks on another element, the old tooltip must be unlinked(deleted) 3)A new tooltip should be created(or old moved to) for the clicked element 4)So, there should <=1 too...

set width in percentage using jquery

How can i set width of div in percentage using jquery? ...

Simple Modal with Autocomplete in ASP.NET

Hello, I am quite new to this so any help is very much appreciated. I am generating a modal pop using Simple Modal, this works ok. I now want to add jquery autocomplete to the element txtEmail. When I run the page outside of Simple Modal I can use Autocomplete, however when the page is loaded through Simple Modal it does not work. I ...

jquery: LI w/ input inside, how to hide LI when focus leaves the LI and it's children completely.

I have a UL with an LI inside of it, when i click on the UL, the LI inside of it fades in. The Li has an input inside of it (search form), next to it i have a select input to select the section of the website you want to search.(both inside of the LI) I'm trying to get it so that when focus leaves the LI and everything inside of it(sel...

Jquery, how: click anywhere outside of the div, the div fades out.

In Jquery how would i make it so that if i had a div, with different elements inside of it, a select, a search input, etc, that when i click outside of the div, on the page, the div fades out, but i can click on the select and type in the search input and not have it fade? any help is appreciated. -nick ...

jQuery: FadeIn image after it is loaded

Hi, I'm trying to make image being loaded into div with fadeIn effect. Problem is that I don't know how to avoid loading and fading at the same time. I want image to be loaded and after it is completely loaded it should be faded in. http://www.izrada-weba.com/vedranmarketic These are image thumbs: <div id="thumbs"> <a ...

jquery remove parent not working on dynamically created divs

hello to all, im trying to use jquery in order to make a button remove its parent div. my markup: <div class="web_store_fields" id="web_store_input1"> <p> <label for="web_store_address[]" >Store Address : </label> <input name="web_store_address[]" class="web_store_info" type="text" value="http://www." size="35"/> <input class...

Raphael JS and Text positioning?

Hi, I'm trying to position text within the SVG canvas, by supplying x, y coordinates var t = paper.text(50, 50, "Raphaël\nkicks\nbutt!"); but does not position the text like all other objects... x, y coordinates specify the center of the object! Not the "left and top most" pixel! I would like to "left align" the text along a line...