jquery

Modify object using jQuery.map?

I have a key-value pair like var classes = { red: 'Red', green: 'Green' }; How can I prepend each of the keys with a specific value? Could this be done using jQuery.map? The final result I'm looking for is classes = { 'a-red': 'Red', 'a-green': 'Green' }; ...

Add validation to form text input fields

I have the following function which simply creates a number of text input fields based on a quantity entered. <script type="text/javascript"> $(function() { var input = $('<input type="text" name="delegate" id="delegate" />'); var newFields = $(''); $('#bv_qty').bind('``blur keyup change', function() { var n = this.value || 0; ...

attach image or div to mouse cursor in firefox

hi i want to attach the image or div element to the cursor in firefox in my application when mouseover the some element than image will be attached to cursor. thanks rahul ...

How to trigger CTRL+C Keyevent width Jquery?

Hi, I want to simulate a ctrl+c to copy the text into it. I first tried this: $('#codetext').click( function() { $("#codetext").trigger({ type: 'keydown', which: 99 }); } HTML: <input type='text' id='codetext'> I have also tried using $(this) instead of the selector, but the input element also has focus on it, does...

jquery regex replace from select text

I have some text I fetch inside here but only want the currency... How can I get rid of the other values? I tried this, but didn't have any luck. var symbol = $("div.price > h5 > div.num").text().replace(/[\d.]*/, ""); Here's the example html, the selector I'm using works fine, just not the replace. <div class="price"> <h5 c...

efficient way to bind a drag event

i have read a program that have a drag functionality in a table but i really think it is not efficient , here is the code var downState = false; $('#element').delegate('td','mousedown',function() { downState = true; //do stuff }).delegate('td','mouseenter',function() { if (downState) //do stuff }); what i don't like is ...

tabbing between jeditable fields in a table

I'm using code from here http://www.korvus.com/blog/geek/making-the-tab-key-work-with-jeditable-fields/ to get tabbing between jeditable fields working, and if the fields are on their own it works fine. However I need to have my fields in a table, and the only time the tab key works is tabbing from the last field to the first, and of cou...

Is there a jQuery library that can display an image up front and full screen?

I know there are ways to view an image full screen in Flash, but I was wondering if there's a way to do it in Javascript. It would be really great if anyone knew of a jQuery library that could handle it for me. UPDATE: Since its impossible to do true full screen w/out Flash let's just say to fill up the browser window. Thanks for look...

Imagemap Rollover and Tooltip

<img src="http://www.w3schools.com/TAGS/planets.gif" width="145" height="126" alt="Planets" usemap="#planetmap" /> <map name="planetmap"> <area shape="rect" coords="0,0,82,126" href="sun.htm" alt="Sun" /> <area shape="circle" coords="90,58,3" href="mercur.htm" alt="Mercury" /> <area shape="circle" coords="124,58,8" href="venus.htm...

How to get image id using jQuery?

Hi there, I have written code like this. <img id='test_img' src='../../..' /> I want to get the id of this image on image load like, $(img).load(function() { // Here I want to get image id i.e. test_img }); Can you please help me? Thanks. ...

jquery ui datepicker like input widget

i' like to make some jquery widget, which will have behavior like jquery ui datepicker: it should appears when focus on input tag and this widget and should be hidden when user mouse focus not in this widget and input tag, can you help me to say the right way to implement this behavior thanks ...

concurrent execution of event handlers in jquery

I have a horizontal menu in my website, and each for item in menu I have a image and a sub menu.I write an event handler for hover. I should hide all visible sub menu and images before show right image for the menu. But the problem is when I switch between two menus rapidly first one become visible after handler for second one execute hi...

is jQuery the best way of dealing with user interaction in C# .net environment?

Hi, I'm wondering, .net has all these build in GUI elements. The purpose is that we build a .net web application and for the coding itselve I know my way. But as for user interaction, ajax, etc.. I'm very familiar with jQuery in PHP but I noticed that in .Net everybody starts using it too. Is jQuery the best way these days to deal wit...

jquery: return html from div and not children

If I click on #parent I want to return the text inside it and not return the text inside nested layers (#child-parent, #child) <div id='parent'> this text is for parent <div id='child-parent'> this text if for child-parent <div id='child'> and this text is for child. </div> </div> </div>...

Losing focus after focusing using jQuery

jQuery('.CommentFormTextarea').focus(function (e) { jQuery(e.target).animate({ height: '7em' }, 300, function () { jQuery(e.target).nextAll('.CommentFormSubmit:first').show(); }); jQuery(e.target).prev('label').hide(); }) .blur(function (e) { if (jQuery(e.target).val().length <= 0) { jQuery(e.t...

Turn off anchor url redirecting with jquery

I have a page set up with tabs that includes the history function so it appends the url with the ID of each tab. Inside one tab I have a set of anchor tags, like a FAQ section. The problem is that the anchor ID's are messing up the url, it removes the tab ID from the URL and adds the anchor ID. Is there a way to turn off the URL redirect...

IE7 kills my jQuery drop down on main navigation menu

The drop down obscures the other items in IE7 http://southasianlitfest.com CSS #nav { _height:57px; float:left; min-height:57px; padding-top:15px; width:960px; } #nav ul#pages { float:left; } #nav ul#pages li { float:left; text-transform:uppercase; } #nav ul#pages li .sub-menu { -moz-border-ra...

Binding to the change event in dynamically created dropdown list using jQuery

I am creating a number of dropdown lists dynamically using jQuery. I would like to be able to trigger an event when the selected dropdown list item changes. From browsing on here and elsewhere I see that it's not possible to bind to the change event of the dropdown lists using live() so I am wondering what are the alternatives? I know it...

DevExpress ASPxGridView callbacks and jQuery

Hi, we have a DevExpress ASPxGridView in our webapp with EnableCallbacks=true to allow client side events for this grid. As soon as we include jQuery (1.4.1 or 1.4.2) and perform eg. a filtering on the ASPxGridView, all client-side grid functionality stop working. We have tried the solution discussed here http://www.devexpress.com/Sup...

How to use jQuery to select this parent?

I have a recursive menu where I need the children items to effect the parent. In my example below, how do I add a "selected" class if any of the children have a "selected" class? <ul> <li class="administration first"> <a href="/administration.aspx"><span>Administration</span></a> <ul> <li class="users fir...