jquery

JQuery: selector performance

I have the following HTML: ... <div id="panel"> <div class="abc"> <p class="xyz">Hello</p> </div> </div> ... Question: What's the fastest way with JQuery for me to access the p.xyz element? I've read some performance reviews but they don't account for all different scenarios. I could do the following, but don't know h...

jquery append() - get appended elements

I'm using jQuery.append() to add some elements dynamically. Is there any way to get a jQuery collection or array of these newly inserted elements? So I want to do this: $("#myDiv").append(newHtml); var newElementsAppended = // answer to the question I'm asking newElementsAppended.effects("highlight", {}, 2000); Thanks ...

How do jQuery modal box plugins compare?

There is a huge number of jQuery modal box plugins out there. Jitter lists 20 of them in this response (http://stackoverflow.com/questions/1656086/modal-windows-plugin-to-rails#1656105). Which one do you use and why? If you use different ones in different cases, how can they be broken down categorically by use-case? ...

How can I associate a live event with an index selector using jQuery?

I have the following HTML: <ul id="tabs"> <li><a href="...">One</a></li> <li><a href="...">Two</a></li> <li><a href="...">Three</a></li> </ul> I want to perform a unique action when someone clicks on each of the links. I tried the following and it did not work $("#tabs li").eq(1).live('click',function(){alert('ONE....');...

jQuery textarea append newline behavior

I'm trying to append a strings which end in newlines to a textarea using jQuery. However, different newline tokens show different behavior in Firefox3.5 and IE8, and I can't seem to find a way to use something that works for both browsers. \n works in FF but not in IE <br/> and \r\n work in IE but not in FF No luck using <pre></pre> ta...

jQuery AJAX POST New Line Problem

So on our site we currently have a textarea for commenting on certain items. The site uses AJAX so the user can press the button and see their message fade in (Imagine a Facebook style commenting.) The jQuery/AJAX: $(function() { $("input#comment_submit").click(function() { var comment = $("#comment_box").val(); var dataString = 'comme...

Lightbox not working after external loaded page with images

Hello, I have implemented lightbox-plugin for jQuery of krewenki in a masterpage including all images. This was working fine. Till i put the images in a external page and load this external images page in the master document. Lightbox does not work anymore. Is this jQuery code fault, or is this a lightbox-plugin problem? Main-html <h...

jquery plugin local variables between methods

I'm with trouble with a jquery plugin i've quickly playing around. Its fades in when a start handle event of ajax is called and stops with complete handle. Exemple: start : function (e,o) { target.mask(); target.showMaskAjax(); }, complete : function (e,o) { target.hideMaskAjax();.... }, The question is..when I fire 2 ...

How to change an element to be unclickable after clicking it once using Jquery or Javascript

The code is: <a href="#" style="color:black" onClick="Record($id)">Done</a> I want this part becomes unclickable once if it is clicked, how to achieve this using Jquery or Javascript? ...

is it possible to get the total width of a jquery tab?

is it possible to get the width of the different tabs with different lengths of text inside? for instance | tab 1 | motion sickness | computer | the tab 1 = 20px motion sickness tab = 100px computer tab = 60px something like that ...

Data Cache Problem

Hi, Facing one major problem related to cache. I have User Creation form in that , if i put value which is already used in textfield then it does not shows "Check Availability" hyper link. but if i put new text then it show hyper link on change of textfield value event. Code is written in Jquery. I think it's issue of data cache .What...

Static message above the page in html

Hi, I have a web page with lengthy contents. I just want to put some message at the bottom of the browser window and this message should always be visible even if you scroll down the page. can you guys tell me how to go that with simple css, html, jquery or in PHP thanks ...

JQuery change text on button click "flashes" the text

EDIT: Thanks guys - perfect! I wish I could check more than one answer, since you both gave me the right answer. Quick response! I have the following jQuery function: $(document).ready(function(){ $('#login_btn').click(function(){ $("#message").text("button was pushed"); }); }); It works - the text of the me...

jQuery/AJAX: each, if, post, .html: Runs but randomly deletes data

I've got a PHP page, with FedEx & UPS tracking numbers in a MySQL database echoing into ID's of DIVs with the class "trackingnumber". My JS each's through those divs and grabs the ID to then post to a PHP page that polls Fedex/UPS and echos the result from them. That works great, except for one thing. It randomly deletes the data after i...

Dynamically resizing an embeded video with jQuery?

I've tried a few ways but nothing seems to work. What I'd like to do is have my users post video's with the given embed code (example): <object id="cnbcplayer" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="380" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;...

My Jquery working fine at localhost but when I upload it ti http server it doesnot work!!

I have used jquery plugin for photo upload an validation of field in codeigniter it works my local server fine but when i upload it then it does not work. (I saw phpinfo() jqueryenable server). There is no problem with the url link of jquery its getting fine but not working how can i solve it? link is http://www.bdshop247.com/StoneBollar...

how to disable autoclosing of tags in jquery

Hi, I want to break my <ul> into multiple <ul> tags, I have 10 <li> in my <ul> and I want to break into 2 <ul> (5 <li> each). To do the same, I am taking 5th <li> and appending </ul><ul> using $(this).after(). But Jquery automatically reverse the text and auto close the <ul>. Any Idea how to disable to auto close? Cheers, Felix ...

jquery toggle multiple divs turning one on and the rest off

Greetings, I'm trying to think of a way to use an accordion widget (which I'm currently using, h3 is the trigger) that when an h3 is selected another div appears, then when a different h3 is selected, a new div appears and the other disappears and so on. so I have a three column layout, left column is my accordion widget, when the...

how to change all div values on a page

Hi there, i have three div's on a page with same ID's <div id="downloaded">1200</div> Now when i call the function downloadThis("filename","divID"); i want that the value of every div with id "Downloaded" should change, i am using jquery. Kindly help. ...

Get browser width and hide element depending on size?

Hello. Is it possible to detect what width a browser window is and hide an element on page if its lower than 1024? In JQuery perhaps? :-) ...