Add tootip to td
Hello, I saw a piece of code for adding tooltip to table cell. $('#grdList tr td:nth-child(5)').each(function(i) { if (i > 0) { //skip header var sContent = $(this).text(); $(this).attr("title", $(this).html()); if (sContent.length > 20) { $(this).text(sContent.substring(0,20) + '...'); } } }); grdList - table id td:nth-child(5) - column 5 I don't understand it. Is it an api or plugin? Thanks for advice.
Using malsup cycle plugin - displays only first 2 images of 4 on iPad
I would be grateful for any assistance. I have 4 banner images which cycle beautifully on a monitor - but on an iPad only cycles from the first image to the second image and then stops. Demo page is: http://www.bikevents.com.au/Bikevents/index3.html The CSS and HTML used is below: #slideshow { height: 200px; width: 672px; padding: 0; margin: 0; } #slideshow img { display: none; padding: 0px; width: 672px; height: 200px; top: 0; left: 0; background-color: #dcdcdc; } #slideshow img.first { display:
select menu with images
Hi everybody, Im new in this forum and also in jquerymobile world, Im developing an ios app, and i want to use a select menu in the header of the page, i have the select menu with only text, but i want to add an small icon or image next to the text, i try all the examples in the network (github for example) and it didnt work, and im really desperate because the due date of the project is tomorrow night, if somebody could help me i will appreciate it thanks in advance conchitabh and sorry for my bad
Validate, custom regular expression?
Does anyone know if it is possible to use your own regular expression for fields with the JQuery Validation plugin? I have previously used Live Validation (standalone) which allows you to do this kind of thing: var loginpass = new LiveValidation('loginpass'); loginpass.add( Validate.Format, { pattern: /^[A-Za-z\d]+$/i } );
Newbie question: how to play my animation in reverse upon second click
Hey ya'll, I'm slowly learning jQuery and starting to have some fun with it. I've set up an animation where if you click a certain anchor the animation plays. However, being new at this, I cannot figure out how to play the animation in reverse if the same anchor is clicked a second time. Here is an example of my sloppy script: <script> $("#animate").click(function(){ $(".box1, .box2, .box3, .box4").animate({ height: "98px", opacity: 1, marginTop: "109px", border: "1px solid #666", }, 200 ); });
<textarea> and ajax with serialize()...HELP
I'm using ajax to process a form. But my form has textareas in them. Its not passing the textarea values. Here is my javascript code: $.get( "process_order.php", $("#order").serialize(), function(data){ $('#loader').hide(); if(data) { pTag = "<img src='http://www.heartofgold-usa.com/images/saved.png' width='200px'><br />Order Saved"; $('#popup').empty(); jQuery("#popup").append(pTag);
How do I hide only half of a div and then reveal it on hover?
Hi guys, I'm rather new to jQuery, so please just humor me. If I'm in the wrong section, could someone point me in the right direction? Anyhow, as per my new site design, I need to have a DIV on the page, containing an image, some other divs, and some text within it, but have HALF of it concealed (see attached spotslideprev1.jpg) until the user hovers over the div, revealing the complete DIV (see attached spotslideprev2.jpg). I think it's pretty self explanatory. If anyone has any ideas or tips,
How to select all descendants of a div
I'm very new at jQuery and I am trying to write a selector that returns a div with a particular id and all its descendants. What I have is $('.boxBody > div:eq(' + $('#tabMenu > li').index(this) + ')').contents().andSelf().slideDown('1500'); The problem is that the slideDown sets style="display:block" for the div, but not for any divs that may be nested below it. What should I change to get the right behavior? Thanks!!
Are there plans of having a spinning wheel style datepicker?
Like the iPhone/Android? Or is the widget at http://cubiq.org/dropbox/sw/ the only choice? Sencha touch has a nice implementation of the datepicker and I am wondering if this is on the roadmap.
serialize returns nothing
I can't get the serialize function that is supposed to create a query string to work. My HTML contains one form with one input of type "text" inside it. Both of these return an empty string. var queryString = $('form').serialize(); var queryString = $('#myInputId').serialize(); What could I be doing wrong?
Using IDs in jQuery Mobile Pages
Is it bad practice to use the same ID in separate jQuery Mobile pages, since they will appear on the same page via AJAX? For example, if I have two separate HTML files linked together in a jQuery Mobile site, both containing an element with the same ID (for example <div id="example">), could they potentially cause conflict when jQuery Mobile appends the content from the second page into the original document? Or is this just my desktop web experience saying we should never have two ID tags on the
How to dynamically add data-role="button"
I'm reading in some data from a web service to jquery mobile upon navigating to a new page (data-role="page") and I want to dynamically populate some jquery mobile link buttons, however it appears that the styles are not being applied through the data-role="button". My code is along the lines of var title = DataFromWebService; var newsButton = "<a href=\"#\" data-role=\"button\">"; newsButton+= title + "</a>"; $(".newslist").append(newsButton);The button renders as a plain a
overlay needs to be .load() twice
Hi All I'm new here, my knowledge of JQuery is limited. Any help is appreciated. I'm using jquery.tools.min.js, overlay version 1.0.4, expose version 1.0.3. I know these are old but I have no choice on this. Here's code that demonstrates the problem: <!DOCTYPE html> <html> <head> <title>jQuery Tools standalone demo</title> <script type="text/javascript" src="jquery-1.3.1.min.js"></script> <script src="jquery.tools.min.js" type="text/javascript"></script> <style> #popup-content{ /*
Binding Click Events to Dynamically Created ListView?
I have a ListView that requires a click event. When I first initialize the list, everything works great. As I rebuild the list (as items are added, edited, and removed), the click event stops working. I have this HTML: <ul data-role="listview" data-theme="b" id="data-list" data-filter="true"></ul>I have this code in an init function that gets called on page load: // initialize listview if (window.localStorage.length - 1) { var contacts_list = [], i, key;
Problem with page navigation and multipage
Hi, I have the main HTML page "A" with only one data-role="page". I then load a new HTML page, which contains two data-role="page". JQM automatically shows the first data-role="page" and i am unable to link to the second one. Using firbug, i noticed that the second data-role="page" does not load in DOM. I tried using these urls: &ui-page=second_page /pagename&ui-page=second_page I also tried using data-url attribute for the data-role="page", using the same string as the ID. How can i solve this problem?
Best chart/graph plugin
I am needing to create a "dashboard" of charts and graphs and have been looking around at all the many different plugins that can handle that. I am wanting to stay away from flash. What are you guys using? What is your favorite to use for charts and graphs?
jquery tabs with form submit
I'm using jquery tabs for navigation. I'm able to successfully load the selected tabs and also open links in the current tab instead of leaving the page - until I do a form submission. When the user submits the form, it calls a php script to save the form data to the database. After that runs successfully, how and where do you then set which tab is to be active and what content is to be loaded in the panel? For example within the Contacts tab, the user submits the new_contact.php form which then
Reload jquery mobile styles after ajax call
I an currently refreshing the data in a div panel by making ajax calls, but the the content is comming as plain HTML and jquery mobile is not able to apply its styles as it do when full page reload is done. I have a table in the web page and when i reload the page, buttons comes fully styled. But when i make ajax calls the buttuns are not styled at all. Code for buttons: <div style="text-align: center;" data-type="horizontal" data-role="controlgroup"> <a href="#" data-role="button"> < </a>
Hide / protect source code
Hello, I'm developing a web application (a user interface). Is it possible to protect my code in any way? Thank you for your answers.
JQuery and XML
I am probably not doing this right, if so let me know. Using JQuery and .Ajax I and returning some XML. <Nodes> <Node> <Name>Title</Name> <Value>Foo<Value> <Name>Location</Name> <Value>Bar</Value> </Node> Etc. I am trying to retrieve all Value nodes for Titles. I have seen a bunch of examples for attribute selection but cannot get element selection and sibling relations. Anyone?
XML help..
hi, i am badly stuck, in need of 'SOS' help. THE PROBLEM-- my php server sends xml document as echos-- like echo "<option>".$value."</option>" i want to receive it on my user end using Ajax. here is my code ( i am usin CI) url: "<?=base_url();?>Main/prova", global: false, type: "POST", async: false, dataType: "html", // "xml doesn't work " data: "first_select="+ valore, //the name of the $_POST variable and its value success: function
setTimeout?
The effect I'm after is to have an div go blank for, say, 800ms and then be filled with content. I already have a js function which makes any content in the div "display none"; I'm looking for the way to combine this with a jQuery 'get' call. Can I do: myfunction() { displayNone(); setTimeout('jQueryfunction', 800); } ?
Remove Page from DOM
Hi all, I'm developing an app using jQuery Mobile that will use many pages, many of which will have images. The pages are in separate files, so I understand they will be injected via AJAX into the DOM as needed. I'm wondering if I need to worry about removing the pages from the DOM when the user is done with them, otherwise the DOM will contain lots of large hidden pages, that presumably could be eating up memory on phones. Is there a way to remove pages from the DOM and have them to be loaded
How to make jquery autocomplete to work for a contenteditable DIV instead of just INPUT, TEXTAREA fields.
I have a use-case to make a DIV element act as a TEXTAREA by setting its attribute to contenteditable="true". Can I use the DIV's DOM handle for the autocompleter to behave as a textarea autocompleter. Currently the plugin 'as is' is not working over the DIV handle. What changes should I do for the plugin to work for all the above elements? Thanks in advance!
Fade out an initial image to reveal home page
Hello, I am completely new to jQuery, and I don't even know how to approach or implement what I am trying to do. Before the home page of a site i've developed appears, I want the logo of the company to appear on the screen, then fade out to reveal the web page with full functionality. I also could do this be fading out the logo to reveal a static image of the home page which then could redirect to actual home page. Please help, and help provided is greatly appreciated! Thanks! Trevor
Rounded corners causes error in jQuery
Hello guys! I'm new to jQuery but i managed to have rounded corners using malsup's great plugin. I'm posting here because Internet Explorer gave me error on the jQuery itself, not in the plugin. This is the busillis: i used this code: [code] $(document).ready( function(){ $('#container').corner("24px"); $('.bloccoCentrale').corner("10px"); }); [/code] and it works flawlessly in Chrome and FF, but not in I.E. 7. Now... i tried to use CurvyCorners plugin and it doesn't work completely: i mean,
tap/click event firing multiple times for elements of listview
I currently have a simple, 2-page application. The first page is a splash page of sort with a single button that leads to a list view. When the application first loads, the listview is dynamically filled with content. A binding is then created on the "li" elements to capture any clicks/taps. This handler will ultimately be responsible for loading the next page, however, I'm having problems right now. Pretty sporadically, when list elements are clicked, the event will fire twice. Sometimes just once,
Loupe Plugin toggle
Hello, I am sure this seems simple for most of you, but I can't seems to make this (http://jdbartlett.github.com/loupe/ ) Loupe Plugin toggle on and off. I have tried adding and removing the class the plugin uses to identify which element to zoom. I have also tried directly .hide the class used to style the loop itself. I've spend hours looking around the net, no help. Ideas? All help is great. Thanks everyone. I tried this: jQuery('.theloup').loupe({ width: 200, // width of magnifier
Indicating disabled items on a list view
Is there a simple way to indicate in jquery that a specific item in a list view should be disabled. By "disabled" I mean that the item must show up as greyed-out and it must not show the pointer cursor; instead it should show the default cursor for an item that cannot be clicked. Lastly, the disabled item should not have an action associated with it when a click occurs, so the anchor tag enclosed in the <li> element must not be followed when a click occurs. I am needing to disable and enable items
How to go back previous page programmatically?
Hello, how can i go back to the previous page programmatically? I used history.go(-1) but it is not good because the previous page will not be reloaded. Thanks
Autocomplete request object in source callback
Hello, Is it possible to get the request object in the source callback of the jQuery UI autocomplete function? Example: $("input[name=q]").autocomplete( { source: function( request, response ) { ... get request object that calls this function ... } } ); It is possible in the focus(), select() and change() function, but why not in the source? Or am I missing something? The variable request only contains the term property. Calling $(this) will give me the jQuery
Ajax structure in JQM: impossible to monitize site w/ads?
Hi all, I'm trying to incorporate ad networks into my JQM site have not been able to find anything resembling an elegant solution. Most ad networks (such as Google Adsense, GreyStripe, and Admob) simply require that you copy/paste a few lines of JavaScript where you want an ad to show. This works on the first JQM page but fails on subsequent pages due to the way JQM loads pages via Ajax. I've been browsing the forums and found others with the same issues. As more people start evaluating JQM, I
Implement CSS
This might be a bit of a noob question, but I'm not that familiair with Javascript, so I'm not quite sure how this code works and executes. I'm currently working on building a webapp using HTML5. I've followed some tutorials and so far I've come up with the following for the layout and infrastructure, only the first link works, and the top(back) button: http://www.haragara.com/html5test/ Now during my research I've come across Jquery mobile, this seems like the perfect sollution to make my webapp
Changing css of :after pseudoclass
Hi, In my stylesheet have a css rule for an element with the :after pseudoclass. Is it possible to change the this CSS with jQuery? For example, in my CSS I have .price:after { content:" EUR"; font-weight:bold; } When I try the following in my JavaScript file $('.price:after').css({"font-weight":"normal", color:"blue"}) nothing changes.
AjaxUpload: why have to click twice?
Hi all, The code below uploads files to the server using AjaxUpload.2.0.min.js But you need to click several times on the “Add File” button for the OS window (where to pick the file you want to upload) to show, instead of clicking just once. Also, if you click once in the link and then you move the mouse out of the red area and click (out of #upload_files), and last you click back in the link, it works, the OS window opens .. but why do I have to do this? Is that AjaxUpload will not be initially
JQUERY UI theme images for a button
How can I create a UI button with a down arrow icon from the icon sprite? Is this possible?
Issue closing a dialog that contains an iframe.... from within the iframe
I have a function which takes a url and opens a jquery dialog. I've used it in a few places and it works fine where the dialog doesn't need to be closed programatically. function ModalFramedDialog(winTitle, url, winWidth, winHeight) { $('<div id="myAdhocIframeDialog" style="overflow:hidden;"><iframe id="myAdhocIframeWindow" frameborder="0" width="100%" height="100%" src="' + url + '" /></div>').dialog({ title: winTitle, autoOpen: true, width: winWidth, height: winHeight, resizable:
jQuery simple expand/collapse list: problem in IE8 with static page height
Hi there, I'm a bit new to jQuery and have been trying to make an expand/collapse (essentially accordion) list. So far, everything works and looks fine in Firefox, Safari, and Chrome, but in IE8, the page height is static when it loads, with a page height being as if all headers in the list were expanded. The expand/collapse functionality works, but as you can imagine, there is this big gap of space after the list. The html markup uses <h2> tags for the always-visible header portion and a <div> for
Any+time
Hi I am using this amazing plug-in for my site : http://www.ama3.com/anytime/ But i need help, if possible, to setup time only from 6am to 9 pm to be selectable if possible. I did try some different settings but non of them worked. I am using this so far but missing that range so if somebody can help me please. <script type="text/javascript"> AnyTime.picker( "field1", { format: "%a %b %D %z.", firstDOW: 1 } ); $("#field2").AnyTime_picker( { format: "%h:%i %p",} ); </script> thank you in advance!
Disabling a double click on a submit button
Greetings, I wrote a simple jquery snippet to prevent a double click on a submit button and it works. Button id = 'swl_submit'.<script type="text/javascript"> $(document).ready(function() { $('#swl_submit').click(function(){ $(this).attr('disabled', 'disabled'); setTimeout(restoreButton,1000); }); }); function restoreButton(){ $('#swl_submit').attr('disabled',''); } </script> This works fine. Then, I thought I could shorten this up a bit by adding the code in my restoreButton
Next Page