jquery

Getting the first image elements id within an unordered list using JQuery

I'm trying to get the id of the first element of an unordered list using JQuery. Here's the list <ul class="list"> <li><img id="1" src="image1.jpg" name="image1" /></li> <li><img id="2" src="image2.jpg" name="image2" /></li> <li><img id="3" src="image3.jpg" name="image3" /></li> <li><img id="4" src="image4.jpg" name="image4" /></li> <l...

How do I remove descendant elements from a jQuery wrapped set?

I'm a little confused about which jQuery method and/or selectors to use when trying to select an element, and then remove certain descendant elements from the wrapped set. For example, given the following HTML: <div id="article"> <div id="inset"> <ul> <li>This is bullet point #1.</li> <li>This is bullet point #2.</li>...

possible to constrain jQuery resize to x or y axis, like drag constrain?

This jQuery lets you constrain drag movement so it occurs only on the axis specified: $("#draggable2").draggable({ axis: 'x' }); See: http://jqueryui.com/demos/draggable/#constrain-movement This is not legal jQuery but I wish it were: $("#Container").resizable({ minHeight: 150, containment: {axis:'y' } }); Is it possible to preven...

I can get access to object's properties if method is called from anonymous function, but I can't do it if method is called directly. Why?

Hello, $.Comment = function() { this.alertme = "Alert!"; } $.Comment.prototype.send = function() { var self = this; $.post( self.url, { 'somedata' : self.somedata }, function(data) { //using anonymous function to call object's method self.callback(data); } ); } $.Comment.prototype.c...

Switching Element Location Via JQUERY

Dear Experts, I wanted to achieve an effect to switch the position of the 2 HTML Divisions when they are clicked. So when clicked, the top will shift to the bottom and bottom will shift to the top. Here is what I can come up with <html> <head> <script type="text/javascript"> $(document).ready( function(){ $('div').clic...

Set attribute disabled to options NOT containing a certain string

I know this should be easier if I could only use optgroups. But I am trying to avoid hacking core of my CMS, so jQuery should come to rescue again, hopefully. I have a select with options in a hierarchy sometimes, and I want to put attributes disabled to any of options containing text NOT starting with a dash. I want to code like: Set...

Show Fancybox after form validation success

Hi, I'm using jQuery+asp.net webforms, also I'm using jQuery Validation plugin and Fancybox plugin. My code works fine when I use the plugins separately. My webform is for user registration. I use validation plugin to validate my form before it's submitted to the server, the form is validated and submitted when the user clicks an asp.ne...

Suppress "Done, but with errors on page" in IE

I have a website using lots of jQuery and JavaScript that produces a "Done, but with errors on page" message in the footer of IE. Everything on the site works perfectly, so I don't want to spend the time troubleshooting the exact error. All I would like to do is suppress the "Done, but with errors on page" message so that clients don't ...

"invalid label" Firebug error with jQuery getJSON

Hi all, I'm making a jQuery getJSON request to another domain, so am making sure that my GET URI ends with "callback=?" (i.e. using JSONP). The NET panel shows that I am receiving the data as expected, but for some reason the Console logs the following error: "invalid label". The JSON validates with JSONLint so I doubt that there is a...

How to make placeholder varablies in jquery validate 1.7?

Hi I am using jquery 1.4.2 and jquery validate 1.7(http://bassistance.de/jquery-plugins/jquery-plugin-validation/) Say I have this example that I just grabbed off some random site(http://www.webreference.com/programming/javascript/jquery/form_validation/) 8 <script type="text/javascript"> 9 $(document).ready(function() { 10...

Function Triggered before fadeOut(); is finished

Hi I'm new to javascript/jQuery this really has me stumped. What I'm trying to achieve here is On toggling a#sameDayTab jquery will look for .changeAlert and fadeOut it's container div, when toggled again the div will fade in (this works well.) Each toggle will also call a function that tells me how many .changeAlert's are present o...

Good sample of asynchronous comment system for ASP.NET MVC, JSON and JQuery

Good morning can anyone jot down a complete sample for creating an asynchronous comment mechanism like this, but focusing on ASP.NET MVC? ...

Can I copy the CollapsiblePanelExtender in jQuery as one method?

I am beginning the process of moving away from the AjaxControlToolkit and toward jQuery. What I want to do is have one function that duplicates the functionality of the CollapsiblePanelExtender. For a particular set of hyperlink and div, the code looks like this: $('#nameHyperLink').click(function() { var div = $('#nameDiv');...

Is it possible to do an Ajax request for an ICS file?

I am trying to do an Ajax request for an ICS file. Yeah, I know it sounds crazy, but I found the perfect library to parse the iCal data. Any ideas why the data comes up blank when I do this? $.ajax({ success:function(data){ alert(data); }, url:"http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=15714&amp;cat=98&amp;platfor...

Are scripts hosted at Google cached accross multiple sites?

If I visit 1 website www.abc.com that has a reference to say jQuery hosted at Google Code, and then I visit a 2nd website www.xyz.com that has the same reference - will the file be cached across both websites? i.e. will it re-download it on the 2nd website, or just use it from cache? ...

Flash VS jQuery for RIAs development : Which one is better to use and for what reasons?

Can anyone please explain for developing rich internet applications which one of these two technologies (Flash VS jQuery) is better to use based on criteria such as "Pros and Cons, time, cost, situations and etc..." and why? Please explain in details, it is very confusing. Thank you. ...

JQuery: Remove duplicate elements?

Say I have a list of links with duplicate values as below: <a href="#">Book</a> <a href="#">Magazine</a> <a href="#">Book</a> <a href="#">Book</a> <a href="#">DVD</a> <a href="#">DVD</a> <a href="#">DVD</a> <a href="#">Book</a> How would I, using JQuery, remove the dups and be left with the following for example: <a href="#">Book</a...

Javascript rotator showing 3 items with 1 highlighted?

I want to make a rotator for a Twitter feed on my site that will cycle through all the tweets in a way that shows 3 tweets at a time. The center would be highlighted and larger while the other two would be smaller and behind the middle one. They would then rotate through on a timer. I normally use jQuery and would think the Cycle plugin...

Jquery Count up Animation?

I have a a counter that needs to count up from $0 to $10,000 in x seconds (most likely 3 seconds). Just straight text, kind of like a millisecond countdown timer, but upwards and with a dollar sign. I'd rather not use a bulky plugin as this just needs to loop through 1-10,00 in x seconds and update every 100ms or so. I'm stuck at crea...

jquery ui autocomplete not working in ie8 (until page refresh)

Hello all, I am using jquery ui autocomplete it is working absolutely fine in all browsers except ie8. I have been doing some testing and there seems to be a strange bug. When I click on a link leading to the relevant page there is the following error generated by ie8 when I start typing in the autocomplete box: 'object doesn't support...