[jQuery] Set effect speed to pixels/second rather than total time?
The way effects such as slideDown and slideUp currently work is on a time value for the whole effect. This poses a problem: for two elements of different length being shown, the longer element will show more quickly than the shorter element. Is it possible to set the speed of effects to a more constant speed value? Something proportional to pixels per second (i.e. distance/ time). So elements would show at the same *rate*.
[jQuery] jQuery and iPhone developers... effects working yet?
I have read through a few other posts and blog entries on getting jQuery to function properly (effects) on the iPhone. I tried a few libraries to help develop on the iphone but I keep returning to my beloved jQuery. Everything else is lines and lines of code while jQuery can do it in a single line. The only thing that doesn't work properly is the effects. Sliding, animating and other effects do not emulate properly on the iPhones safari browser. I did some reading and it seems that the interval in
[jQuery] borders work fine with all browsers except IE7
I have a site with several borders that are part of jQuery commands. One has rounded corners, others don't. IE7 doesn't render ANY of these borders. There are two divs that are not touched by jQuery, and their borders work fine. Everything that has a jQuery click event, or rounded corners has no border at all. Any ideas?
[jQuery] jdMenu hides entire menu when top level link clicked
I am trying to implement jdMenu 1.4.1 with jQuery 1.2.6. However, when a top level link is clicked it hides the entire menu the moment it is clicked. This doesn't happen when the selection has sub menus. I am at a loss to explain this. For instance, clicking either "Show Lists" or "Next Item" in the example below will result in the whole menu bar vanishing. Here is my code: <ul id="sop" class="jd_menu jd_menu_slate" style="font-weight:bold"> <li><a href="lists.php">« Show Lists</a></li> <li><a
[jQuery] Image Button Acts Like "Submit" Button for JQuery Call
On my web page, I have two image button to dynamically add or delete a row of data in a table. When I click the buttons, they submit the form and execute the action="justDoIt.php" on the <form> tag and not call jquery. Is there any way this can be fixed. I'm using IE6 & 8 beta. I have to stick with IE for now because I have vbs. Thanks loads! Marv. These two buttons work, but are very ugly: <input type="button" value="del" class="delrow"/> --> <input type="button" value="add" class="addrow" id="addrow"/>
[jQuery] input box on change event?
I've got an input box and am displaying a form button on focus... then hiding the form button on blur. Ideally, I want to display the form button on focus, but only hide the button if the original contents of the input box have not changed (put another way... persist the form button if the quantity has changed). Can someone help steer me in the right direction? This is for a cart checkout page that I am working on and will provide users a way to update the quantity of an item in their cart. Here's
[jQuery] can i use livequery with greybox2 or equivalent?
Hi. I am using greybox2 plugin to generate a modal window with details of items when I click on their hyperlink, identified by the class= . However, I am also adding more such hyperlinks with teh same class= on the fly, and I need to rebind the elements correctly. Can I use livequery to do this, or do I need to do it another way? This is what my code looks like: $(document).ready( function(){ var gbOptions = { gbWidth: 400, gbHeight: 400, captionHeight: 22 };
[jQuery] [validate] Pb with button
Hi, I use the validate plugin for my site but, in my form, there are some buttons with metadata. Something like this: <button id="btnCancel" class="bnbutton {bnAction:131328}" type="button"> 1. the plugin control the button element. Why ? Theses are not input. 2. the plugin search the validate function bnAction and hang because it not exists. What can I do ? I'll have the same probleme with select tag. Thanks Gerard
[jQuery] apples webclip feature in jquery
I am wanting to write something like apples webclip feature in safari for jquery, I am trying to figure out where the best place to start is. Does anyone have any ideas? Thanks, -TJ
[jQuery] How to serialize an Object to JSON String without making it POST like?
When I use this function to create a JSON object: var formObject = $(":input").serialize(); and I print it, I get "name=value&name=value..." This isn't proper JSON string and the .NET webservice I'm sending it to barfs. How can I make it stay in the proper format, i.e. "{'fname':'dave', 'lname':'ward'}" Thanks!
[jQuery] Event delegation and accounting for children/descendants
I was reading a great post on learningjquery.com about event delegation, and it gave an example of how to account for child/ descendants that might get clicked. Here is the example show: $(document).ready(function() { $('table').click(function(event) { var $thisCell, $tgt = $(event.target); if ($tgt.is('td')) { $thisCell = $tgt; } else if ($tgt.parents('td').length) { $thisCell = $tgt.parents('td:first'); } // now do something with $thisCell }); }); My question is, how do I do something with $thisCell?
[jQuery] simple if not :checked then show div - BEGINNER
Hello I try to do a very simple thing. 7 Checkboxes. 1 submit. If none checked, show div#none if not checkbox1:checked show div#not1 and if not checkbox2:checked show div#not2, too and so on... I can do it with man if then's, but I like it slick and sexy! And I cant figure it out..... Thx in advance
[jQuery] Image Button Acts Like "Submit" Button for JQuery Call
There are two image buttons on my web page that are intended to execute javascript jquery. However, they trigger the php program on the <form> tag action="justDoIt.php". Is there a way to fix this so my buttons trigger jquery or an alternative solution? These two button do not work, they trigger submit: <input type="image" class="delrow" src="images/rowOutDel.png" onmouseout= this.src="images/rowOutDel.png" onmouseover=this.src="images/rowOverDel.png" onmousedown=this.src="images/rowDownDel.png"
[jQuery] Improvement to delegate plugin to simulate bubbling
I've been writing my own event delegation handling for a long time, but today I thought I'd look at how the delegate plugin does it. Not very complicated, as I found out! It doesn't do one thing that I needed today, however. It doesn't check for matches against the whole bubble chain - just against the actual event target. For example, I load a table into a container via ajax, and I want to delegate the handling of table row clicks to the container so it still works after ajax reloads. The table
[jQuery] Problem with moving iframe using append, iframe's head and body are wiped out
I'm using the tinyMCE editor in a site to edit content for multiple projects. Loading tinyMCE creates an iframe, which in itself works fine. In the site, instead of creating a tinyMCE instance for every project, I'm creating it once and then just moving it to the active project. I'm doing that like this: $('.active_project').append($("#editor"); //#editor is a div that contains the tinyMCE editor and some other fields But when it is moved the head and body of the iframe are emptied, and obviously
[jQuery] [validate] Pb with button
Hi, I would like validate my form with the validate plugin. I have a little problem. In my form, there are button with metadata. So the html look like this : <button id="btnCancel" class="bnbutton {bnAction:131328}" type="button"> Unfortunately, the plugin control the button and search the validation method 'bnAction'. 1. Why is the plugin control the button ? It's not an input element. 2. The pluggin hang because the validation method doesn't exist. What can I do ? I'll surely have the same problem
[jQuery] jQuery Validation Errors
In FF3 I am having no issues with the plugin, but in IE (only tested 7) I am running into the following problem. http://i34.tinypic.com/2vnovic.png - Line:662, Error: 'undefined' is null or not an object. The offending piece of code goes over to jQuery 1.2.6 and this is where it errors. data: function( elem, name, data ) { elem = elem == window ? windowData : elem; var id = elem[ expando ]; elem is what is undefined Here is the code I'm using to execute the
[jQuery] accordion open in different sections?
Hello, I am working on a site where I am using the Accordion script from http://docs.jquery.com/UI/Accordion on the left navigation. You have an option to keep a section open by default....but I need to change which button is opened depending on which section you are in, and I have that accordion menu in a include so I dont see how you can do it. The one that is open by default has a class of opener. Any ideas? Kevin
Help with fading in thumbnails when they've loaded?
Hi all I've created a page of thumbnails that shows a loading icon for each thumbnail, then fades the thumbnails in once they've loaded and removes the loading icons. It all works fine, but I'm wondering if there's a way to improve it. At the moment all the images fade in at the same time once they've all loaded, but I'd like each one to fade in separately as and when it's loaded. I've not used jQuery much, but was able to hash together what I have so far. However, I'm not sure where to go from here.
[jQuery] What am I doing wrong?
I can't seem to get this to work for a client. I'm not a genious at jQuery, but I think this is supposed to work. What am I doing wrong? <code> <html> <head> <script type="text/javascript" src="some/path/to/js/ jquery-1.2.6.min.js"></script> <script type="text/javascript" src="some/path/to/js/shadowbox/src/ adapter/shadowbox-jquery.js"></script> <script type="text/javascript" src=some/path/to/js/shadowbox/src/ shadowbox.js"></script> <script type="text/javascript"> Shadowbox.loadSkin('classic',
[jQuery] Find elements
Hello, How can I find all elements in a page given a class and pass to a function? Or maybe better, how to I create a function that acts like a plugin, i.e.: Applies something to all elements of a given class. Thanks, Miguel
[jQuery] linking two controls
hello, on several pages I have small forms (plural) with a textbox and a button. If I click on the button, a popup shows a search form. The results of the searchform are shown in the very same popup as a list of radiobuttons/labels. If someone selects a radiobutton, it's value should be inserted into the textbox next to the button. Then the popup should go away. This popup (something like a singleton) serves many different pages, so I cannot hardwire it. Probably I need to pass a delegate to some
[jQuery] multiple getJSON calls appear to wait for first response to run any callbacks in FF?
<div dir="ltr">Hey all,<div> </div><div>I'm building a google map based application which allows users to query a number of different json returning data lookup services (ie: get Tax Parcel for this coordinate... get address, get USGS Quad Name, get Place Name). Each service is activated by clicking a different button, etc. While some of these queries run pretty fast, others (parcels), take ~ 30-40 seconds. Working in Firefox 3, I've found that once a user runs the slow getJSON, none of the
[jQuery] css-js mouseover effects not working in ajax response
Hi I have an issue regarding the ajax response the css-js mouseover effects not working in ajax response. Please gimme the reason behind this. Lemme know how can we sort it out. gimme some code snippents Thanks in advance joban john <? while($life) { $knowledge++ ; } ?> 1) He who lives by the sword will die by the sword..
[jQuery] Separate elements
Hello, I am trying to create a plugin that applies something to elements given their CSS class. However, I need to distinguish between the elements that are enabled and the elements which has the property disabled = 'disabled' ... I need this because what I apply is different dependent of being enabled and disabled. Thanks, Miguel
[jQuery] livequery with tablesorter and tablesorterPager
using this code: $('#dash-board').livequery(function(){ $(this).tablesorter().tablesorterPager({container: $("#pager")}); }); jquery, livequery, and tablesorter all work fine when the page fist loads, but if I navigate to another page, and go back to the page with the 'dash-board' id, tablesorterPager fails in some areas. (I have an ajax setup, so dash-board loads in a div). It works in the fact that it does change the rows to 10 at a time. I can also use the drop down that has
[jQuery] jquery.metadata + XSLT + forms
Hello, In XSL if "{" is in atribute XSLT processor try to resolve expresion. Jquery metadata uses "{" to process data, in old version of metada I try metadata with "[", with this: if ( /^\[.+\]$/.test( data ) ){ data = data.replace("[", "{"); data = data.replace("]", "}"); } but do not seems a good choice modify jquery metadata plugin in each update. ¿Anyone knows a alternative?
[jQuery] Escaping the apostrophe
When I have a string that contains an apostrophe, whats the best way to handle it? Should I remove it? replace it? encode it? escape it? For example, this function call throws the following error: Function: addQuote('This video don't work!'); return false; Error: missing ) after argument list addQuote('This link don't work!'); return false; Whats the best way to handle this scenario? PS - Sorry if I double posted this : / I'm just figuring out this whole group thing :) Thanks, --shawn
check whether a ui.datepicker date is disabled
Is there a way to test to see if a given day is currently 'disabled' in the datepicker UI? I want to be able to say: var d = new Date(); if($('.picker').datepicker('isDayDisabled', d)){ // set color red } else{ // set color black } and things of that nature. The existing isDisabled seems to check only whether the datepicker itself is disabled. While nice, this does not help me. I'll accept any suggestions, even if it's only a pointer at where inside ui.datepicker I can look to find out how to add
[jQuery] How to use a div as a placeholder for other divs?
Hi, I have a <div id="content"> that serves as a placeholder for text. The text are all like <div id="about"> test test test </div> <div id="links"> link link link </div> <div id="contact"> me@myself.com </div> When the user clicks a link, I use it's id attribute value ("about",contact" or "links"). I use that value to show the content of the corresponding div in div "content". Div "content" is visible, the others are invisible I succeed in prepending() the div to div "content": activeElementId =
[jQuery] jQuery prototype magic
Hi all, I've recently grabbed the latest edition of the Rhino book and I'm trying to build some small JavaScript libraries in order to get the hang of coding in JS. I've been also reading lots of blog posts and I've been looking at the code of several major JS frameworks and libraries, like jQuery, Prototype and script.aculo.us and I'm trying to understand why the author wrote that code. For some reason, I've been growing very fond of the pattern used in jQuery to create the jQuery object. Here's
[jQuery] Moving a opened dialog on top the windows stack
Hello, I'm just wondering if there is any undocumented method (or trick), like dialog.data(), to raise (and maybe focus) an already opened dialog which is hidden below other dialog(s) ? I could mimic that by destroying the dialog, creating and opening it again but it is not very clean. Thanks, Olivier.
[jQuery] Problems with "auto height" of pages
I have a HTML structure like this: <div id="header">...</div> <div id="nav">...</div> <div id="main">...</div> <div id="footer">...</div> I am trying to use jQuery to set the height of #main dynamically if it is too small, to make the footer appear to be fixed to the bottom of the page. In other words, #header and #nav are bars across the top, #footer is a bar across the bottom, and #main takes up all remaining space. It works if there is no block content in #main - ie just text with no paragraphs/divs.
[jQuery] Read AJAX response in transit?
Hi all, Is there any way to use jQuery to "stream" an AJAX response as it's downloading? For example, I'm running a long script via AJAX and I want to post progress updates on the screen as it goes - at certain intervals I output a percentage via the AJAX script which my page can then read and update on screen. Does this make sense, and is it possible? Regards, Michael Price
[jQuery] variable substitutioin in html-snippet
Hello, i would like to load always the same snippet of html over ajax and dependent on the click substitute ids and classes in the loaded snippet. How that could work? Any suggestions Thx Boris
[jQuery] Escaping the apostrophe
When I have a string that contains an apostrophe, whats the best way to handle it? For example, this function call throws the following error: Function: onclick="addQuote('This video don't work!'); return false;" Error: missing ) after argument list addQuote('This link don't work!'); return false; Whats the best way to handle this scenario? Thanks, --shawn
[jQuery] Checking if input is a number.
i have a serach box that checks for a product code or product keyword. I need to find out how i can check if the input submitted on this search box is a number, and if it is, remove any white spaces. The reason is that product codes coming from a feed have a space in them and it is much easier if i sue jquery rather than go through a collection fo nearly 20,000 codes. can anyone point me in the right direction?
[jQuery] jQuery Tutorials and Tips: LearningjQuery.com Offers Awesome Articles
One of the best sites for getting jQuery tutorials, tips and advice is from Learning jQuery (http://www.learningjquery.com/). The site is run by jQuery Project Team member Karl Swedberg who has taken his experiences in development and jQuery training and broken them down into very easy to read and thorough posts. Learning jQuery (http://www.learningjquery.com/) is definitely worth the visit if you're interested in becoming a top-notch expert in jQuery. Rey jQuery Team
[jQuery] jqDock's not working when shadowbox changes images
Hi, I've modified the Shadowbox plugin so that I could have mac-like navigation with my thumbnails. I've incorporated jqDock. Everything works as expected on the first image from the gallery. But when the image changes for the second image in the gallery the jqDock plugin's not working anymore. Here's the bit of code that works on the first show: if(options.displayCounter && options.counterType == 'thumb' && options.counterThumbType == 'mac') { $(document).ready(function() { $("#shadowbox_counterthumb").jqDock(options.counterThumbMacConfig);
[jQuery] jQuery and setTimeout
How can I make the element (div with class="request"), fade out after loading page and waiting 5 seconds, basically: 1) load the page 2) wait 5 seconds 3) fade out the element Here's what I have: jQuery(document).ready ( function() { jQuery('div.request').fadeOut(5000); } );
Next Page