[jQuery] jQuery array iteration with offset?
Consider that I have an array ["a","b","c"] and that I want to iterate over it using the standard each() function like so: $(array).each(function (i) { }); However, is there an easy way to start an offset, say the second array element ("b") such that the iteration would just work on "b", "c"? Thanks.
[jQuery] Calling a jQuery function from html onClick
I am working on a project where I would like to click a link and call a jQuery function to swap some images. I have this working just with javascript, but I am stuck in syntax errors with jQuery. Essentially, I want to duplicate the functionality triggered by the link below. <a href="#" rel="{image_url}" onClick="swapImage(this.rel)"><img /></ a> //-----------Javascript-------------// function swapImage(i){ //alert(i); var image = document.getElementById('swap_image'); image.src = i; } //-----------------------------------//
[jQuery] filter expression with multiple class names
Hello again, Does anyone know how (or if it is possible) to select elements by multiple class names? For example, given the following div elements: <div class="class-one"> <div class="class-one class-two"> If I wanted to get all div elements that have *both* class-one and class-two, the only straight-forward way I can think of is the following: $("div").filter(".class-one").filter(".class-two"); It would be nice if I could do this with a single expression instead...is that possible?
[jQuery] Hot to remove or replace onclick function
HTML ------------------------------------------------------------------------- <div id="navBox"><div></div></div> <ul> <li><img src="images/nav/nav_left.jpg" /></li> <li><img src="images/nav/btn_nav1.jpg" alt="�P於新�]和�I" /></li> <li><img src="images/nav/btn_nav2.jpg" alt="�a品展示" /></li> <li><img src="images/nav/btn_nav3.jpg" alt="技能培��中心" /></li> <li><img src="images/nav/btn_nav4.jpg" alt="服��" /></li> <li><img src="images/nav/btn_nav5.jpg" alt="要��" /></li> <li><a href="member/member_login.php"><img
[jQuery] Hide("slow") bug
http://www.dannyandvivien.com/JQueryHideSlowBug.htm Can some analyze this for me please using IE7, the text changes after hide and show Best regards, Nelsen
[jQuery] Browser compatibility
I'm new to jQuery and have a simple script to set up an object in the markup. It works fine on FireFox and Opera, but fails to do anything in IE7. Are there steps I'm missing to make it work on all three? Here's the code in its simplest form: <head> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript"> $(document).ready(function() { var objectID = "myID"; classID = "myClassID"; srcUrl = "http://www.myurl.com/";
[jQuery] $this and Hover Method...
I'm pretty new to jQuery and I get pretty lost when using the $this variable. I've seen people use it in so many different ways-- ($this, $ (this), $.this, $.(this), etc-- to where I don't know which way is the correct way to use it. Anyways, can somebody look at the following code and tell me what I'm doing wrong? I have a feeling it has to do with the way I'm using the $this variable... $("#rightDiv").hover( function() { $(this).css({visibility: 'visible';}); }, function() { $(this).css({visibility:
[jQuery] Having trouble thinking through the "how": make node, append (w/o showing), then fade in ...
I'm having a hard time working through this in my mind (and a much harder time in code.) I am receiving a JSON array. I am then looping through each result, and trying to create three text boxes within a list item for each line of data. The result should look like this: <li><input type="text" value="something" />...</li> Once that node is created, I want to append it to an unordered list, but not visible, so that it can immediately slide open. I can think of some sloppy ways to do this (and maybe
[jQuery] hide("slow") and show("slow")
Hi there is a problem with hide and show in jquery 1.2.6. It works ok but the effect is it makes the font changes. Below i upload a link for your review. You can compare between the text above and below http://www.dannyandvivien.com/JQueryHideSlowBug.htm Can anyone help me. The problem only occurs in Internet Explorer, i'm using IE7 (7.0.6001.18000) Thx, Nelsen
[jQuery] Problem with jqModal + IE 6.0
I have an ASP.NET web page on which I try to use jqModal to show a modal dialog. I was able to make the modal window show up. However, it's not really modal; i.e., I can still click on everything else on the background (the parent page) and the overlay doesn't really work. Here's what I did: 1. On the page, I have a DIV section in the <form> which shows the modal dialog 2. In the Javascript, I have var t = $('#divConfirmation div.jqmdMSG'); var $jqm = $('#divConfirmation').jqm ({trigger:false,modal:true,target:t,toTop:true,overlay:100});
[jQuery] Auto Refresh of Ajax load(url,parameters,callback) command
Hi, I want to load content of a div using ajax load(url,parameters,callback) command and then to refresh content of that div in each minute using ajax load command. How do I achieve this? Any thoughts... Thanks Raghu
[jQuery] [autocomplete] local data source question
I'm using autocomplete and have some local data that looks like var locations = [ { name: "ABB Bomem CAN", locationkey: "10049" }, { name: "ANL", locationkey: "9999" }, { name: "Applied Sys Eng", locationkey: "10028" }, { name: "BNL", locationkey: "10053" }, { name: "Campbell AUS", locationkey: "10012" }, { name: "Campbell UTAH", locationkey: "10015" }, ... ]; This array is structures similar to the local data used in the autocomplete 'email' example. The problem I have is with how the plugin matches
[jQuery] Add items to superfish in runtime
How can I add items to the superfish menu at runtime? I need to make an ajax menu, I can load the first level of the menu but I can't load the the submenus
[jQuery] jQuery tabs: want ajax call to only fire once
I'm using jQuery tabs and wanted to load the non-active tab content via ajax. It looks like the default method loads the remote content each time. What I'd like to do is have it load only once when the respective tab is clicked. I haven't explored other options yet but I imagine I can write a custom json call just bypass the jQuery tabs implementation. Suggestions?
[jQuery] jQuery UI Tabset with ajax reloads tab content
Im using a jQuery UI tabset, with each tab contents loaded dynamically <div id="example"> <ul class="ui-tabs-nav"> <li class="ui-tabs-selected"><a href="accounts.php"><span>Accounts</span></a></li> <li><a href="transactions.php"><span>Transactions</span></a></li> </ul> </div> This works ok, but the tab content is loaded each time the tab is clicked. I think Id like the tab to be loaded if its not already in the DOM, but after that I want it
[jQuery] simple selector problem :beginner();
I like to select every span, thats in "this" $(this "span") sorry, simple and stupid... full function: function liCounting (){ $("#staerke1 li,#staerke2 li").each(function(liCounter){ liCounter++; //set liCounter to 1, not 0 $(this "span").replaceWith("<span>"+ liCounter +". </span>"); }) }; thx tom
[jQuery] [treeview] Attach callback to all node types
Thanks for a great plugin. What I'd like is to have any node load some html into another column of my page, instead of having to reload the whole new page. I found the toggle function in the third example, hoped to use that to load the html. toggle: function() { window.console && console.log("%o was toggled", this); } I tried using <span> for all nodes, whether expandable or leaf nodes, but <span> doesn't produce a hitarea for leaf nodes so it's not clickable. Using all links instead of <span>, how
[jQuery] Josh Nathanson's magnify not showing stage in IE7
I am almost certain that I previously had it working in IE7, which leads me to think it's some new JS that is conflicting but I can't figure it out. Where can I start to look for IE7 conflicts?
[jQuery] sortable issue
Hi, I am trying to find out element which are dragged & dropped on the list in following method: $("#example").sortable({ //if i move "1" at second position then here i want array of ids 2,1 sequence. ?? // I tried selector but it gives me all the elements. ie. 2,1,3. }); <ul> <li id="1" class="exampleclass"></li> <li id="2" class="exampleclass"></li> <li id="3" class="exampleclass"></li> </ul> Can anyone help me on this?
[jQuery] [validate] Group Validation, Validation Events
I have a few questions, given that I'm new to the validation plugin. 1. We validate groups of controls; validation for the entire group succeeds if at least one field is present -- call it REQUIRED on steroids. To implement this, we use one call to addMethod + one CSS class per group of controls. (Is there a better way?) Now assume I submit a form containing one such group with three fields, all blank. I get three validation messages, one next to each field. So far so good. Now assume I enter a value
[jQuery] In IE7, .css( 'opacity' ) does not return expected value
Happily ignore this if it has been fixed. I notice that in IE7 (I assume it works across the board for IE) that, if I set the opacity initially on an element with, jQuery.css returns 1.0 instead of the actually value in the CSS. CSS: ... opacity: .95; filter: alpha(opacity=95); ... JS: ... var defaultOpacity = item.css( 'opacity' ); // Fix to get actually opacity value if( jQuery.browser.msie ){ var ieFilter = item.css( 'filter' ); defaultOpacity = ieFilter ? (parseFloat( ieFilter.match(/opacity=
[jQuery] :last in IE6
I have a simple function to add a "last" class to the last li tag in a specific ul $(".createNewOrder ul li:last").addClass('last'); problem is in IE6 it selects all the li's and adds the class. Anyone come across this before?
[jQuery] Masked Input Plugin 1.2
There is now a new version of my Masked Input Plugin for jQuery(http:// digitalbush.com/projects/masked-input-plugin/). After a long absence with this project, I finally decided to tackle some of the more requested features that have been sent to me. I also did some big reorganization to make room for some future enhancements. With all the changes, it seemed appropriate to bump this version from the 1.1 series. *Paste support for more browsers. It should now work in IE7, Firefox 3, Safari, Chrome,
[jQuery] SlideShow based on SQL Server
I am brand new to JQuery, but very excited over it. I have looked at s3Slider and similar packeges, but they all seem to get their images statically, either by referencing a folder or by just referring to them ("1.jpg, 2.jpg, .... "). I have a database with image paths (images/woof1.jpg), for example. How do I use JQuery with an asp.net technology, like Linq, or even a Web Service to be able to "feed" a slideshow, or anything similar? Thanks to all, Paolo
[jQuery] .eq() vs .slice()
I'm making some modifications to an older project that originally used jQuery 1.1.2. I've installed 1.2.6 and am in the process of reviewing and upgrading the code based on the changes documented at http://docs.jquery.com/Release:jQuery_1.2#Removed_Functionality There are many places in this project where .eq(n) is used. From reading this group I've seen that .eq( ) went away with 1.2 but was brought back in 1.2.1? I also don't see any mention of .eq being deprecated in the latest docs at http://docs.jquery.com/Traversing/eq#index.
[jQuery] [validate] - Validation by regular expression
I've created a useful addition to your class that you may want to include in a future version. Set the value of the regex attribute to a regular expression. If any characters in the input don't match the regex, it returns false. Very handy. Here's the source: ------------------------------------------- In rules: if (data.regex) { var param = data.regex; delete data.regex; data = $.extend({regex: param}, data); } ------------------------------------------- Then in methods: regex: function(value,element,param)
[jQuery] [cluetip] with xml
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"> <META content="MSHTML 6.00.6001.18148" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=#ffffff> <DIV><FONT face=Arial size=2>Hi all,</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV> <DIV dir=ltr>I must display in a cluetip (jquery) some information from an xml file. <BR>My html file is: <BR><EM>echo "<td><div class=\"blocCataloguelibelle\">";
[jQuery] superfish and other jquery scripts conflict in IE 7
Hi, I'm using superfish for this website i'm working on while using other scripts that are all under jquery. Basically I have 3 sets of navigation going on. 1. main navigation using superfish 2.sidebar using spritefade 3.three huge panels that are links and do a simple fade when hovered. I've put the superfish script last on the on window ready function and as soon as i load it in IE, it disables the effect of all the scripts. However, if i take out superfish script then the effects of the other
[jQuery] Find functionality consistence?
Hey! I have a problem with find: It only appears to find "descendant" elements of a collection or element. I've been using JQuery for 3 years and unless memory fails me, find used to find stuff on the same level as well. I posted it as bug report here http://dev.jquery.com/ticket/3694 And looking at the find example over at http://visualjquery.com/ it seems that it should select elements on the same level since the example basically selects spans using find and then selects those that have "t" letter
jQuery and unsupported browsers
I wonder how jQuery behaves when loaded into a browser that is not supported. Specifically: (1) If I have a website that loads jQuery.js but no jQuery function is ever called. Is it a problem if I want to view this page with an unsupported browser? Netscape 4, IE 5, Opera 7, etc. (2) Assuming the above is not a problem, can I still expect $.browser to contain meaningful values and use them to tell whether I may use jQuery or not? I really miss something like $.browser.isSupported.
A little help needed
Hi everyone, just joined the forum. I'm just starting to learn JQuery and loving it so far but i've run into a problem and could do with a little guidance. It's probably a relatively simple thing. What I have is an unordered list with say 9 <li> items. I want to select the first 3 and style them differently and then add some animation but so far have been unable to find a selector I can use to select more than one <li> item. Do i just need to use $("li:eq(x)") and do one for each item I want to select
[jQuery] Server Side programming and JQuery best practice
Hi all. What is the best way to pass "parameters" from the PHP script that generate the page to the Javascript/JQuery functions that enhance the page ? In my page there are several element that trigger an ajax request and show the result in a box. Of course each ajax request has a different url to load. how should i tell my js function which url to load ? the url is just an example, there many different data i would like to pass to my js functions. I have done this in a couple of way, but i'm sure
[jQuery] SuperFish - Load sub menu with Ajax
Hello. I put the superfish menu on my page and using the OnBeforeShow method, I am fetching menu items via ajax and placing the LI's in the current UL. I also see if there are children for the newly refreshed sub items and I nest a new UL sort of like this: if(item.subPageCnt > 0){ subIndicator='<span class="sf-sub-indicator"> »</span>'; newUL='<ul ><li><a href="#aa">menu item</a></ li></ul>'; } theUL.append('<li><a href="' + item.url +'" target="' + item.target + '">' + item.displayName + subIndicator
Please check my img attributes
I'm trying to add several attributes to all my img tags but I'm not sure if they're both working. Could you verify if these are correct? $(document).ready(function(){ //add the width and height for each image $('img').each(function(){ $(this).attr('width', $(this).width()); $(this).attr('height', $(this).height()); }); //copy alt to title $('img').attr('title', function(){ $(this).attr('alt'); }); }); Am I doing the right thing?
Cycle.js not behaving... Can't get it to work no matter what
Hello I am trying to get cycle.js to work, and I have no idea why it isn't. Here is my code: <script src="scripts/jquery.js" type="text/javascript"></script> <script src="scripts/cycle.js" type="text/javascript"></script> <script type='text/javascript'> $(document).ready(function(){ $('#s1').cycle('fade'); }); </script> And you can view the test site live here: http://hbeckett.com/presentation/ A solution would be greatly appreciated. Thanks
[jQuery] How modal windows work ?
Hi everyone ! I'm really curious about how modal window work behind the jquery. When modal window appears, the entire web page changes color into black or gray so that it becomes disabled, but modal window. Can you guys PLEASE tell me how it really work ? What javascript code beind those kind of jquery take place ? modal window examples: http://dev.iceburg.net/jquery/jqModal/#examples http://www.ericmmartin.com/simplemodal/
driving me mad - ajax
Ok I have the following code which retreives and xml file - the code then locates each 'description' node and loads the contents into an array. It then loops through each 'term' in teh xml file and looks for that string withint the specified container. if found the terms is wrapped in a span. All works fine in FF but IE simply cannot parse the xml properly... The code... $.ajax ( { type: "GET", url: "http://localhost/jargonterms.xml", dataType: ($.browser.msie)
[jQuery] $.livequery.registerPlugin() doesn't work?
[Posted to jquery-dev http://groups.google.com/group/jquery-dev/msg/c33c84a2db495f88 and then realized that it may get better response here] I'm trying to register a simple plugin with livequery, but it doesn't work as expected. Code snippet: $.fn.confirm = function() { this.click(function() { return window.confirm("Are you sure you want to " + this.innerHTML.toLowerCase() + "?"); }); }; if ($.livequery) { $.livequery.registerPlugin('confirm'); } Testing: <a href="#" class="delete">Delete</a> <a
[jQuery] [validate] Test that at least one input element has value
I have a product listing where the user can enter the required quantity of each product. The setup is something like this: <form> <ul> <li><label for="name">Name</label><input name="name" id="name" /></ li> <li><label for="address">Address</label><input name="address" id="address" /></li> ... <li><input class="quantity" name="product1" />Product1</li> <li><input class="quantity" name="product2" />Product2</li> <li><input class="quantity" name="product3" />Product3</li> <li><input class="quantity"
Problem with insertion of HTML into a SPAN
I am very new to jQuery. I am trying to inject a HTML string into a span whose ID is msg. The normal javascript : document.getElementById("msg").innerHtml("result"); The above is what does it in javascript way! How do i do it in jQuery way. I was trying something like: $("#msg").innerHtml("result"); but I didnt have luck!! Please help me out with this[/code]
Next Page