jquery

Is there a workaround to trigger an option.click event in IE?

I am using a dropdown to allow the user to sort search results. These results in a table but not all of the sortable criteria are represented by columns. The columns can be sorted by either clicking on the column header or using a 'Sort By' dropdown. The user can reverse the sort by clicking on the sorted columns header. I am trying to d...

shall I move from prototype to jquery?

Lastly I've been feeling like jQuery is slowly becoming the defacto standard in JS libraries (I might be wrong!), or at least that is more active than the rest of the frameworks. For example, I've been looking for a fine open source calendar like Componente and found http://fullcalendar.vinsol.com/ which is based on jQuery. We've been ...

jQuery: delegating clicks to elements that contain other elements

So i get the gist of $.delegate and I know why it's doing what it's doing, but I'm wondering if there is a work around. I have link elements that contain spans like so: <a href='#'> <span>Person Name</span> <span>Person Info</span> </a> I use the following code in jQuery for event delegation: containerElement.delegate('click...

In an ASP.NET MVC site, where would the JQuery code go?

I'm just getting started with ASP.NET MVC. I'm going to be using JQuery on the website I'm making, but I'm not really sure about one thing: where would JQuery code be placed? This concerns two things: Where do I import the JQuery JavaScript file? (I've been thinking that the Master page would be a good place to do this; am I right, o...

Superfish drop down menu, how to fix z-index in ie6 and ie7?

I am using the superfish plugin for jquery here: clicky it works fine in all modern browsers FF,Safari, Chrome, IE8 but it seems like the z-index is not working in ie6 and 7 you can see the menu is appearing, but being cut off by the elements below it. I have tried adding a z-index everywhere I can think of but nothing seems to fix t...

jquery animation headache

Doing some jquery animation. I have certain divs set up with an attribute of ani_seq='x' where x is 1 to 9, and then have a class assigned of 'animate'. I am using the following code, which works fine, and fades in each item in sequence: function my_animate( in_wrapper_id ) { $j("#" + in_wrapper_id + " .animate").hide(); // ...

Issue with jQuery setting checkboxes as checked in IE6 (not showing as checked?)

The Code: var lstInstanceIds = getData.lstInstanceIds.split(','); for(var i=0; i<lstInstanceIds.length; i++) { var value = lstInstanceIds[i]; $('input[value=' + value + ']').attr('checked','checked'); } So all i'm doing is looping a list and setting the attribute checked as checked where the values meet. This ...

JQuery load help

Hi. I am trying to use load() to place some html into a div on a page. I have a bunch of links like this: <div id="slideshow"> <div id="slides"> <div class="projects"> <a href="work/mobus.html" title="Mobus Fabrics Website"> <img src="images/work/mobus.jpg" alt="Mobus Fabrics Website" wid...

jQuery code works for console but not in-page.

I have a form element defined as: <div class="field"> <div class="name"> <label for="User_LastName"> Last name: <span class="asterisk">*</span></label> </div> <div class="value"> <%= Html.TextBox("User.LastName", Model.LastName)%> <%= Html.ValidationMessage("User.LastName")%> </div> </...

get click from a link inside a google maps info window

I m making a google maps with some coordinates and directions and when a user clicks a marker and appears a info window there's a link avaliable, when user clicks it, i want to catch click event inside info window, and make zoom to this marker, anyone had to deal with link clicks in google maps api could help me with some links, document...

Clear form field after select for jQuery UI Autocomplete

I'm developing a form, and using jQuery UI Autocomplete. When the user selects an option, I want the selection to pop into a span appended to the parent <p> tag. Then I want the field to clear rather than be populated with the selection. I have the span appearing just fine, but I can't get the field to clear. How do you cancel jQue...

jquery event listening, non-standard events

I'm attempting to build a way for my selectors to 'listen' to 'global' events that are beyond the typical 'click' 'change' 'submit' etc. I've explored the various 'eventmanagers' that I could find, and they're all still designed for forms. Is there any way to do something like this for non-standard (i.e. custom) events? The goal is to ha...

How can I remove an inline onclick attribute with a bookmarklet?

There is an annoying website out there that foils attempts to "open in new tab" by using <div onclick=> instead of <a href=>. I've written a bookmarklet, using jQuery, that creates a wrapper <a> tag and inserts it within the <div> around its content. How can I remove the original onclick handler? ...

Append or prepend opening/closing tags with jQuery

I'm trying to wrap replies in a comment stream in a like this: $('li.comment').next('li.replycomment').append('<ul class="thread">'); $('li.replycomment').next('li.comment').prepend('</ul>'); It doesn't work unfortunately. If I do the following it works no problem: $('li.comment').next('li.replycomment').append('<ul class="thread">...

Simple jQuery code contains a syntax error that I can't find

I've got this (remarkably) simple JavaScript function that is called when a user clicks a "Cancel" link: function hideNewUserPanel(){ $('#create_user_panel').slideUp('slow'); $('.right_interior_panel').slideDown('slow'); } And the code to add the handler: $(function(){ $('#cancel_create_user_btn').live('click', f...

Using jQuery to echo text

Is it possible to use jQuery to echo text in place of a script tag? More precisely, is there a way to accomplish <script type="text/javascript"> document.write("foo"); </script> ... without the use of document.write? I am not happy about using document.write after reading this. I am aware that I could alternatively do this: <spa...

Developing a jQuery plugin that returns a given object, instead of jQuery object itself!

Hi, Consider the following base code: (function($) { $.fn.myPlugin = function(settings) { return this.each(function() { //whatever }); }; }); The plugin returns a jQuery object. The question is how am I supposed to write a plugin that returns a custom object so that I can do something like this: v...

Can jQuery animate() behave differently for specific elements within my selection?

I have a selection of elements in a jQuery object. I want to animate their font sizes, but as I have both the headlines and various paragraphs in the selection, they should be animated slightly differently, as the headlines should end up with a larger font size than the paragraphs. I already have this information stored in the jQuery dat...

jquery toggle, prevent clicking during toggle

Given the following jquery code.. jQuery.fn.sliding = function () { return this.each(function () { $(this).bind('ON_CONTENT_CHANGING', function (e) { $(this).block({ overlayCSS: { opacity: 1, color: '#000' }, timeout: 800 }); }); $(this).bind('ON_CONT...

How to convert a fixed height/width-fixed layout to elastic?

I used the same software used here http://us.gn.bartal.org/ to create a fixed width/height treemap in HTML + CSS. I would like to make it elastic by having a JavaScript function to convert all pixels absolute positions and sizes to percentages. How would you suggest to proceed? Is there some jQuery/Prototype/Dojo magic that I can explo...