jquery

How would I traverse elements between two known elements in the dom using jquery?

I want to allow the user to click a start point and then click an ending point and be able to manipulate various form elements between the two points that were selected. The page is a table with numerous rows and each row contains the relevant information to manipulate/save an answer to the question in that row. Each row has a hidden in...

How to load some html and append to <body> with jQuery?

I tried the following: $.load("Views/chatBox.html").appendTo('body') is not working! TypeError: $.load is not a function EDIT:The answer should be only one line of code,that's enough,I think ...

Problem with IE7 link over jquery

Hi, I'm testing a website using Jquery. I have a plugin that when you hover over it, it slides down revealing another banner thus sliding the banner below down. I've overlayed a link in using z-index on the bottom banner, but whilst it works in other browsers I can't see it in IE7. Any ideas why? Would moving the styles up help? Or m...

How to highlight div using javascript or jquery

Hi folks.. I spent about hour and did not find any clue how to highlight my div. Ok example my code. 1.proccess.php $_SESSION['msg']='<div class="success">Your account has been updated</div>'; header("location:http://domain.com/account.php/"); 2.account.php if ($_SESSION['msg']!="") { echo $_SESSION['msg']; unset($_SESSION['msg']);...

Jquery Image Switch

Hey guys, I am using an image switch function in Jquery for a site I am building. There are a ton of projects so I am heavily compressing a lot of these images. Some of them however dont look nice as .gifs and it really only makes sense to make a .jpg. My problem is that this code only swaps one image, to another image of a different n...

How to unset id attribute with jQuery?

$().attr('id','') still leaves id = "" snippet, how to completely remove it? ...

how to achieve the following ajax

I am working with php and want to have a page that has a drop down on top. elements in the drop down have some id associated with them. Underneath the drop down there is a text box and underneath the text box some images. so like the following <drop down box> ______________ <textbox _content_ loaded via ajax onchange of drop down box> ...

Any tools for optimizing javascript?

I'm in the process of writing a jQuery plugin, and am getting into some fairly heavy operations, which is making my plugin slower and less responsive. I was wondering if there was any tools out there that would help me optimize my JavaScript? ...

jQuery problem: onClick animate marginTop -= 50px, height +=50px

Hello people, I have hard time understanding and creating a proper function using jQuery. I have 2 main areas in my site. The first is the content area that appears over the other area I named panel. All I want is this panel when I click on a specific link to move a bit upper and to resize to the size of the movement. It should repres...

Count characters in P keeping non-latin characters

I have a script that counts the characters in each of my comments, excluding any Html Tags. But it doesn't take into account that my comments contain åäöÅÄÖ (swedish letters). So how do I edit this to "exclude" these from the regexp variable? (If the comment is "Hej då!" the result is 6, not 7.) Why I need this is a long story, the pro...

Add form element dynamically using javascript -- not submitting

Edit: I fixed the problem by just starting from scratch. Sorry to waste y'alls time. Please vote to close if you feel so inclined. I'm having trouble getting the actual data in a form to submit when the input fields are added via javascript. The fields show up, and in the right place, but when I do a var_dump( fieldname) on the serve...

JQuery: hiding/showing an element within an inactive tab

I've got 3 tabs. Each of them have a div called optional, apart from other elements. optional is initially hidden using Javascript, I dun wanna use CSS ( this is so if js is disabled, the div won't be hidden at all ). So I use this to hide optional $(function(){ $('#optional').hide(); }); Now, this works just fine on the first ta...

Remove all text in between a div without losing text outside of it - jQuery JS

I have some text that is stored in a variable like this: <div class="foo">text inside div</div> outside text here. I want to remove the entire div and the text in it and save the outside text. ...

jQuery cross fading two images on a loop!

Hi, I am having trouble working out how to get a simple fade in fade out loop to work. I am pretty new to jQuery as you can maybe tell. I have had a go at it but now it’s taking too long to work out so I thought I would ask for some help. What I want to do: I have two Images, id's #img1 and #img2. I want image 1 to fadeIn then wait fo...

jQuery DIV refresh

I'm using the simple jQuery DIV refresh code. var refreshId = setInterval(function() { $('#refreshdash').load('dashboard.php?cache='); }, 4000); Right? Some guy informed me that adding "?cache=" to the end of the file that you going to have refreshed, will help lower bandwidth, etc, as he told me that it caches the file or ...

Make scrollLeft, scrollTop changes not trigger scroll event

Hello world, Currently my program is in a spot where it both listens for the user to scroll a certain element, but also, at times, automatically scrolls this element by itself. (Not a gradual, pretty scroll, but an instant jump. It makes sense in context, I swear.) Is there a way to make the scroll event not trigger if the scrolling wa...

jquery unbinding is it necessary? (replacing elements)

I have some elements with events bound. Before I remove those elements, do I need to unbind them first? If I don't will they cause problems? Thanks. Edit: I realized I phrased the question incorrectly, so now I'm making an edit, excuse me for that, I but I think it makes more sense to do this than make a new question. I would have to ...

Moving a background image X pixels every X milliseconds

I have an image sprite of sorts with multiple frames for 1 button. I'm looking to "play" through the frames on rollover of the link/button using jQuery. Currently the image is set as the background of the button using CSS, so I'm looking to change the background position every ~30ms by ~40px along the Y axis (but I can change the directi...

Is there a JQuery version of the ASP.Net AJAX Toolkit Combobox?

This is what I'm talking about: http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ComboBox/ComboBox.aspx basically I want to have a drop down list that can also have a manual text override... is there a jquery plugin that can do this easily? Or should I try and incorporate the toolkit one somehow ? ...

jQuery - Disable Form Fields

Hey all, I have 2 fields: 1 input, 1 select box. Is it possible to make the browser disable one of the fields when the user uses the other? For example, if the user is entering data into the input, the select box is disabled. If the user is selecting data from the select (dropdown), the input is disabled. Any help with this would be ...