jquery

How to get all of the IDs with jQuery?

I am trying to gather a list (array) of ids in a sector <div id="mydiv"> <span id='span1'> <span id='span2'> </div> $("#mydiv").find("span"); gives me a jQuery object, but not a real array; I can do var array = jQuery.makeArray($("#mydiv").find("span")); and then use a for loop to put the id attributes into another array or I...

How can I get smoother animation for sliding content with JavaScript/jQuery?

I have some content sliding here. http://www.smallsharptools.com/downloads/jQuery/Slider/slider.html The HTML structure is simple. There is an outer box with a fixed height and width with the overflow set to hidden. Then there is an inner container with the width set to the full width of the content inside of it which is a series of di...

jQuery: Is there a way to make this shorter and more elegant?

I have a code that looks like this: <div id="wrapper"> <img id="first" class="images" src="img/nike.jpg" /> <img id ="second" class = "images" src="img/golden.jpg" /> <img id = "third" class ="images" src ="img/a.jpg" /> <img id = "fourth" class="images" src="img/God__s_Canvas_by_Delacorr.jpg" /> </div> I wan...

JQuery - does not fire MVC Controller Action

I have the following JQuery code: // When the document is ready, start firing our AJAX $(document).ready(function() { function showValues() { var str = $("form").serialize(); $("#results").text(str); } $(":checkbox, :radio").click(showValues); $("select").change(showValues); //showValues(); // B...

get a div's origin height

I set the div's css height:130px; overflow:hidden; I want an animation from current height to origin height like this , but I can't get the origin height.one posible way is after dom loaded , store the height in js,like this $(function(){ $('.detail').data('originHeight',$('.detail').height()); $('.detail').css({height:'130px...

Zend Framework routes with ajax friendly parameters

I'm building a REST API with Zend Framework. I have routes setup that are mapped to all the resources I modeled. I also created a RESTful controller plugin to direct the different types of requests (PUT, GET, etc..) to the right controller action. I'm making ajax calls with jQuery and by default it appends GET parameters to the URL for ...

How to fix erratic animation in jQuery

I have built a simple menu in jQuery http://vanquish.websitewelcome.com/~toberua/ Here is a sample of the menu <ul> <li id="your-residences"> <strong>Your Residences</strong> <ul> <li class="menu-1"><a href= "/~toberua/your-residences/deluxe-ocean-front-bure/">Deluxe Ocean Front Bure</a></li> <li cl...

Why does retreiving html from inside a NOSCRIPT return htmlentities?

Considering the code: <noscript><div>FOO</div></noscript> Running $('noscript').html(); returns &lt;div&gt;FOO&lt;/div&gt; but running $('noscript').text(); returns the raw html. This is the opposite of what I was expecting. Is there an explanation for this? ...

Jquery toggle question

Hi Guys, If I Click on the current item it should toggle on and off and close all other item if it is open. When I click on menu1 it just keeps open.. i want to features like when it is open it should close, when it it closed it should open. Please see the url http://207.210.64.138/~paglaso/jquery/toggle.php <script language="javascr...

display none when no images in jquery

I'm using jquery get the src of images to display:none when src="". It looks like that, <div class="parent"> <img src="images_path/or nothing" class="Images"/> <div class="content"> </div> </div> class content float left to fit with images width in parent div. Now I want detect image source when it empty I changed class content....

jQuery loop

I have a couple of Divs with class='CCC'. I want to take all these divs in an array using jQuery and then loop through the array. How to do so. ...

jquery error placement

i've a jquery form. the validations work correctly but i'd like the error to be placed properly. right now it displays in IE 7 as: but i'd like to display it as: this is the css code: div.error { display:none; } <%-- input { border: 1px solid black; }--%> input:focus { border: 1px dotted black; } ...

Fade DIV with cool animation

I am fading a DIV slowly, $(ele).fadeIn('slow'); How can i create a very good animation along with the fadeIn to show real animation power of jquery ...

jQuery synchronous operation

I am fading elements one by one but it seems it all fades at once. How can I fade elements one by one. Only if one fades completely, should the second start fading. I loop and fade it like this $(ele).fadeIn('slow'); ...

Refactoring RJS/Prototype code into JQuery

Hi, I'm struggling to find suitable alternatives for methods in Prototype (converting to JQuery) and wondered if you guys could offer suitable replacements. The RJS code I'm refactoring is: if request.post? && @success page << "window.location.href='/news'" else page.replace_html :user_overlay, :partial => 'login' if @...

Proper way to load ASP.NET MVC partial views with AJAX?

Hey all. Okay here is the situation. I would like to be able to load a series of similar partial views onto a parent page; much in the same way as is being done in this article (simulating AJAX panels). In the article, it appears to be working fine, as it is calling the corresponding action method asynchronously on the controller. Bu...

clearing an HTML file upload field via JS

i want to reset a file upload field when the user selects another option is this possible via JS? i'm suspecting that the file upload element is treated differently b/c it interacts with the user's FS, and maybe it's immutable basically, what i want is something like (pseudo) // choose selecting existing file $('#select-file').bind('f...

JQuery comment box similar to Stackoverflow?

A while ago I had asked how to make a collapsible comment box like Stackoverflow The original question is found here However since then I came across another problem which I am not entirely sure how to go about solving, I am pretty sure that I go about it the same way as the original question but, not quite sure of the syntax. Basical...

What does .d in JSON mean?

Hi, I have a .NET webmethod that I have called from jQuery. The method returns some HTML markup that I display within a DIV element. Once I have the response I use $("#div").html(result.d); My question is, what does the .d do? I don't like using code I don't fully understand? Could I get the same result using Eval? ...

How to get this element using jQuery selectors?

I use jQuery to get values of presaved elements from some websites, using paths like this: HTML BODY #bodyContainer #mainContentContainer #mainContent #productContentRight #swatchContent #colorSwatchContent SPAN The problem i faced when the websites page contains tables and there are same element in another similar path such as: ...