[jQuery] Binding a unique single and double click command
I'm trying to write some jQuery to do the following: If a user clicks once on an object, do X. If a user clicks twice on an object, do Y, but not X. I've been having some trouble with this as, obviously, a double-click will trigger the single-click twice. Here is a failed attempt: $('.todo_item h2').live('click', function() { var startTime = new Date(); $(this).mousedown(function() { var endTime = new Date(); if (Math.abs(endTime - startTime) < 300) { editInPlace } else { showExtra } }); }); where
[jQuery] (autocomplete)
I'm trying to use the plugin with generated json, but the parse isn't going very well... My json, that is being produced is something like that: [ { "id": "9887", "nome": "Salvador", "estado": "BA" }, { "id": "9890", "nome": "Salvaterra", "estado": "PA" }, { "id": "9888", "nome": "Salvador das Missões", "estado": "RS" }, { "id": "9889", "nome": "Salvador do Sul", "estado": "RS" } ]. Is there something wrong? i tried to pass my formarItem function but did not work, the plugin is not parsing my json...
jeditable br tags
Hi All, I have just setup jeditable for a text area and this works fine however when I activate / click on the text area to bring up the editor, the content is filled with br tags (example below) Any ideas on how to convert the br tags into \r\n tags before it is displayed? Thanks comment 001<br><br> <br><br> comment 002<br><br> <br><br> comment 003<br> Comment 4 jquery code $(".editable_textarea").editable("update-comment.php", { indicator : '<img src="/intranet/media/icons/indicator.gif">',
[jQuery] Drag and drop file upload
This is a request for help from people who have Google Gears installed. Could you try the following demo: http://www.appelsiini.net/demo/gears_upload/demo.html Just drag and drop image or multiple images to the page and they are uploaded. I try to figure out if there are any browsers with which this does not work. I already know Gears is broken with FireFox 3.5.x. This should be fixed in next Release of Gears. -- Mika Tuupola http://www.appelsiini.net/
[jQuery] Unable to detect Ajax cross domain error (Firefox)
Hi, Using Firefox 3.5.3 (and firebug) I run the Ajax code below locally (i.e. not on the same domain as the Ajax URL). Unlike in IE, this code is not working in Firefox due to cross-domain Ajax restrictions. Of course, as soon as I upload the code to my PHP server on the same domain it runs fine. However, when running the code locally the 'error'-callback never gets triggered. Instead, the 'success'-callback always get triggered even though the request clearly failed (as confirmed by the fact that
[jQuery] Autocomplete plugin - varying the ac_results class for different instances
I've been using the jquery autocomplete plugin by Jorn Zaefferer (thanks for the nice work). My problem is that results are returned in a class="ac_results", and I'd like to edit this class name at will with the initialization of every instances so I can put them into different groups for styling purposes. I customized the styling of ac_results using the plugin's css file to fit me needs, and that worked fine, because so far I needed only one instance (or rather similarly-styled group of instances).
[jQuery] SimpleModal box in the window that contains an iframe
Hi Everyone, I am using Eric Martains Simple Modal dialog box. Here is my problem. I have a page, (which we will call page A) that contains an iframe (which we will call page B). I can modify page B, the iframe, but I can not modify page A, the containing page. I would like to display the modal dialog box in page A, but have the code and modal div html in page b. Is this possible. This is a tough problem to describe, but hopefully i have done a decent job. Any questions, please ask and I will get
[jQuery] Firefox only selecting first element with given class
I am having an issue in firefox 3.5.3 I am using the following selector $("#arrivalAirport .arrival").hide('slow'); I have a set of radios wrapped in span tags with the class of arrival as such <div id="arrivalAirport"> <span class="arrival"><input type="radio" name="arrivalAirport" value="fortware" />Fort Ware</span> <span class="arrival" id="tskay"><input type="radio" name="arrivalAirport" value="tsaykey" />Tsay Keh</span> <span class="arrival"><input type="radio" name="arrivalAirport" value="princegeorge"
[jQuery] How to create self-closing media playback? (media plugin, or alternative?)
Hi - for a project I'm working on I want to make a video which will close itself when playback is complete. The idea is - on loading the page a container div will appear and auto- play the video, then when playback is complete the video will be unloaded and the container will disappear. Invoking the container and the video player is no problem for me, but I am at a loss when it comes to detecting the completion of the video - is there a 'completed' event or an 'autounload' option?
[jQuery] Autocomplete plugin: results as table?
Hello, For a project I am working on I've successfully implemented the autocompleter (http://docs.jquery.com/Plugins/Autocomplete) and although it works like a charm, I would like to give the results a different markup. Currently, all rows are displayed as LI elements which makes perfect sense, but I would like to group my results in rows and columns (like a TABLE). (I understand this wish is not only a matter of different markup). A live example to illustrate what I would like to have can be viewed
[jQuery] jQuery Right click menu
Hello ! I'm jQuery newbie and now trying to build an application with jQuery Grid interface. My page is that --- http://djalmabina.orgfree.com/jQueryGrid/jQuery_Grid.html The left side frame is a XML menu , tree2.xml what loads another html files within my webserver. JS source code is that : jQuery("#west-grid").jqGrid({ url: "tree2.xml", datatype: "xml", height: "auto", pager: false, loadui: "disable", colNames: ["id","Projects","url"], colModel: [ {name: "id",width:1,hidden:true, key:true}, {name:
[jQuery] jQuery Sprite Factory
A jQuery factory for creating sprites from images. Each sprite created from a Sprite Factory is assumed to be the same size Features * Works from a rectuangluar grid of sprites. * Fast, good for rendering large numbers of similar sprites * Preloading CSS for large images (will add the 'loading' class to the element until the image has been loaded) * Can use transparent PNGS for IE6 and IE7 * Light mode, using half the number of elements (only suitable for non-transparent images) Demo => http://weepy.github.com/sprite-factory
[jQuery] Multiple checkbox validation
<div> <ul id="sortable"> <li id="1"><span></span> Item1 <input type="checkbox" id="chk1" value="1" /><img src="images/close.gif" onclick="ClearSearchDataOnClose1()" /> </li> <li id="2"><span></span> Item 2 <input type="checkbox" id="Checkbox1" value="2" /><img src="images/close.gif" onclick="ClearSearchDataOnClose2()" /></li> <li id="3"><span></span> Item 3<input type="checkbox" id="Checkbox2" value="3" /
[jQuery] adding filters in the middle of a selector brings Firebugs warning
Hi, If I am doing this: alert($(".ivts_thead").find("tr:first").find("td").length); alert($(".ivts_thead tr:first td").length); I get in both cases the same result, the expected elements are in my object, but in the second case, I get a Firebug warning saying "Unknown pseudo-calls or pseudo-element 'first'". This happens each time I am adding any :filter to any selector which uses more than one single expression. Does that mean that I should create my selectors as I did in the first case? That wouldn't
[jQuery] JQuery And The MIT License Question
I know this might have been asked before but I would like a final and complete answer as it pertains to my situation.. I have a commercial webapp that I will be selling I would like to include the jquery library in my web app under the MIT License. I just wanted to verify that jquery under the mit licence means including the mit licence wording with the orginal copyright statements inside the jquery library and that this included library will not in anyway affect my own license in the overall webapp
Help a noob? Trying to use slideDown
Hi there, I'm trying to do something REAL simple with jQuery just to get me going. I've been scratching my head over this for a while now. Here's the jQuery code I'm using: <script src="js/jquery.js" type="text/javascript"> $(document).ready(function() { $("#contact").slideDown(); }); </script> #contact is a div containing just two lines of text that I want to slide down when the document is loaded. I have set the div to a specific width and height, but still cannot get it working. My jQuery.js file
[jQuery] Accordion in IFrame
Hello, I am working with DotNetNuke and the Accordion widget from JQuery. The problem is that the DNN-page is loaded in an IFrame so i cannot acces the accordion. <div class="dvFrame"> <iframe class="IFrame" marginheight="0" marginwidth="0" frameborder="0" runat="server" id="frmDNN" ></iframe> </div> The contents of the IFrame is loaded dynamically. I have tried to acces it this way: $(""#frmDNN #accordion"").accordion({ header: ""h3"" }); and many other ways, but still can't find the solution if
[jQuery] Toggle Classes
Hi Can anyone help? I'm trying to toggle a class on the span .arrow when you click .msg_head. I have several classes of .arrow on the page and only want to toggle the class of the span within the element i'm clicking. This is my code - but it doesn't work... any advice? Thanks Craig $(".msg_head").click(function(){ $(this).next(".msg_body").slideToggle("slow"); $(this).next(".arrow").toggleClass("arrow_up"); }); <div class="msg_list"> <div class="panel"> <div class="msg_head">Design
[jQuery] (validate) How to activate validation on first blur?
Hello! I'm using the validate plugin, and I am loving it. Unfortunately, my client would like to show validation errors on form fields on blur events every time, as opposed to showing them only if the user has previously entered something in the field at least once. Before I start hacking inside the plugin, I figured I could ask if there is an option that I'm just not seeing to enforce this behavior. Thanks for the help!
[jQuery] autocomplete question
I am looking at the auto-complete demo page, ( http://view.jquery.com/trunk/plugins/autocomplete/demo/ ) on the demo of remote images. the Javascript for that is $("#imageSearch").autocomplete("images.php", { width: 320, max: 4, highlight: false, scroll: true, scrollHeight: 300, formatItem: function(data, i, n, value) { return "<img src='images/" + value + "'/> " + value.split(".")[0]; }, formatResult: function(data, value)
Drop Down Menu with Divs - Help
I'm new to JQuery and I am seeking some help with my drop down menu. I have it working some what. I'm not quite sure how to get the menu to disappear when I go from link to link and close when I go to a diff. menu option. A LI type menu won't work for this project. Thanks in advance for any help you can provide. http://jsbin.com/izayi/edit
[jQuery] Paging webservice search results
Hi all, I'm having trouble paging from six to six the search results coming from a webservice, hope someone can help : Let's see it with an example: The variable that stores the number of elements of the search results array is called contentLenght. Let's say that contentLenght equals 9. Then I need a div showing 6 elements an another sowing 3 elements. If contentLenght equals 7, I need a div showing 6 elements an another showing one element. If the value of contentLenght is 18, then I need three
[jQuery] Haccordion plugin problem
Hi guys, got stuck and looking for help. I CSSed haccordion to become a vertical slide-out gallery menu, and needed a way to hide the expanded list (.content) when item is clicked (when user chooses a photo, see URL below). That was no big deal, just used JS set the .content width to 0px just like the haccordion script does, like this: document.getElementById('c'+albumid).style.width = '0px'; and it works great. Problem is, when i do this and then mouseover on that haccordion item again, it won't
[jQuery] $('#div').load('url') on ajax success?
Hi there, Firstly this forum has been always been so good that's I've never actually needed to start a thread before because the old threads are so useful! <br /> Now though, i'm stuck! <br /><br /> I have ajax which checks a login form<br /> on success I want to create a div and populate it with the contents of another file<br /> <script> $(function(){ $('#submit').click(function(){ var data_str = $('#login').serialize(); $.ajax({ type: 'POST',
product display script
Hi everyone, I'm new to jQuery but would like to learn more about it. I came across this website if you mouseOver a thumbnail of a product, a larger picture appears fading in and doing a quick slide at the same time. On mouseLeave, it does the reverse. Is this a plug-in? Is there any good tutorial that will teach me to re-create this effect? thanks, victor
[jQuery] Styling the first word of an element
Hi guys, my first time to start a new discussion here. I need some help in writing a jQuery code that will style the first word of each and every element that I declare. For example, I would like to style the first word of an H3 tag. What I have in mind is something that would do something like below: Replace <h3>First Word</h3> with <h3><span class="firstword">First</ span> Word</h3> Oh and by the way, I saw a javascript version of this already and the link is: http://www.dynamicsitesolutions.com/javascript/first-word-selector/
[jQuery] How to add some string in attributes?
If I have a tag image like this.. <span class="nodeLabelBox repTarget"><<span class="nodeTag">img</span><span class="nodeAttr editGroup"> <span class="nodeName editable">alt</span>="<span class="nodeValue editable">My Account</span>"</span><span class="nodeAttr editGroup"> <span class="nodeName editable">src</span>="<span class="nodeValue editable">/images/menu-my-account.png</span>"</span><span class="nodeBracket editable insertBefore">/></span></span> and when hover that image I want became like
[jQuery] ui.tabs adding an onclick event to a nested tab
Hi, I want to send an alert to the user indicating the title of the tab they have clicked. This is easy enough in principle using $('#tabs').bind('tabsselect', function(event, ui) { alert( 'ui.tab.textContent: ' + ui.tab.textContent ); }); But I also have a set of tabs within the first tab that I require to pass the title of the tab when selected...(taken care of above) BUT I need to add the title of the 'parent' tab too! The HTML is below, note the 'inner' tabs have dynamic IDs and the 2nd
JsTree node selection
How i can select a parent if all its child are selected.
[jQuery] Superfish issues in ie6 and 7
In ie6 and 7 only i have issues with the menus closing while the mouse is over them at certain points as if there is a gap in between the list items. This makes using the menu impossible as they almost immediately close. Gaps in vertical lists is a known issue with ie, does anyone know is this is the cause and how to go about fixing this?
[jQuery] A seemingly simple .load
Good Morning/Afternoon (depending where you are) I would usually hate to post chunks of code like this, but I may be about to break my monitor. I've written a chunk of code, which on an address change, loads page content either into a black, or white div. The address change event is working, and the if statement to decide if the page is black or white is working. However the simple .load statement that follows isn't. I'm using the address pluggin (http://www.asual.com/jquery/address/docs/), which
How to show alerts on disabled tabs onclick?
How to find out whether a tab is enabled or disabeld on tabclick? I have some tab enables and some disables. Want to show alert message on disabled tabs.
[jQuery] How make a guiDesigner like ExtJsGuiDesigner with jQuery?
Hi friends. Is there any plugin for jQuery which could do some thing the same as ExtJsGuiDesigner? I mean making a Gui(forms, blocks, ...) and then saving the output in JSON or XML format, and using that saved files in our site. Any links or samples? pls help me. tnx. best wishes.
[jQuery] JQUERY form submit
hi i have something like this: // javascript---------------------------------------------------------------------------------------------------------------------------------- $('a').click(function(){ $('div').load('form.html',function(){ $('form[name="form_name"]').submit(); }); }); //main HTML page------------------------------------------------------------------------------------------------------------------------ <a href="#">click</a> <div> </div> //the form.html page-----------------------------------------------------------------------------------------------------------------------
[jQuery] (jQuery validate) remote on non-required *blank* input
Using the latest version of both jQuery (jquery-1.3.2.min.js), and validate (1.5.5), Safari 4... When a non-required input box is cleared of all text inside, and the field is tabbed out of, there is no call made to my 'remote' file to check to see if the field is valid or not... which leaves the invalid error message (if invalid text is entered and the field is tabbed out of, and then the invalid text is removed). I set up a text input: <input type="text" name="fieldforsite" id="fieldforsite" value="$fieldforsite"
Slow response in flexigrid checkbox.
function checkAccess(celDiv,id) { var celValue = $(celDiv).html(); if (celValue==1) $(celDiv).html("<input type='checkbox' value='"+$(celDiv).html()+"' checked disabled>")//display detFlex1 else $(celDiv).html("<input type='checkbox' value='"+$(celDiv).html()+"' disabled>")//convert value of checkbox to 0/1 $(celDiv).click ( function() { $('input',this).each( function(){ tr_idx = $('#detFlex1 tbody tr').index($(this).parent().parent().parent());
[jQuery] Superfish and Sprites
I'm trying to get my parent ULs to show their :hover state when their children ULs are expanded. I've tried copying the: .sf-menu li:hover, .sf-menu li.sfHover, .sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active to my LI id's: #nav li#products a:focus, #nav #products.sfHover, #nav #products li:active Can't for the life of me understand what I need to adjust or properly code to get the parent to be "hovered". Thanks, Rick
[jQuery] [jQuery Validate] How to use on group of two selects
How would I validate this group of two selects: <label for="expires[]"><span class="req">*</span> Expires</label> <select name="expires[m]"> <option value="">MM</option> <option value="1">01</option> <option value="2">02</option> <option value="3">03</option> <option value="4">04</option> <option value="5">05</option> <option value="6">06</option> <option value="7">07</option> <option value="8">08</option> <option value="9">09</option> <option value="10">10</option>
[jQuery] .show() does not work, but getElementById(id).style.display="block" does work
Here is my .ready function using tabs and a class of .remote to start using the history plugin // Show and hide product grids $(document).ready(function() { $(".remote").click(function(event) { document.location.hash=this.title; show_subcat_menu(); toogle_subcat_ul('ul_sub_category_'+this.id.replace(/\|/g,'_')); // replace all pipes with underscore chars }); }); And specifically that function calls this to help show and hide some navigation elements with context. function toogle_subcat_ul(id)
[jQuery] jQuery.post on page load?
I'm beginner with jQuery and JavaScript in general and since I didn't find solution in documentation or on web, I'm asking here. I'm writing some plugin for WordPress publishing tool which should check if commenter has avatar on Gravatar.com. This part works for unregistered users and you can see it in action here: http://blog.milandinic.com/2009/10/04/google-news-soon-in-serbian-bulgarian-romanian-and-slovakian/#comments . It works when you enter e-mail address in comment form. Problem is that I
Next Page