jquery

JavaScript TagCloud Avoid Overlapping

I’m creating a tag cloud using JavaScript. It takes an unordered list of 'tags', and then distributes them randomly from the centermost-point of the div (Gaussian distribution). The trouble I'm having is finding an efficient metric to determine if any of my tags are overlapping. Ultimately I came up with 2 approaches: (1) position eac...

Is it possible to use `event.preventDefault()` with a `select` element with jQuery?

I have dropdowns which are dependent on other dropdowns. I decided to calculate the dependencies on click, except it has a nasty side effect of showing option elements, then they quickly disappear and the dropdown list resizes. I wondered if I could use event.preventDefault() on click, and then call the click() event manually after I h...

jQuery - How can I wrap() all elements in one container rather than each element?

I have HTML similar to the following: <fieldset> <legend>Title</legend> <p>blahblahblah</p> <p>blahblahblah</p> <p>blahblahblah</p> </fieldset> What I want to do is wrap all the P's into a single container like so: <fieldset> <legend>Title</legend> <div class="container"> <p>blahblahblah</p> <p>blahbla...

When creating a native JSON array how to limit it to 10 most recent

I am creating a JSON array exactly as follows (bar using mathrandom). For example purposes: var numbers = []; var jsonString = ""; function EveryOneSec() { numbers.push(Math.random()); jsonString = JSON.stringify({'numbers': numbers}); setTimeout(EveryOneSec, 1000); } When I create the JSON string it will obviously just keep g...

jQuery object equality

How do I determine if two jQuery objects are equal? I would like to be able to search an array for a particular jQuery object. $.inArray(jqobj, my_array);//-1 alert($("#deviceTypeRoot") == $("#deviceTypeRoot"));//False alert($("#deviceTypeRoot") === $("#deviceTypeRoot"));//False ...

How to create a local checkboxes by jquery?

example is : But example is php,I dont't understand php how to use. Who can tell me html+jquery how to write? ...

jQuery: Retreving only first attribute of a specific node from XML

Basically, dealing with an XML feed that's not written in the nicest way (Youtube API data), and follows on from a previous question on the topic. Currently, there are four nodes in the file named media:thumbnail. Each media.thumbnail node has various attributes, one of which is url. I am only wanting to retrieve value of the first occu...

Struggling to solve this jQuery div collapse/expand problem

I'm using this example as a basis http://simon.tpdserver2.co.uk/jquery/divgrowdemo.htm, I'm trying to modify it so that instead the jQuery plugin generating an html a-href that allows the user to toggle the expand/collapse (in this case it's in the form of "+ Show More" and "- Show Less" links), that I can use a link that's within the ac...

explorer not following dropdown list option link under jquery

1st new to this list. please pardon any faux pas.... this is the html... (Q1..not sure of syntax for selected option but this seems to work...) <select> <option class=" " value="choose" selected="yes" SELECTED>choose language</option> <option class=" turnoffbuttonenglish" value="japanese" >日本語 </option> <option class=" turnoffbuttonja...

clear specific fields when user changes value of a select

Ok, I'm really starting to have a bad day and the ol' brain isn't working. I can't think of what I should be searching for, or even find previous examples of this kind of thing. I have a HTML form with three fields; select: disposition_status text: disposition_datetime_hasrecord text: disposition_description The select field disposi...

trying to wite js makes whole page go blank

hi, thanks for looking, when i use document.write, the whole pages goes blank and only displays the ad. function __adthis(id) { $.getJSON('banner.php', function (data) { var adNum = Math.floor(Math.random() * data.ban.length); document.write("<SCRIPT TYPE='text/javascript'> SRC='+data.ban[0].link+'><\/SCRIPT>"); ...

alphabetical filter in jquery datatable

I am using jquery datatable(http://datatables.net) for my asp.net mvc (C#) application. I need to add the alphabetical list above the table and need to filter only the list in table. For ex.: I am listing the list of users with Name, Email and Phone in my table. I need to use the alphabetical filter to filter by Name (i.e.) When i cli...

jquery wizard for user registration

Hi I Want some samples for step by step registrations like a wizard. i want to use these samples and asp.net page. Thanks. ...

How to dynamically update jQuery Flot from Native JSON.

Prior Information: (In case you are wondering where I am coming from) First Question: How to set a JS variable every n sec to a JSON array. Thanks to help got that all going well :) I then worked on limiting the total amount in the array, tried to set it to 10 but every time it would stop at 7.. with help from here got this working ni...

Can we edit an exsiting class of an element using jquery ?

Hi, I want to alter styles of an existing class of an element. Can we do this in Jquery? If not, what can be the alternate approach ? ...

jQuery uploadify I/O error UNIX

Hi, I've a problem with jQuery uploadify script and I didn't found any solution. I've integrated this script on my project and everything is working fine on a Windows server(localhost) but when I try to run it on an UNIX server and I/O error is risen. This only happens when I try to upload a file that already exists on uploading folder...

jQuery ajax function not working in Safari (Firefox, Chrome, IE okay)

I'm no javascript wiz, but am a bit puzzled as to how this is working in three major browsers, but not Safari... is there something wrong with this code? Basically I'm just using this in conjunction with a php/mysql callback at the given url to track link clicks. Drupal.behaviors.NodeDownloadCounter = function() { $('a.ndc-link').c...

$.slideToggle() & $.hover() animation queue issue

I'm trying to set up a pretty basic hover animation in jQuery. Mouse over a div and the major content is slid down, mouse up and it slides up. <script type="text/javascript"> $(function () { $('.listItem').hover(function () { $(this).find('.errorData').slideToggle('slow'); }); });</script> This piec...

jQuery FancyBox: How do I increase the width of the element #fancybox-wrap by 10 px?

Hi, In jQuery FancyBox, I need to increase the width of the element #fancybox-wrap by 10 px. What is the easiest way to achieve this? Thanks. ...

is there any plugin for edit inplace without sending any call to server in jquery ?

I need to edit a paragraph in place, but the content will be saved to DB by clicking Save button for the page. I searched for edit in place plugin, but all I found all sends content to server. Is there any plugin which does the same without sending any data to server ? ...