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' };
...
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;
...
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
...
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...
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...
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 ...
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...
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...
<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...
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.
...
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
...
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...
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...
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>...
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...
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...
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...
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...
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...
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...