[jQuery] Loading before dom = ready - Best Practices.
While virtually every site in existence trumpets using the jQuery DOM- ready shortcut as an absolute must, I've come across situations which I feel frustrate the user, particularly when using jQuery to create a navigational element. I often work on sites which are going to have a lot of external content (ads, feeds, analytics), and if even one of them is sluggish to load, none of my interactive elements are responsive for that time. There seem to be three options: 1] liveQuery (disadvantage: overhead)
[jQuery] jQuery DOM reference problem
Hi, I am pretty new to jQuery. I like to cache jQuery selector, i.e, the DOM references. But when to clean up the cache is tricky. I just wonder if there is any way to validate the DOM reference directly and know if the page is refreshed or updated. Thanks in advance, John
Execute jquery after ajax load
hi everybody i have question about how to execute the javascript code after call it by ajax sure with jQuery ? for exmple <script type="text/javascript" src="dfile/js/jquery.js"></script> <script type="text/javascript"> function pri(forshow,forhid_1,forhid_2,forhid_3){ $(forshow).show(); $(forhid_1).hide(); $(forhid_2).hide(); $(forhid_3).hide(); }; </script> <label><input type="radio" name="prices_time" onclick="pri(p_0,p_1,p_2,p_3);" value="6" checked>6 months</label> <label><input
[jQuery] get(), load(), ajax() nothing works right in ie7
I have been trying everything i can try and nothing is working. i have a module position that should load a php file that populates user pictures and links to their profile. It works fine in everything but ie7 and in ie7 it just loads the last picture. ive tried load, get, and ajax. I have tried to append random numbers to url for cache related issues i have read about and still nothing works. here is the code i am using no for ajax: also the url is: http://undergroundinnertainment.com can anybody
[jQuery] Get first child within an element
Hi, I've got a reference to a TableCell and I'd like to use jQuery to get the first instance of an <IMG> tag within that TableCell, but can't get the syntax right, I understand how it would work if I were to reference the TableCell by and ID or class, but not when I have a direct reference to the cell, I've got: var tdRef = xxx; $(tdRef).html(); ... could somebody let me know what the jQuery syntax should be to get the first img tag within "tdRef"? Thanks! :-)
[jQuery] jquery array
I need to make a array from a list <ul><li class="data"><img src="x"><table><tr><td>data></td></tr></ table></li> <li class="data"><img src="x2"><table><tr><td>data2></td></tr></ table></li> <li class="data"><img src="x3"><table><tr><td>data3></td></tr></ table></li></ul> I am having a hard time using jQuery.makeArray() to make an array from the data and print it out. How can this be done. Thanks -Tom
[jQuery] refactoring code
Hello, Does anyone have any advice in regard to refactoring jQuery code to make it more efficient/elegant/simple? I have some experience with this (making variables etc.) but was wondering if there were some key things to think about or do to push myself up the learning curve a bit. Thank you for your time, Calvin
[jQuery] jQuery + document.write + ajax
Hi Folks, by clicking on a link I want to reload a skyscraper banner. The code for the skyscraper banner is in a file_with_the_banner.html I want to include this file with jquery ajax. I have this code in the index.html <script type="text/javascript"> $(function() { $('a').click(function() { $('<div id="info" />').load(file_with_the_banner.html #bannercode, function() { $(this).hide() .appendTo('#skyscraper) .slideDown(1000); }); return
[jQuery] Table sorter.
I was searching for a table sorter plugin and I found this one http://tablesorter.com/docs/ Is the official plugin for this purpose or there is something else. Kind regards Massimo
[jQuery] Help : sort name in an <ul> where the li's a created from drag and drop.
Hi as the title says i'm looking to order a list taht is created by drag and drop. the structure is a normal unordered list <ul> <li>C item</li> <li>E item</li> <li>D item</li> <li>F item</li> <li>F item</li> <li>A item</li> </ul> Can someone help me with that please. Have looked at sort , sortable , etc... But no real explanation found. Regards
[jQuery] Anybody know where to get this slideshow?
http://new.myfonts.com/fonts/parachute/pf-fuel-pro/overview.html See how the menu drops out of site when the mouse is not on the image? I like that...anybody know where to find a jquery slideshow like this?
[jQuery] $.getScript Must Take .js File?
I am using codeigniter and it forms urls like this: http://mydomain/index.php/system/edit_js I'm trying to call $.getScript by going: $.getScript("http://mydomain/index.php/system/edit_js") but I get a 404 not found error. I pasted the url in my webbrowser and it works just fine. Is there any way to make this work?
[jQuery] Animating height but closing any already open (like an accordion)
<html> <head> <style> .hmmessage P { margin:0px; padding:0px } body.hmmessage { font-size: 10pt; font-family:Verdana } </style> </head> <body class='hmmessage'> Hi all! I have anywhere from 3 - 8 DIVs on a page that I open/close (animate height toggle) via a button and want to close any (one) that are already open when another is opened - just like an accordion. How do I either determine the current open state of a DIV so I know which to close, or maybe close all of them (less efficient) before opening
[jQuery] Safari Layout Issues
For some strange reason I am only having layout issues in Safari, even IE6 renders the page correctly! I have using jQuery Cycle on the page, and I am starting to wonder if that is what is causing the layout issue. Example: http://www.caldwellsnyder.com/home It seems that the div #home_exhibition_hold won't honor the height and width settings when loaded in Safari. And I am wondering if there is some js that is effecting this. Does anyone have any ideas?
[jQuery] Background flash white briefly
I have a project where I am implementing the jQuery library, and I believe it is causing my body backgrounds to flash white very quickly from page to page (the entire site has the same image background). This only appears to be happening in Safari 3.2.1. The reason I believe it is jQuery is because I tested it with and without the library: when jQuery is removed, the backgrounds don't flash white at all, and behave how I expect them. Is there a solution to this problem?
S3Slider + Superfish
Hello, I am using both Superfish drop down menu and S3slider for image rotation. In IE I am having problem of drop down menu going behind the slider. I tried to some way outs by assigning z-index to menu but it is not helping me. All the other browsers showing it properly. Please let me know anything which can make that work properly... Thanks in Advance...
[jQuery] integrating galleria and scrollto
I have been trying to work the bugs out of this thing for days and just seem to make more problems as I go. example: http://www.ezfoamglove.com/dev/scroll_gallery.cfm Overall: Once you reach the end of the images I would like the ul.image_elements to scroll back to the first image. I am getting 'undefined' in FireFox. Ill start with that....thanks,Adrian
[jQuery] creating an animated PNG loader pinwheel (sprite)
So I was trying to think of a way to create what was effectively a PNG animation similar to an animated GIF. What I decided was that it would be fairly simple to make a PNG sprite of each 'frame' of the animation, then set that image as the background of a container div, then move it in a stepping fashion to reveal each frame, then reset it when it gets to the end of the strip. If someone could help with the JQ to do the background-position stepping and the reset, I will post a link to the completed
[jQuery] Jquery 1.3 - Not all selectors work in IE 8?
I found that certain selectors work in all browsers except IE 8 and they need to modified. This selector pattern seem to work well in all browsers, including IE 8: jQuery("input[class='class_name'][type='text']") But this identical selector works in Firefox, Safari but not in IE 8: jQuery("input.class_name:text") In IE 8 it returns a "property not found" javascript runtime error. I don't know whether that the actual issue or if it is a side effect of some memory leak. Giovanni
[jQuery] Open browse UI on clicking a button
Hi, I have a form to upload a photo/file. I have the following html code snippet. <input type="file" id="file" style="display:none;"/> <input type="text" id="file_visible"/> <input type="image" src="image.jpg" onclick="clickFile()"/> The problem is that I don't want to show the default "Browse" button with the input type="file". So, I have made the first input invisible, and instead, I am showing a text field and an image button. I want to trigger the click event of the first element. Here is the
Click handler problem in Safari
Hello- I'm attaching a click handler to all hyperlinks on a page. It makes a web service call. My desired behavior is for the web service to be called, and then have the link execute its default behavior. Here is my code: $(function() { $('a').live('click', function(event) { //event.preventDefault(); MyServiceCall($(this).text()); }); }); This works as expected in Firefox and IE. In Safari, my web service never gets called unless I uncomment the preventDefault, but doing
[jQuery] performance of jQuery.each
Hi! I saw that the jQuery.each function iterates over the array like this: for ( name in object){} From what I read this is one of the slowest ways of iterating over an array in js. I made a very simple test like: var array = []; for (var i = 0; i < 1000000; i++) array[i] = Math.random(); var t = new Array(); //Start jquery.each test var start = (new Date).getTime(); $(array).each(function() { t.push(this);
[jQuery] Lightbox with thumbnails
Hi. I am looking for a version of lightbox that would allow the user to click on a single reference image and when the "lightboxed" version appears a strip of thumbnails would be available at the top or bottom of that image. Thus, the user could navigate between images within the lightbox by clicking on a different thumbnail. If such beast exists a URL would appreciated. Extensive Googling hasn't turned up what I'm looking for at all. TIA, Laker
[jQuery] [Star Rating Plugin] How to change the star rating display WITHOUT firing off the click callback?
Hello, I am using the Star Rating Plugin from http://www.fyneworks.com/jquery http://jquery-star-rating-plugin.googlecode.com/svn/trunk/index.html What I am trying to do is when a star rating is initially requested, an ajax submit is fired off to update the database on the server side. However IF the user has already rated the item in question I want to be able to reset the star rating back to its initial display state (whatever the initial rating was). I am attempting to do this in the ajax submit
Help with selector
I have an html file that has many forms with many fieldsets inside and they are gonna be submitted via ajax... I havent gotten that part figured out yet because I want to have the user submit these forms in order so I want to disable the input elements of the rest of the forms while the first one still hast been submited... s, say I have form 1 with id=form1 and many fieldsets and inputs, form2 with id=form2 with many fieldsets and inputs and form 3 with id=form3 with many fieldsets and inputs....
[jQuery] SuperFish Arrows
How is the arrows displayed in the superfish menus? If I would like to change to an image of my choice, how do I go about? Regards, Praveen
[jQuery] jQuery Recursion/Iteration through JSON variable.
Hi I would like to know if there is a simple way to show all elements of that variable? var collectionElements = { teste: { var1: 'teste[]', var2: 'brincadeira-2', var3 : 'Elemento 2' }, teste: { var1 : 'teste[]', var2 : 'brincadeira-3', var3 : 'Elemento 3' }, teste: { var1 : 'teste[]', var2 : 'brincadeira',
[jQuery] basic image gallery, running into a few problems
Hello there, I have created a simply navigable image gallery with a bit of json, as well as .animate() and altering the margin of elements. Currently, I am pulling in the 5 most recent images with a tag of 'spock' from flickr. It seems to be working fine, except that when clicking through very fast it gets a bit wonky. I am also really curious as to opinions on better ways of doing this? Perhaps there is a way that relies upon the json instead of simply just injecting it into the dom right off the
[jQuery] Get background-image url ?
What is the best way to get the background image url in css? i have found this in crossfade plugin but does not work in opera.. var target = $$.css('backgroundImage').replace(/^url|[\(\)]/g, '');
[jQuery] traversing UL: Request for help
Request: I want to highlight every "<A>" within the parents of an object up to the base element of "<UL>" For example, this original code: <ul> <li><a href="/">link</a></li> <li><a href="/">link</a> <ul> <li><a href="/">link</a></li> <li><a href="/">link</a> <ul> <li><a href="/">link</a> <ul> <li><a href="/">HOVER OVER THIS</a></li> </ul> </li> <li><a href="/">link</a></li> </ul> </li> <li><a href="/">link</a></li> </ul> </li> <li><a href="/">link</a></li> </ul> Should appear like so (assuming an
[jQuery] animate color over time using Timers plugin
Hey all, I'm using the Timers plugin to do a count down timer. I like it a lot. I would like to enhance my UI by having the numbering being counted down transition from black to red as it gets closer to 0. The jQuery UI demo for animate seems to be what I need, but what I'm having trouble figuring out is how to have it transition gracefully over time. It seems like the animation is a one-shot deal. Any help or tips with this? Thanks. http://jqueryui.com/demos/animate/
[jQuery] Delayed execution
Hi, my page allows the user to enter a number in a text box and a search request is sent to the server (if the user stops typing for 200 ms) using AJAX. The following is the desired behavior. (1) User starts typing a number in the text box. As the user is typing, no search requests are sent to the server. (2) Once the user stops typing (i.e. no key events for 200 ms), use $.post() to execute a search. What is a good way to detect that the user hasn't typed anything for 200 ms? Is there anything in
[jQuery] finding mouse position within a div with a scrollbar
I have a div with an overflow, so it has a scrollbar. The "what are my mouse's coordinates" tutorials (like this one: http://docs.jquery.com/Tutorials:Mouse_Position) only yield A) the coordinates of the mouse on the page (using "e.pageX" and "e.pageY", or B) the absolute coordinates of the mouse, within the element, on the page (using "e.pageX - this.offsetLeft;"). What I want to do is to find out how far down, *within my scrolling element*, the mouse is. Best way to think of it: picture a calendar,
getting a show effect to stop when another effect is started
Im having a bit of trouble with the bounce show effect from jquery ui. To see what I mean, check out my development site. Anytime you modify a part in this computer builder, the rigth side gets updated. Right now its removing and adding list items. Problem is when click items too fast, the animation doesnt finish and the next item gets bumped lower and lower. http://remote.xcsit.com:800/ReyniersAud ... modelId=16 Here is the code so far ( I know its messy, im new! ) $('input:radio').click(function(){
[jQuery] Changing the arrow color : Superfish
How to change the arrow color(right and down arrows) in the superfish menu? -Praveen
[jQuery] AJAX Response causing character display problems with chars like
Hi Guys, When passing a é character as part of an an ajax responset and printing the text to the screen from js, the value display as a ?. I tried converting the piece of text to utf8 and then it displays correctly on a windows server however on Linux server the vallues still displays as a ?. I am using Java as my backend code and encode the text as UTF8 by using the getBytes method. Can anybody assist me with the problem or have any suggestions how to go about fixxing it. Regards, Ryan
Simple jquery/iframe problem
Hello everyone! I would just like to say that I am new to the site as well as programming with jquery. Anyways, here is my question. I am using a tutorial(this one to be exact: http://designreviver.com/tutorials/jquery-examples-horizontal-accordion/) to create a banner. Here is what I want the final banner to look like: I have coded the .CSS and added the jquery to my html file and now it looks like this: The banner dimensions are 300x100px. So I put it in an iFrame. This is what my iframe looks
[jQuery] validation plug in flicker
I am using the jquery validation plugin, i am wanting to place all the errors in one div at the top of the form - which works. The problem is that the first time I submit the form (in FF for MAC) the classes that get assigned to the form elements get added, and removed real quickly. (I have a bg color of red on the form, so i can see a flicker basically) - works just fine in safari. has anyone seen anything like this?
[jQuery] Preventing certain child elems triggering a parent event
I'm adding a feature to a table where it can have a compact r a verbose display. When in compact mode a class is added to the table causing various various elements in the table cells to match a CSS rule to set them display: none. I want to be able to expand individual rows by clicking to them so I added a live event handle to the rows that causes the row to have a class added when clicked. With more stylesheet rules I can restore the full view to just the clicked table row. The problem is that the
[jQuery] 2 Superfish menus on one page (1 verticle, 1 horizontal)
I can get them both to display but I need to style each one differently I have copied the basic styles and renamed them xx2 and then renamed the ul class to match but it doesn't like it!! Anyone have any ideas?
Next Page