$(..).is() could work as $(..).length !== 0
What if $(..).is() would return whether the jQuery collection contains anything. if ($item.is()) { // $item.length !== 0 } What do you think? I think that makes more sense than the code below. if ($item.length !== 0) { // Yes, $item exists }
jQuery and Firebug
I have been working on extensions to Firebug and Web Inspector that let developers see into the structure of a their code built on JavaScript frameworks. I've hit a milestone, releasing a preview for ExtJS on Firebug. A longer description is here: http://www.sroussey.com/article/2010/11/11/42724/Illumination I built it with the idea that it would support multiple frameworks, and want to move on to jQuery next, and could use a few pointers: - What is needed when debugging jQuery that is obvious to
ui draggable live event
Hi, I was wondering if somebody could point me in the right direction for attaching draggable ui as a live event. I have divs that need to be draggable but can also be created & removed as well. At present I have: $('.panel_button').live('mousemove',function(){ $(this).draggable({containment:"#skeyb_design",distance:10,grid: [50,50],delay:10,zindex:9, start: function(){ }, stop: function(){ }, }); This does work & I get the result I need, but
A few questions (DOM rerendering, form transitions)
This is a simple question... and perhaps I'm missing it but I can't seem to find it since there seems to be limited resources on jqueryMobile... If I have a page that contains a form and I manipulate that form and its elements using jQuery in a document.ready function, how do I tell jQueryMobile to re-render the form? Basically I have some dynamic code that is provided by the server and I'd like to experiment by allowing a "mobile theme"... I figured if I could use jQuery to change the DOM and re-render
filter table columns (not table rows)
hey, I am desperately looking for a jquery script that can filter (and hide) table columns - but so far I just found filters that hide rows. May be an example will make it more clear: In a table like |A|B|C| |D|E|F| a search of E hides "|A|B|C|" and only shows |D|E|F| I am looking for something that would hide the first and the third column and only display |B| |E| Since I am quite new to jquery, I did not succeed in re-writing the scripts that are already there... Thanks, ghost34
List view image corner is rounding with data-inset="true".
I have some images on each of my lists. <img src="images/change_password.png" class="ui-li-icon"> however the first and list image corner is being rounded because of data-inset="true". Is there a way to make sure it doesn't round my icons?
Using checkboxes to control other elements
I want to use two checkboxes to control the appearance of two blocks. The click method doesn't work well for this situation. I have tried to use the change method, but don't know how to detect which checkboxes are checked. Can someone give a hand please? $(':checkbox').change(function(){ // .... $(':checkbox:checked').each(function(){ // ???? }); });
Using any plugin inside ajax tabs
Is there a way to get any jQuery plugin to work within ajaxed content of tabs? Or is a general solution impossible and one would have to customize with .delegate or .live every time?
jQuery file size?
Firstly, apologies for creating another thread - I can't seem to find my other one to edit it! Just have a very quick question about jQuery - on the homepage it says that the minified version is just 23KB, but unfortunately on my system it's showing as 70KB! Not the end of the world I know, but the extra bandwidth could add up over a lot of users (I'm doing a website for a school, who have pretty much no money and even less bandwidth!) and of course load times for the users too. Do I have to Gzip
[jQuery] Testing for presence of ID
In this piece of code (common to a number of pages) I want to set focus to a second input field if there is one. $(function() { $("#first_field_to_enter")[0].focus(); $("#second_field_to_enter")[0].focus(); }); If the second input field is present, focus is on the second field. If not present, focus goes to the first field. All good, except that an error is generated in FF2 error console when the second field is not present. See http://test.danen.org/secure/register.htm and http://test.danen.org/secure/
jQuery Mobile, CSS animations?
Hi everyone. Just curious if the mobile framework will be using CSS animations on the iPhone platform at least? Because css animations (some) not all are hardware accelerated and therefore have much much much better performance compared to modifying the actual top/left properties of the element. I mean using translateX/rotate/etc. Other question, will there be support for drag/drop or is that going to be part of the jqueryUI? Thanks in advance!
collapsible element do not take into account the attribute "data-state=collapsed" since alpha2
<div data-role="collapsible" data-state="collapsed"> ... </div> are always displayed expanded. ------------------------------------------------- alpha1 code for plugin: ... collapsed: $(this).is('[data-state="collapsed"]'), ... ------------------------------------------------ alpha2 code for plugin: ... collapsed: false, ...
jQuery UI theme alternatives
Hi all, I've been using the jQuery UI code to build some intranet sites, and it's working very well. However, I'm not crazy about the "look and feel", even using Themeroller. I've looked at the alternative theme Arista, which I might make use of, but I'm wondering if there are any other jQuery UI based themes out there? Thanks! Doug
Setting focus to form field on div popup
I've got this hidden div that pops up using jQuery when the login menu item is clicked. <div class="entry-wrapper" id="reg-login" style="display:none;"> <div class="t"></div> <div id="loginFormHolder" class="c"> <div class="close"> <a href="index.php" class="spotlight-close"> </a> </div> <!-- close --> <div class="login"> <div> <!-- blank --> <div class="loginwrapper"> <form name="loginform" action ="#" class="new_user_session" id="session_form"
assign a function to multiple objects
is it any shortcut for these lines of code: $("#div1").fadeToggle("slow", "linear"); $("#div2").fadeToggle("slow", "linear"); $("#div3").fadeToggle("slow", "linear"); i mean assigning a function for multiple objects, i testes code below, but it didn't worked out: $("#div1").$("#div2").$("#div3").fadeToggle("slow", "linear");
ability to set encoding for ajax sent data. working solution
hello friends, i'm in love with the jquery way to control the browser. everything may be done quite elegantly, but i wish to ask for yet another parameter to ajax, to cope to non unicode encodings on the server side: a widespread misfeature of all the browsers i know of is not respecting the page encoding when sending data through ajax (while they do respect it when submitting a form). i propose to allow the programmer to choose the encoding, and give my code as example. function unicode_escape is
Malsup's jQUery Form plugin - how to submit only PART of a form.
Malsup's most excellent and comprehensive Form plugin has me completely stuck on just one thing. Take a look at this: http://jquery.malsup.com/form/#ajaxForm At the bottom are a variety of submit buttons, and when you click one, it knows which one has been clicked. And I've been through the js and the source and the examples and I can't figure out how the bleep it's done! I'll tell you why I'm asking, then perhaps you can probably tell me I'm doing it wrong anyway! Let's say a blind person logs in,
Making it easier to customize style of buttons in jQuery UI Dialog boxes
I wanted to add some styling and icons to the buttons inside a jquery UI Dialog boxes and this proved to be very difficult to figure out how to do. As far as I can tell there's no good documentation on it, official or unofficial. This post from filament didn't really help at all: http://www.filamentgroup.com/lab/styling_buttons_and_toolbars_with_the_jquery_ui_css_framework/ I put together a solution with some things I found on stackoverflow, but this kind of thing should be much easier, and it should
Help with the Corner plugin please (malsup)
Hey this is my first post here so I want to first thank to all jQuery developers, it's so amazing! Now I will realy love to get some help please with the Corner plugin (v2.09, j1.4.2.min) I'm trying to use the 'bevel' pattern or any other pattern except the default 'round' and it works great in IE, but only in IE o_O and I just cen't get it what's wrong with my code. so here is my example page code and I will love to get some help please, thanks! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
[jQuery] Possible next()/prev() bug?
Hi all, I've come across what is possibly a bug (or unexpected behaviour) when using next(). I have an example page setup here: http://fapdragon.com/test/test.html As far as I can see, the filter for next() is not being applied and it always returns the next DOM element. Can anyone comment on this or should I log a ticket for it? Thanks, Evan -- View this message in context: http://www.nabble.com/Possible-next%28%29-prev%28%29-bug--tf3422183.html#a9538163 Sent from the JQuery mailing list archive
jQuery validte change default messages
I know I can use messages to set the message I want, even my language, but if the message are the same, I have to type it over and over again, such as $('form').validate({ rules { a: 'required', b: 'required' }, messages: { a: { required: 'please input' }, b: { required: 'please input' } } });Can I set change the default messages for saving time?
Range slider: put min and max values into separated fields
Currently the range slider outputs min&max values into single text field. I think that's wrong behavior, at least for me :) Is there a way to separate these values using two different "input" fields? Thanks!
Superfish dropdown menus
is it possible to use background images with superfish ? sprites ? or can i use image tags in the list item anchors ? Whats the best way to use image sprites in the first level of your navigation menu in conjunction with superfish dropdowns ?
Dynamically creating image map with jQuery problem in IE7
Basically, I've got an <img> in HTML, and I'm using jQuery to dynamically create a <map> element, then append() <area> elements inside it. This works great in all browsers. I can confirm that the elements are being created successfully, however in IE7 the coords are all being set as "0,0,0,0", essentially making the hot spots unclickable. I've debugged using both IE Developer Toolbar and Firebug Lite, and the generated source shows me exactly that - "0,0,0,0". I've also thrown up debug alert()s
Calling $ from inside an iframe
Hi, i guess this isn't really jQuery specific rather than it is a global JS-thing, but I tried general solutions for this and they all did not work so I figured this might be because I'm trying to do this with the $ function. What I wanna do is this: I have a document with an iFrame. From inside that iFrame I wanna call the $-function of the original (parent) document. I tried so many things like parent.$ top.$ window.parent / top.$ the stuff above with .document.$ and other stuff but none of that
[jme] Does JME recognise WebM?
Hi, Using latest JME, and my video source line looks like this: <source src="edit.mp4" type="video/mp4" />' <source src="edit.webm" type="video/webm" />'But it never /appears/ to use the webm file, even in browsers that support webm. Is this the case, or does it recognise it and am I just not able to tell? Regards David
Page transition on rel=external
When I add a rel="external" the page transitions stop and page just loads normally. I have placed the following but nothing still the same: data-transition="fade" rel="external", etc Is this the default and on external the transitions will not work or is there a solution? Its for mobile Safari. Thanks Si
Droppable to dynamic created table problem
I had this problem, i want to generate a time table and allow droppable from <ul> list. However when the table is generated dynamic from javascript, the table row cannot be droppable, where nothing hover, active behaviour trigger. However if i prefix the table by default (not dynamic create) i can drag from <ul> list to droppable table specific row. Is that the jquery droppable not function on dynamic created table <tr> or <td>? I search around but nothing related with my problem. Any help
Find element with same class name (match class name)
This is probably a dumb question (noob) but I cannot seem to find the answer, either here or on StackOverflow or even Googling... All I want to do is, when clicking on an element, find any other elements with the same class name (and show/hide or do something with them). This is as far as I got: $('option').click(function() { // get the class name of the option element var className = $(this).attr("class"); // find the div with that same class name and show it $('div').hasClass(className).show();
Date picker
Is there a JQuery UI date picker for Mobile JQuery?
Class Inheritance with jQuery Extend
I've been using $.extend() for quick and simple class inheritance in some of my code. I'm starting a large project now and since this method has been simple and flexible for me so far I'd like to continue using it, but I wanted to run it by a smattering of other devs first to get opinions and find any potential issues. I'm pretty sure this method has some loose ends and pitfalls, but its flexibility and ease of use has come from it being "loose". Here is how it works: var Monster = function(o) {
Dialog lose mouse tracking when resizing
Hi everybody. I have a problem when resizing a jquery ui dialog which was created with a setup like this: $('<div><iframe/></div>').dialog(); the problem is, if I start resizing the newly created dialog, and the cursor moves inside the iframe in the dialog itself, it seems to lose mouse tracking and so it stops the resizing, immediately restarting as soon as the cursor is outside the frame. you can check it out here: http://jsfiddle.net/Lmbjj/ I have been able to verify such behaviour in Firefox
onclick event does not fire for select box in jquery mobile framework
The onclick() event does not seem to fire for the <select> box. Here is a sample code that you can insert and test in the jquery mobile page. <select id="listSample"> <option>Option 1</option> <option>Option 2</option> </select> and then perform $('#listSample').click(function() { alert('listbox click called'); }); When you click on the listbox, the listbox elements get rendered but there is no call to the click() method. So its not possible to dynamically alter the contents
Fixed header not working on 2nd page
If you have site a that contains several physical html files with data-position="fixed" specified in the data-role="header" divs then the fixed header works fine on the first page but doesn’t work after you click a link to go to another page in the site. Note: If you have your mobile pages (data-role="page") in a single physical html file then the header does work fine. However for my application I need to use separate physical html files. Is this a bug? Am I missing a setting?
ajax jquery loading problem.
good day. I am trying to post a form with jquery and ajax to the asp page and return a value back. but on internet explorer before the picture loaded the loading text dissapeared. A sample of my page is downstairs. I dont want that. How can i do what i wanted? html page's address http://www.bybilisim.com/deneme.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script
Jquery UI Tabs and cookie option problem
I change jquery and jquery ui to the last version (1.4.4 and 1.8.6) and i noticed a problem with tabs that have a cookie option set. The tabs don't load the ajax content and with opera the error reported is the following : Uncaught exception: TypeError: Cannot convert 'b.cookie' to object Error thrown at line 381, column 633 in <anonymous function: _cookie>(): return b.cookie.apply(null,[d].concat(b.makeArray(arguments))) called from line 384, column 388 in <anonymous function: _tabify>(d):
How Selectable Plugin prevents Click event
Hi, I've recently started working with jQuery. Using v1.3.1 and UI v1.6RC6. I created an accordion with another accordion nested within it. I've set both to selectable. Things seemed to be working fine until I noticed that IE and FF were behaving differently. IE allowed me to open the accordion tab that contained the nested accordion, and then allowed me to open up the nested accordion. In FF, I could not open the nested accordion. I managed to get it working in FF by setting the cancel property
JConfirm Issue
Hi i am facing a problem after using jquery jconfirm alert. Issue is that after receiving confirm alert, when user press tab to go on Cancel button and press Enter key there, despite of firing event of Cancel button, it fires the event of OK button. this issue is not produced when user press the cancel button by mouse. Waiting for your replies. Regards Kazim
ajax load multiple pieces of html
So I know that with .load I can load a specific chunk of html. What if I want to load 2 chunks of html in one request? For instance my current page has #nav and #content. My loaded page has the same and I want to replace these 2 elements with the new one (or it contents). $('#nav').load(loadUrl + " #nav"); $('#content').load(loadUrl + " #content"); So the above doesn't work for me for 2 reasons: 1. I load twice. I don't want to do that (but I also don't want to load the js and all because it will
:contains selector to NOT search in children
Hi guys, just wondering if there is any way for the :contains to not look in children to find something? Tried $(':contains("$")');, but it returns everything. Was thinking of something like $(":not(':parent')").filter( ':contains("$")');, but the console returns null (and even then it would exclude elements that have children and their text includes "$".) Trying to make a script that looks through a page and finds the price on any page. The only way I could think of doing this relatively accurately
Next Page