jquery

WIth jquery, if a div has 2 classes in it, can I still add events to it?

If a div tag looks like: <div class="class1 class2">blah</div> Isn't this suppose to still work? $(".class2").bind("click", .... ); Or does having multiple classes for a element screw things up? ...

jquery.form plugin and jquery.validate not .. validating?

I have been trying to get these two plugins playing well all day. Currently if you hit submit, it will submit the empty form, and if you hit it again, it will validate (and not submit). I feel I am missing something obvious. $(document).ready(function() { $('#form_contact').submit(function() { return false; }...

adding a new dom element, want to rebind

After adding a new DOM element after a ajax request, the click event for the newly added item doesn't work. I tried to first unbind then bind, but I get an error. $(".someclass").unbind("click", someEvent); $(".someclass").bind("click", someEvent); Am I doing something wrong here? (in theory)? ...

jQuery .click function doesn't work with middle button.

Hello, I have the following code: $(document).ready(function() { $("#TestLink").click(function() { $("#LinkHolder").html("test"); }); }); <span id="LinkHolder"> <a href="SomeLink" id="TestLink" target="_blank">Click here to test</a> </span> Everything works like a charm when I click with left ...

How to remove an element's content with JQuery?

Say I have a div and some content inside it. <div> Content </div> With JQuery, how do I empty the div without removing the div, only the content inside? ...

Does jQuery do any initial processing?

Simple question. If you include jQuery in a page of HTML, is there any initialization overhead before one uses any jQuery functions. ...

How to use Jquery.Validate plugin with a iframe?

Hi I have a Rich Html editor called JhtmlArea and it makes a Iframe over a textarea. I have a validation set on this textarea but since JhtmlArea makes a Iframe it hides the textarea and nothing is every inserted in this. So my validation will never fire. So how can I validate a iframe with jquery.validate? http://jhtmlarea.codeplex.c...

Different background position every click

Hi, Im trying to build sort of slide where when click on link ".animate" will change it position ( every time 100px more) This: $(function(){ $('#m-main').click(function(){ $('slide').animate({top : "100px"}, {duration:500}) }) }); will work only once. How can I make this working? Many thanks for your help. ...

jQuery: Load background image from css class into variable?

How can I load the background-image (url) from a css class into a JavaScript variable (preferably using jQuery) ? Example: .myCssClass { background-image: url(/images/checkered.gif) no-repeat; } ...and now load checkered.gif into a var CheckeredGraphic = ??? using JavaScript. ...

jquerytools scrollable - How to get the nav arrows to scroll only the active scrollable?

Hey guys, so that's pretty much my question. My problem is that i have multiple scrolls being initiated from a single statement like so: var all = $('.scroll').scrollable({ size: 1, loop: true, speed:350, onSeek: function() { // upon slider click or arrow click, execute } }); ..and I have 2 sliders.. the o...

In ASP.NET MVC, deserialize JSON prior to or in controller's action method.

I am working on a website that will post a JSON object (using jQuery Post method) to the server side. { "ID" : 1, "FullName" : { "FirstName" : "John", "LastName" : "Smith" } } At the same time, I wrote classes on the server side for this data structure. public class User { public int ID { get; set; } ...

GWT and jQuery: how to use jQuery to remove Events generated by GWT code.

How can I use jQuery to remove a click event on an Anchor generated by GWT? For example, I have some GWT code like this: Anchor a = new Anchor("name") a.addClickHandler(new ClickHandler(){ public void onClick(ClickEvent event) { //do something } }); So it generates HTML code like this: <a tabindex="0" class="gwt-Ancho...

Dynamically resize input

Hey all, I was just wondering how do you dynamically resize an input as you type in it?? I'd like to use jQuery if possible & I would rather it be a small script than a bulky plugin. Please let me know, Matt Mueller ...

jquery: Passing this to child function

I have something like this: $('element.selector').live("click", function (){ run_some_func (); }); $('element.selector2').live("click", function (){ run_some_func (); }); Now in the function I need to use $(this): function run_some_func () { $(this).show(); } How do I get the function to know that $(this) is element.selector...

Whats the easiest way to reactive a submit() action that was cancelled with 'return false'

I have some image buttons that have jQuery event handlers attached to them. I want to make an AJAX call in the click() event to determine if the action should actually be allowed. Because I am doing an async ajax call I have to return 'false' to immediately cancel the event and wait for the response. $('[id^=btnShoppingCartStep_]').cli...

Resizable alsoresize in one direction only

I am trying to use the jQuery UI Resizable feature. I would like to only add a south/west resize handler on one object, so it will resize to the west and south. When it resizes, I would like to simultaneously resize another object, but only in the 'south' direction. I am trying to use the alsoresize property, but it seems always resizes ...

JQuery: Open popup after hovering

Hi there, I'm using ASP.NET with C# I need to display a popup panel (doesn't have to be a panel) when i hover over a UI element. The user may click on buttons on the panel which will envoke Ajax calls How can i go about this? Any code samples? ...

Validate before post

Dear Professors! I have this little code (part of my regsitration code) : <?php if (@$_POST['Submit'] == 'Register'){ if (strcmp(md5($_POST['user_code']),$_SESSION['ckey'])) { die("Invalid code entered. Please enter the correct code as shown in the Image"); } } ?> <form name="form1" id="signupForm" metho...

JQuery validate plug in: Why will this select menu not validate() ?

I Have a large form with hidden divs, an initial select menu reveals the appropriate div (reduced to just one option here for brevity)... when that containing div is made visible I want to use the validate plugin to validate the next select menu. I use this rule, which works for the initial select menu salesProduct: { required: "...

jQuery animate goes under element when element is moved out side its container

I have element that is inside container with position relative and when I move this element out side of container, it disappears. But I need that element to be shown after it is out of its own container. So how can I make that element to be shown after it goes out side of its container? <div class="container"> <div class="moving-ele...