[jQuery] Multi-line tabs plugin
'lo all, Is there a tabs plugin out there, or a recommended method / piece of CSS which can gracefully handle when the tabs go onto more than one line? I'm using UI 1.7.2 tabs at the moment and the tabs go a little odd when there are enough of them to go multi-line. All suggestions appreciated J Regards, Michael Price
[jQuery] jQuery plugin that can do the image effects here?
'lo all, Boss has been asking me if we can replicate the image fader here: http://www.gleneagles.com/home.aspx Note how it pans and slides as well as fading between images - this one is done in Flash. We often use the Cycle plugin for a fade-between set of images but is there a plugin to do something like the above, or can the Cycle plugin be made to do it? Regards, Michael Price
[jQuery] Re: jQuery plugin that can do the image effects here?
That would be absolutely perfect :D Thanks! Regards, Michael Price From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Charlie Griefer Sent: 30 September 2009 17:19 To: jquery-en@googlegroups.com Subject: [jQuery] Re: jQuery plugin that can do the image effects here? Hi Michael: Would this do? http://www.gruppo4.com/~tobia/cross-slide.shtml On Wed, Sep 30, 2009 at 5:48 AM, Michael Price m...@edwardrobertson.co.uk wrote: 'lo all, Boss has been asking me if we can replicate the image fader here: http://www.gleneagles.com/home.aspx Note how it pans and slides as well as fading between images - this one is done in Flash. We often use the Cycle plugin for a fade-between set of images but is there a plugin to do something like the above, or can the Cycle plugin be made to do it? Regards, Michael Price -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.
[jQuery] Re: This is not a function
Looking at the (many!) Javascripts you've got running there, you appear to be loading jQuery twice: Line 21: script type='text/javascript' src='http://wptest.moppieillusions.com/wp-includes/js/jquery/jquery.js?ver=1 .3.2'/script Line 65: script src=http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js; type=text/javascript/script They're the same version so it might not matter - but it's worth removing one of them since you don't need to load it twice anyway. Regards, Michael Price -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Chris Cardarello Sent: 27 August 2009 10:52 To: jQuery (English) Subject: [jQuery] This is not a function Ok for some reason none of my jQuery is working i get these errors : Error: $ is not a function Source File: http://wptest.moppieillusions.com/ Line: 52 Error: $ is not a function Source File: http://wptest.moppieillusions.com/ Line: 100 Error: $ is not a function Source File: http://wptest.moppieillusions.com/ Line: 77 Error: jQuery(a.lightbox).lightBox is not a function Source File: http://wptest.moppieillusions.com/wp-content/plugins/flexible-lightbox/js/li ghtbox_call.js Line: 7 Error: window.attachEvent is not a function Source File: http://wptest.moppieillusions.com/wp-content/themes/wpShop/js/unitpngfix.js Line: 4 Error: window.attachEvent is not a function Source File: http://wptest.moppieillusions.com/wp-content/themes/wpShop/js/unitpngfix.js Line: 4 Its like jQuery isnt loading this is the url http://wptest.moppieillusions.com/
[jQuery] Get inner class of event
Hi all, Got a div on a page, and we want something to happen when a user clicks on the div. However, within the div is a link and we want something DIFFERENT to happen if they click on the LINK rather than anything else in the div. Clicking the link is triggering the div click code as well - I need to stop this which I thought I could do with e.stopPropagation(); on the link click handler, but it doesn't seem to be working. Is there any way to pick up via the div click handler that it was actually the LINK, and react in there instead, or am I taking the wrong approach? Regards, Michael Price
[jQuery] Re: Get inner class of event
Hello again folks - as per usual, I managed to get this working five minutes later! So never mind, but thanks if you were going to take a look at it J Regards, Michael Price From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Michael Price Sent: 21 August 2009 11:12 To: jquery-en@googlegroups.com Subject: [jQuery] Get inner class of event Hi all, Got a div on a page, and we want something to happen when a user clicks on the div. However, within the div is a link and we want something DIFFERENT to happen if they click on the LINK rather than anything else in the div. Clicking the link is triggering the div click code as well - I need to stop this which I thought I could do with e.stopPropagation(); on the link click handler, but it doesn't seem to be working. Is there any way to pick up via the div click handler that it was actually the LINK, and react in there instead, or am I taking the wrong approach? Regards, Michael Price
[jQuery] Re: How to POST using jQuery?
Is there any particular reason you HAVE to use Javascript to handle the form submission? If you want to redirect the user to another page after the form submission you may as well submit the form the normal way and use a server side redirect to send them on to the next page. Failing that, you could make your form processing script return the next page in it's response, parse for this and then use it - is that feasible? SUBMIT FORM PARSE RESPONSE WHICH WILL CONTAIN NEW PAGE URL IN IT window.location = newPage; Regards, Michael Price -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Mark Smith Sent: 12 August 2009 16:02 To: jQuery (English) Subject: [jQuery] Re: How to POST using jQuery? But then the page that gets served to the user with have no parameters posted to it. On Aug 12, 3:50 pm, Liam Potter radioactiv...@gmail.com wrote: well, on the post callback, forward the browser to the page? window.location=/page.php Mark Smith wrote: Hi, I know you can use jquery to post data from a json object ajaxly. However I want to redirect the browser to the new page (like submitting a form) only passing the values explicitly from javascript rather than actually submitting a form. Is this possible using jquery? Thanks
[jQuery] Old cookie data sent in AJAX request?
Hi all, Having a bit of a strange problem and I'm not altogether sure whether it's jQuery related or something to do with the awful, awful code it's part of, but I thought I'd post up here to see if I could get some help figuring that out J I've got a webpage which has three cookies on it, cart_id, user_data and user_other. Navigating around the pages and using the Firefox Web Developer Toolbar shows these cookies are fine, one of each is set, and they're the correct values. If, however, I submit an AJAX post request to add a product to the shopping cart on this site, it doesn't work. Investigating the AJAX behind this shows that two copies of every cookie named above is being sent - the first copies have older and now incorrect data in them, and are followed by the CORRECT data. Looks a bit like this: cart_id=4a6b2bec89523599aa20a6ff7cc148f7; user_data=12%7C; user_other=1; PHPSESSID=4c20e081a27ccba42a1f1009905f6f56 ; session_id=a56c7977d215631d6f9eebadab534089; user_data=5%7C424235235; user_other=0; cart_id=4e77b0 044b97d0ba322a4641ee2fcf6b As you can see, cart_id, user_data and user_other are there twice. PHP is evidently picking up the first copy of each cookie - the older, incorrect ones - and using these. Meaning the products go into the wrong cart and I've got myself a bit of a problem. Has something like this ever happened to anyone else - and was it something in your own code, or a weird jQuery glitch? Because it will probably be relevant, we're talking about jQuery 1.2.6 here. Regards, Michael Price
[jQuery] Re: What's the best way to replace text in a node?
You can use either: $(selector).text(New text); Or $(selector).html(New text); Both also work as getters if you don't provide an argument: theText = $(selector).text(); theHTML = $(selector).html(); Is this what you were after? Regards, Michael Price -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of George Sent: 18 May 2009 12:09 To: jQuery (English) Subject: [jQuery] Re: What's the best way to replace text in a node? Sorry, folks, I'm not using remove(), I'm using empty() - like this: JQUERY p id='dText'text to be replaced/p $('#dText').empty().append('New text string') On May 18, 12:02 pm, George george.bea...@googlemail.com wrote: I'm guessing this should be a simple one for the jQuery stalwarts here. I've recently moved over from Protoype and was used to using the update() function to replace text within a node - something like this: PROTOTYPE p id='dText'text to be replaced/p $('dText').update('New text string') JQUERY p id='dText'text to be replaced/p $('#dText').remove().append('New text string') Now it appears to me that in jQuery, there isn't an out of the box function to replace the contents of a node without also replacing the node too, hence the reason I am chaining remove() and append(). Is there a better way to achieve this? Many thanks George
[jQuery] Re: Does IE simply not work or...
You have another comma at the end of this line: pdiro: $(#pdirection).val(), Get rid of that and see if it helps. webspee...@gmail.com wrote: That is what I figured. How does this block of code look? [html] $.post(../pu/puajax-x.html,{ mode: contactrow, loginid: $(#loginid).val(), field: $(#sortfield).val(), prowid: $(#prowid).val(), pdiro: $(#pdirection).val(), }, function(xml) { displayContactName(xml); }); return false; [/html] JS debugger points to the , before the function(xml) call. I keep getting errors about error: expected identifier, string or number. On Feb 16, 6:05 pm, MorningZ morni...@gmail.com wrote: And rest assured that the library (including the validation plugin) FULLY work withIE, it's your code and how you are using jQuery that is the issue On Feb 16, 3:58 pm, Dean C. Reed webspee...@gmail.com wrote: Or is there a common work around? I spent a few days getting familiar with JQuery and it works perfectly in Firefox. I go to test it inIEand literally nothing works. Aside from the basics, I'm using a validator plugin, but I'm getting JS errors at every turn. Vague errors like object expected when I'm simplycalling a JS function that uses JQuery calls. IEis very frustrating, they should just shoot it and put us out of our misery. Regards, Michael Price
[jQuery] Cloning list items in OL screws up numbering in IE
Hi all, I've got an ordered list OL with 5 list items. Each list item contains an input and the list is, as you would expect, numbered from 1 to 5. There is a link to add another item to this list which I have bound the following function to: $(#materialadd).click(function() { $(#materialol li:last).clone().appendTo(#materialol); $(#materialol li:last).hide().fadeIn(fast); return false; }); #materialol is the list - the last item is cloned and appended to the end of the list, then hidden and faded in so the user can spot the change. In Firefox, this works perfectly, and the list numbering is continued. Click it once, and the next item is 6, then 7, then 8... In IE.. not so much. IE 6 and 7 both execute the cloning and addition process but the list items numbers of the cloned + added items are 1. So you end up with a list numbered 1, 2, 3, 4, 5, 1, 1, 1, 1, 1. Is there another way for me to do what I'm doing that will work properly in IE as well as FF? I'm using jQ 1.2.6 by the way. Regards, Michael Price
[jQuery] Re: Cloning list items in OL screws up numbering in IE
Thanks Rick, I'll check that out. Meanwhile, my own testing has uncovered a possible cause, and it's an odd one. If I comment out this line: $(#materialol li:last).hide().fadeIn(fast); The list items are numbered correctly! Curiouser and curiouser.. Regards, Michael Price Rick Faircloth wrote: Hi, Michael... I was having a similar problem cloning image inputs and found this solution for that problem, which might also be modified to solve your li cloning problem. In the notes, it basically says that not all modern browsers (IE, I think is the problem here) updates the values of cloned elements. So this fellow, Ben Nadel, developed a word-around: Here's the link... http://www.bennadel.com/blog/1375-Ask-Ben-Dynamically-Adding-File-Upload-Fields-To-A-Form-Using-jQue ry.htm Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Michael Price Sent: Wednesday, January 28, 2009 7:10 AM To: jquery-en@googlegroups.com Subject: [jQuery] Cloning list items in OL screws up numbering in IE Hi all, I've got an ordered list OL with 5 list items. Each list item contains an input and the list is, as you would expect, numbered from 1 to 5. There is a link to add another item to this list which I have bound the following function to: $(#materialadd).click(function() { $(#materialol li:last).clone().appendTo(#materialol); $(#materialol li:last).hide().fadeIn(fast); return false; }); #materialol is the list - the last item is cloned and appended to the end of the list, then hidden and faded in so the user can spot the change. In Firefox, this works perfectly, and the list numbering is continued. Click it once, and the next item is 6, then 7, then 8... In IE.. not so much. IE 6 and 7 both execute the cloning and addition process but the list items numbers of the cloned + added items are 1. So you end up with a list numbered 1, 2, 3, 4, 5, 1, 1, 1, 1, 1. Is there another way for me to do what I'm doing that will work properly in IE as well as FF? I'm using jQ 1.2.6 by the way. Regards, Michael Price
[jQuery] Re: Trying to assign onClick to a link
Matt wrote: Hi everyone, I'm very new to jQuery and am trying to have a div toggle between hidden and shown using the slideToggle function. This is my code that I have in the head of my html: $(document).ready(function(){ $('a#link').click( $('div#bugDiv').slideToggle('slow') ); }); The link that I want to associate the onClick to has an id of link and the div has an id of bugDiv. Right now, the way it works, the bugdiv slides to hidden on load, as though it's just executing the code as opposed to associating it as the onclick action.. Any help would be appreciated! Thanks in advance, Matt Hi Matt I think the click handler will need wrapping in a function as well: $('a#link').click(function() { $('div#bugDiv').slideToggle('slow'); return false; }); I've also added return false as Mike suggested which will stop the link's default action from being followed. Regards, Michael Price
[jQuery] Re: Norton thinks jQuery is a virus?
Anyone got any ideas? This is now happening to one of our guys on any site he visits that is using jQuery. Even interface.js got blocked at one point.. Michael Price wrote: Hi all, Couple of lads in here using IE and Norton Antivirus 2009 have suddenly had popups in our intranet declaring that an intrusion attempt has been blocked and a file has been prevented from running. The source of this supposed intrusion? A compressed jQuery - can't remember which version it is. Norton is now preventing any of our sites that use jQuery (which, believe me, is quite a few) from executing jQuery based code on at least one of these computers. The details: Risk name: HTTP Acrobat PDF file suspicious download File: jquery.js Network traffic from site address matches the signature of a known attack. We've been running NAV 2009 on three machines in here for quite a few weeks now - I use Firefox and NAV (not through personal choice, I might add), and haven't seen this error pop up. Anyone got any ideas how to reverse Norton's stance on this? Surely it HAS to be a false positive but now we've got two machines that won't run jQuery as a result! Regards, Michael Price -- Regards, Michael Price - [EMAIL PROTECTED] --- Edward Robertson Ltd. - 1 Bondgate, Darlington, DL3 7JA Direct: 01325 245077 - http://www.edwardrobertson.co.uk Office: 01325 489333 - http://www.internetwebsitedesign.co.uk --- Registered Address: 1 Bondgate, Darlington, County Durham, DL3 7JA, UK Registration Number: 3931089 - Company registered in England --- This electronic message transmission contains information from Edward Robertson Limited that may be proprietary, confidential and/or privileged. The information is intended only for the use of the individual(s) or entity named above. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic transmission in error, please notify the sender immediately by replying to the address listed in the From: field.
[jQuery] Norton thinks jQuery is a virus?
Hi all, Couple of lads in here using IE and Norton Antivirus 2009 have suddenly had popups in our intranet declaring that an intrusion attempt has been blocked and a file has been prevented from running. The source of this supposed intrusion? A compressed jQuery - can't remember which version it is. Norton is now preventing any of our sites that use jQuery (which, believe me, is quite a few) from executing jQuery based code on at least one of these computers. The details: Risk name: HTTP Acrobat PDF file suspicious download File: jquery.js Network traffic from site address matches the signature of a known attack. We've been running NAV 2009 on three machines in here for quite a few weeks now - I use Firefox and NAV (not through personal choice, I might add), and haven't seen this error pop up. Anyone got any ideas how to reverse Norton's stance on this? Surely it HAS to be a false positive but now we've got two machines that won't run jQuery as a result! Regards, Michael Price
[jQuery] Re: Norton thinks jQuery is a virus?
Christof Donat wrote: Hi, Anyone got any ideas? This is now happening to one of our guys on any site he visits that is using jQuery. Even interface.js got blocked at one point.. Risk name: HTTP Acrobat PDF file suspicious download File: jquery.js Are you shure, your Server does not deliver .js Files as application/pdf? Na - it's happening on other sites not built by us as well - we think we might have it nailed down to a specific jQuery version though - 1.1.something, possibly. I'm not seeing anything when I go to the same sites that they are, and I'm using Norton '09 as well - the only difference is I'm on Firefox, not IE. Appart from that: Norton is considered harmfull. I know - like I said, not my choice :) Regards, Michael Price
[jQuery] Re: Norton thinks jQuery is a virus?
Alright, this is getting weirder. One of the lads got a blocked attack on a site not using jQuery - so I went there - now I'VE got a blocked attack on the same website, in Firefox, and the suspect script is opensocial.js from gmodules.com which doesn't actually contain any jQuery as far as I can tell. Same PDF attack method as Norton claimed in my original post. Has Norton's latest update just completely screwed it up or something? Regards, Michael Price Michael Price wrote: Christof Donat wrote: Hi, Anyone got any ideas? This is now happening to one of our guys on any site he visits that is using jQuery. Even interface.js got blocked at one point.. Risk name: HTTP Acrobat PDF file suspicious download File: jquery.js Are you shure, your Server does not deliver .js Files as application/pdf? Na - it's happening on other sites not built by us as well - we think we might have it nailed down to a specific jQuery version though - 1.1.something, possibly. I'm not seeing anything when I go to the same sites that they are, and I'm using Norton '09 as well - the only difference is I'm on Firefox, not IE. Appart from that: Norton is considered harmfull. I know - like I said, not my choice :) Regards, Michael Price
[jQuery] Leandro's Lightbox and sIFR
'lo all, We're designing a website here at the mo which was previously in the hands of one of the other guys, who'd done a Lightbox on a gallery page using Prototype / Scriptaculous / Lightbox from huddletogether.com. The page in question also uses sIFR and when the Lightbox is opened, the sIFR Flash shows through over the top, which looks messy. I thought I'd rip the P/S Lightbox out and replace it with Leandro's from http://leandrovieira.com/projects/jquery/lightbox/ but unfortunately it suffers from the same problem. I thought it used the bgiframe plugin if available but perhaps not. Is this an easy fix or is there another one I can use? All help appreciated :) Regards, Michael Price
[jQuery] Re: Read AJAX response in transit?
Thank you both for your suggestions - I'll give them a try and see what I come up with. The script in question takes about 5 minutes so if I can get something going via your suggestions it'll keep people happy :) Regards, Michael Price
[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] XML filtering
Hi all, I have two XML files - one is a list of categories, laid out like this: categories category categoryID1/categoryID categoryNameThe Category/categoryName /category .. /categories And a subcategory XML file laid out like this: subcategories subcategory subcategoryID1/subcategoryID categoryID1/categoryID subcategoryNameThe Subcategory/subcategoryName /subcategory .. /subcategories The category XML populates a select box. When that select box is changed, a second select box for subcategory is populated using the subcategory XML finding any records with the categoryID chosen in the first box. What I'm struggling with is how to filter the subcategory list according to the value of the child categoryID tag BEFORE doing .each() on it. At the moment I'm going through every subcategory and manually comparing the categoryID child to the chosen categoryID - can I filter this using jQuery so I don't have to do that? This is my current code: http://pastebin.com/m236603b All help appreciated. :) Regards, Michael Price
[jQuery] Re: Cycle / carousel with partial images on either side?
Mike Alsup wrote: Wondering if there's an easy way to do this, either with the Cycle plugin by Mike Alsup or a similar plugin. We have a set of images scrolling left to right, but is it possible to show a little bit of the images on either side as well? ie. div| A | | ALL OF B | | C |/div So in the above example, the right edge of image A and left edge of image C can be seen either side of image B. Then the scroll happens: div| B | | ALL OF C | | D |/div C is now visible with B's right edge on and D's left edge on either side. Hope I've explained this adequately - all help would be greatly appreciated. :) Cycle won't handle that out of the box; you'd have to write a custom transition. This page shows you how you can define your own transitions: http://www.malsup.com/jquery/cycle/adv2.html Hi Mike, I'll give that a shot - thanks! :) Regards, Michael Price
[jQuery] Naivgate with lightbox / thickbox etc.?
Hi all, Working on a site for a client at the moment and they would like to do the following: Given a list of search results, when a result is clicked a widget opens - currently in a new window. Our client would instead like this widget to open over the top of the current page, thickbox style. The widget consists of several separate pages navigable via a tab bar at the top of each. So not only would we need to open the widget in a thickbox, we'd need to be able to navigate within the thickbox as if it was a new browser window. Which of the many plugins out there would be best for achieving this? The site is only on jQ 1.2.3 so compatibility needs to aim here. Thanks :) Regards, Michael Price
[jQuery] Re: Validate plugin - validate only PART of a form
Jörn Zaefferer wrote: Take a look at this multipart form, it uses the accordion and custom methods to split validation across parts: http://jquery.bassistance.de/validate/demo/multipart/ I'll check that out - thanks :) Regards, Michael Price
[jQuery] Validate plugin - validate only PART of a form
Hi all, About to use Jorn's validation plugin on a project but I'm splitting the form into two parts. The user fills in the top half, clicks a button and - if it validates - the second half of the form is shown. My question then, is it possible to only partially validate a form using the validator plugin? Say in this instance I only want to validate the values in the top half Is this easy to do? Thanks for any help :) Regards, Michael Price
[jQuery] Get co-ordinates of click on image
Hi all, Working on something for a client at the moment - they have a map and they want to pinpoint where on this map something is, and then store this in the database. I'm thinking we put an image of the map in the admin area for them and they can click on it to set the co-ords, but I'm not sure how we'd fetch the co-ords of where they clicked? Just as X,Y pixels from the top left of the image, nowt too clever. $(#map).click(function() { // WHAT GOES IN HERE? } Does anyone have any thoughts? All help much appreciated :) Regards, Michael Price
[jQuery] Re: Get co-ordinates of click on image
tlob wrote: the docs are good for searching... so is google: http://docs.jquery.com/Tutorials:Mouse_Position cheers tlz On May 30, 1:02 pm, Michael Price [EMAIL PROTECTED] wrote: Hi all, Working on something for a client at the moment - they have a map and they want to pinpoint where on this map something is, and then store this in the database. I'm thinking we put an image of the map in the admin area for them and they can click on it to set the co-ords, but I'm not sure how we'd fetch the co-ords of where they clicked? Just as X,Y pixels from the top left of the image, nowt too clever. $(#map).click(function() { // WHAT GOES IN HERE? } Does anyone have any thoughts? All help much appreciated :) Regards, Michael Price -- Regards, Michael Price - [EMAIL PROTECTED] --- Edward Robertson Ltd. - 1 Bondgate, Darlington, DL3 7JA Direct: 01325 245077 - http://www.edwardrobertson.co.uk Office: 01325 489333 - http://www.internetwebsitedesign.co.uk --- Registered Address: 1 Bondgate, Darlington, County Durham, DL3 7JA, UK Registration Number: 3931089 - Company registered in England --- This electronic message transmission contains information from Edward Robertson Limited that may be proprietary, confidential and/or privileged. The information is intended only for the use of the individual(s) or entity named above. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic transmission in error, please notify the sender immediately by replying to the address listed in the From: field.
[jQuery] Re: Get co-ordinates of click on image
tlob wrote: the docs are good for searching... so is google: http://docs.jquery.com/Tutorials:Mouse_Position That did the trick, thanks :) Regards, Michael Price
[jQuery] Validator plugin problem with radio buttons
I have two radio buttons on a form - one to select payment by card, another to select an alternate method. I'm using Jorn's validation plugin to validate the credit card fields but ONLY IF the credit card radio is ticked: CCType: { required: $(#paycredit).is(:checked) } However, this isn't working quite right - the button is checked by default when the page loads. I uncheck it, and it STILL executes the validation. If, on the other hand, I load the page with the ALTERNATE button ticked, the validation proceeds as expected and doesn't validate the credit card fields. I'm a version or two behind on the plugin but I wondered what the correct fix for this was? I'm thinking I might have the syntax wrong. Regards, Michael Price
[jQuery] Re: BlockUI: Strange flickering behavior.
Chris Jordan wrote: Just to clarify, in order to see the problem (especially in FF -- it looks a little different in IE) mouse over one of the thumbnails in the center of the page, and then leave the mouse there. You don't have to do any further movement of the mouse to see the problem happening. Thanks everyone. I really, really need help on this. :o( Downloaded a copy of the page via Firefox and tried changing your bindings to use the hover function - seemed to work OK but I'm still getting the eggtimer over the images for some reason: $(.thumb).hover(function() { // MOUSEOVER HERE },function() { // MOUSEOUT HERE }); Regards, Michael Price
[jQuery] Re: UI Tabs - disable AJAX functionality?
Just spotted your reply - I've since incorporated the page in question into an extra tab on the same page anyway but will keep this in mind if I need it again in future - thanks! :) On 25 Apr, 12:27, Scott González [EMAIL PROTECTED] wrote: http://docs.jquery.com/UI/Tabs#...open_a_tab_in_a_new_window_instead.3F On Apr 24, 2:30 pm, Michael Price [EMAIL PROTECTED] wrote: Hi all, I've got a row of five tabs and I'm using Klaus' Tabs plugin to handle them. I want four of them to use the standard tab functionality. The fifth and final tab is actually a link to a different page, but if I try to click this link the page is loaded into the CURRENT page via the tab extension's AJAX functionality. Is there a way the AJAX loading can be disabled so that the browser can follow this link normally instead? Regards, Michael Price
[jQuery] UI Tabs - disable AJAX functionality?
Hi all, I've got a row of five tabs and I'm using Klaus' Tabs plugin to handle them. I want four of them to use the standard tab functionality. The fifth and final tab is actually a link to a different page, but if I try to click this link the page is loaded into the CURRENT page via the tab extension's AJAX functionality. Is there a way the AJAX loading can be disabled so that the browser can follow this link normally instead? Regards, Michael Price
[jQuery] Animate to bottom left corner?
Hi all, Got an image absolutely positioned inside a relatively positioned DIV. When I mouseover it, it stretches via jQ's built in animation functions to a wider, taller version. Awful ASCII art coming up: -- ON MOUSE OVER, EXPANDS OUTWARD || | XX | || -- | | | v ON MOUSE OVER, EXPAND DOWNWARD So it's going from the top left corner. Is it possible to make the animation run from the BOTTOM left corner? LIKE THIS? ^ | | | -- || | XX | || -- ON MOUSE OVER, EXPANDS OUTWARD All help gratefully received :) Regards, Michael Price
[jQuery] Re: Animate to bottom left corner?
Karl Swedberg wrote: I think this is just a matter of setting the image's CSS properties properly. Instead of using a top property, use bottom: img.someclass { position: absolute; bottom: 0; left: 0; } Karl, that's brilliant. Works perfectly! Regards, Michael Price
[jQuery] Re: div select and change it's css
yabado wrote: div id=section class=section1 Stuff /div div id=section class=section2 Stuff /div div id=section class=section3 Stuff /div div id=section class=section4 Stuff /div div id=section class=section5 Stuff /div If this isn't pseudo-code then you've got your IDs and classes the wrong way round here, I think... Anyway, the way I usually do it (and someone will be along shortly with a better method, I don't doubt, but it works for me) is have the CSS for the highlight in a new class. Then on click I REMOVE this class from all of them, then I ADD the class to the clicked DIV. Code for basic idea follows: $(.section).click(function() { $(.section).removeClass(.highlight); $(this).addClass(.highlight); } jQuery being what it is, there's bound to be a way of doing this in one line, though :) Regards, Michael Price
[jQuery] Re: put the value back in the input (Beginner)
tlob wrote: works like a charm! Excellent :) but I dont get it... -blur is the opposite of focus, right? Yep - focus is triggered when the user tabs or clicks into the input - blur is triggered when they tab or click out of it so it's no longer the active element. -why do you chain it after the focus? 'tis the jQuery way! What we're basically doing is saying with the input in #schnellsuche, add a focus handler, then add a blur handler. -with [0].defaultValue you restore the first value that was stored in an array? Not quite. If you imagine $(this) as an array of DOM objects within jQuery, then $(this)[0] is a way to access the first (or in this case, only) DOM object. jQuery doesn't have a built in way to retrieve the default value of an input, so we have to nip back into the DOM momentarily in order to retrieve it. -does JS store every changed value of every element in an array? The DOM contains a defaultValue attribute for every text input, textarea and select box. Not sure about checkboxes and radio buttons. I invite other people to clear up any parts of my reply which aren't totally accurate (you can tell I have faith in my ability to explain things properly, I must say this in every post!) Regards, Michael Price
[jQuery] Re: [Validate] Two fields, one error message
Currently the best approach is a custom method that checks both fields, but is added only to one of them. If you have two fields side-by-side its good for message display to add the rule to the right one. As that question now came up a few times I've added (http://dev.jquery.com/changeset/4648) an example to the dynamic-totals-demo: http://dev.jquery.com/view/trunk/plugins/validate/demo/dynamic-totals.html Its not perfect yet, focusing the invalid field needs to know which field is acutally invalid. Let me know if that works for you Hi Jorn, I'll give that a try, thanks! Regards, Michael Price
[jQuery] [Validate] Two fields, one error message
Hi all, Hoping (and betting) that this is a simple fix but I have two fields - the month and year of a card expiry date. Both of them need to have a selection made, but I only want to show ONE error message if EITHER of them are left blank. At the moment, if both fields are left blank, two error messages appear underneath the boxes. Is there a way to tie both fields together so only one message is displayed? Regards, Michael Price
[jQuery] Repeating last AJAX action
Hi all, Another little query requiring assistance :) I've got an AJAX search form - you type in a search keyword, underneath the box you get a list of matches and prices. There are also other AJAX forms for searching by category, drilling down through a category tree, and searching by series of books - meaning the source of the search results can be one of a few different searches. The prices differ according to what sort of customer you've said you are in another dropdown (there's a trade discount scheme, basically). If a customer performs a search, they see one set of prices - if they then change their customer type I'd like to re-execute the last search, and redisplay the results with the new price. What are people's recommendations on the best way to go about doing this? As ever, all help gratefully received :) Regards, Michael Price
[jQuery] Re: Cycle CountUp
caruso_g wrote: Is it possible to set a time countdown but making it global, i.e. that any visitor will see the remaining time? Something like a countdown to a special offer, and so on. I guess you could synchronise your countdown's start variable with the server side clock - say an offer starts at 4pm and it's 3pm now, your server-side code feeds a variable to your JS saying there's an hour to go and you take it from there? Regards, Michael Price
[jQuery] Problem with siblings(?) in IE6
Hi all, Unfortunately I can't post all of the code because the page in question is still in development and when live will be IP restricted but I'm hoping the code I'm about to provide will be sufficient. Given the following table cell: td input class=SearchProdID type=hidden value=460 name=ProdID/ input class=SearchQty type=text value=1 size=2 name=qty/ input class=cartadd type=button value=+ name=searchcartadd/ /td The following JavaScript works in FF2 and IE7 but not in IE6: $(.cartadd).click(function() { // GET SIBLING PRODUCT IDS IDBox = $(this); ProdID = $(this).siblings(.SearchProdID).val(); Qty= $(this).siblings(.SearchQty).val(); alert(Here); // MORE CODE } In FF2 and IE7 Here is alerted and the entire function (which later posts these variables via AJAX) runs perfectly. In IE6 I don't get the alert. If I alert IDBox right after the line where it's set, I get [object Object] which I believe is correct, but as soon as it hits the next lines involving siblings, it just stops dead - no error, no warning, nothing. Can anyone shed any light on a cause or solution? Much appreciated if you can. :) Regards, Michael Price
[jQuery] Re: Problem with siblings(?) in IE6
Given the following table cell: td input class=SearchProdID type=hidden value=460 name=ProdID/ input class=SearchQty type=text value=1 size=2 name=qty/ input class=cartadd type=button value=+ name=searchcartadd/ /td The following JavaScript works in FF2 and IE7 but not in IE6: $(.cartadd).click(function() { // GET SIBLING PRODUCT IDS IDBox = $(this); ProdID = $(this).siblings(.SearchProdID).val(); Qty= $(this).siblings(.SearchQty).val(); alert(Here); // MORE CODE } In FF2 and IE7 Here is alerted and the entire function (which later posts these variables via AJAX) runs perfectly. In IE6 I don't get the alert. If I alert IDBox right after the line where it's set, I get [object Object] which I believe is correct, but as soon as it hits the next lines involving siblings, it just stops dead - no error, no warning, nothing. Following up to my own post but while I was waiting for my post to appear in the group I decided to try changing the variable name from ProdID to ProductID - and it worked! A near identical piece of code was having a similar problem so I changed the variable from SeriesName to SeriesID - and that fixed the problem there too! My theory here is that if you look at the above snippets, the hidden form elements in both cases had the names ProdID and SeriesName, so they were already defined as variables and IE6 had a problem with overwriting or reassigning them somehow? Regards, Michael Price
[jQuery] Duplicate values in form fields
Hi all, Need a little help turning theory into code! I have a series of text boxes in a form - there could be hundreds of them, all of which have the class bbi. Most of them are disabled, but can be enabled by clicking a tickbox (basically it's a list of advertisers and if the tick is ticked, the box opens up to put a reference code in). I need to write some code that, when the form is submitted, checks all the filled in .bbi boxes to ensure there are no duplicate values in them. But I keep getting into an infinite loop :( I don't have my work in progress code to show anyone as I dimwittedly removed it so I could get the form up. If anyone has an example of how they've done something similar (or if there's a plugin kicking about) I'd appreciate the help. Thanks! Regards, Michael Price
[jQuery] Re: Duplicate values in form fields
Hi Wizzud, I'll give that a try - thanks! :) Regards, Michael Price
[jQuery] Spam - not a complaint, more an observation
I've noticed a steady increase in the amount of spam coming through to the jQuery lists I'm subscribed to (jquery-en and jquery-ui) - this isn't a complaint as hitting Delete to get rid of it takes about half a second to do but I'd been under the impression first posts to the group were filtered to stop spam getting through? Regards, Michael Price
[jQuery] Re: Interface v1.2 Error with jQuery v1.2.1
Nicolae Namolovan wrote: So, have anybody found a eq of interface's SlideOutLeft,SlideOutRight,SlideInLeft,SlideOutRight what does work with jQuery 1.2.1 ? Hi, I suspect it's because Interface is relatively old (in jQuery terms anyway), no longer maintained and may not be entirely compatible with the jQuery 1.2.x API. You may need to find another plugin capable of performing similar effects (jQuery UI eventually, maybe?). While I don't know of any, I'm sure you'll get a few suggestions from people here. Regards, Michael Price
[jQuery] Star rating plugins
Hi all, Have a feeling a little later on I'm going to be doing a reviews system for a client of ours. Naturally I wish to use jQuery and if it's a five star system, use one of the star rating plugins. Which would people recommend, that work with jQuery 1.2.x? All suggestions appreciated! :) Regards, Michael Price
[jQuery] Replicating Prototype lightbox with jQuery
'ello all, I was using Thickbox on an image gallery to show enlarged pictures - so far, so good. Until the boss points at one of our other sites where the enlarge viewer drops open, slides sideways, then the close button drops down afterwards - and says he wants it to work like that. I thought it looked familiar so I viewed source. Sure enough, it was the Prototype lightbox: http://www.headlamhall.co.uk/gallery.htm I don't want to use Proto if I can get away with it (nothing WRONG with it, per se - I'm just a jQuery fanboy!) so is there a jQuery equivalent to this or any way I can mod Thickbox to make this happen? Regards, Michael Price
[jQuery] Re: Replicating Prototype lightbox with jQuery
Andy Matthews wrote: Someone JUST posted a link to their direct jQuery Lightbox conversion. Which is exactly the one I just found on Google as well :) I think instead of think before you speak I should invest time in Google before you type - although that would be tricky since you have to type in order to Google so never mind! Thanks for pointing that out Andy, and thanks Leandro for the excellent looking plugin! Regards, Michael Price
[jQuery] Re: Replicating Prototype lightbox with jQuery
Andy Matthews wrote: Hey Michael...I hope you didn't take offense at my comment. I wasn't try ing to be rude. I was just surprised that you asked that question right after someone posted the answer. I just thought it was a really fun coincidence. No offence taken - sorry if my tone implied I was at all upset by your reply - it was funny that I'd ask a question right after someone had posted the answer though. :) Regards, Michael Price
[jQuery] [SITE SUBMISSION] GAME.co.uk
Hi all, One of the UK's biggest retailers of video games has evidently jumped on board :) http://www.game.co.uk/ Using jCarousel on the homepage and some brokerage, not sure where or what else they're using yet as I thought I'd post this first and then go looking for that copy of Singstar I need to buy Regards, Michael Price
[jQuery] Re: Falling at the first hurdle
Jay wrote: Having major problems getting anything set up here. http://jquery.com/demo/thickbox/ On the above page it says I should download the files mentioned and put them in my scripts folder which I did. In my page (aspx) I have this script type=text/javascript src=scripts/jquery-1.2.pack.js runat=server/script script type=text/javascript src=scripts/thickbox.js runat=server/script I can't claim to be a .NET expert (even though I've been trying to learn it for three years!) but should those tags have runat=server in them? They're meant to be run by the client - this might be your problem. Try taking the runat attribute out and see if it helps. Regards, Michael Price
[jQuery] Re: Jorn's validation library, validate against default value
Jörn Zaefferer wrote: Your best bet, and most unobtrusive, is to avoid using default values for labels: http://www.alistapart.com/articles/makingcompactformsmoreaccessible/ Otherwise, you can still implement that as a custom method. See http://jquery.bassistance.de/api-browser/plugins.html#jQueryvalidatoraddMethodStringFunctionString Hi Jorn, Cheers for the tips, will give them a try! :) Regards, Michael Price
[jQuery] Jorn's validation library, validate against default value
Hi all, We've got two input boxes on a form for the user to type their name in to. The client has requested Forename and Surname appear in these boxes by default as a hint to ensure they know what goes in which box. I want to validate these fields using Jorn's validation to ensure that they are not just the default values. Either by doing exactly this (preferable as I could re-use it), or checking they don't say Forename or Surname would be fine. What would be the best way of going about this? Thanks! Regards, Michael Price
[jQuery] JCarousel not auto-starting
Hi all, I've got a list of about 13 images which I want to scroll horizontally using Jan's excellent jCarousel. I want it to auto-scroll three at a time, same as the example on his site: http://sorgalla.com/projects/jcarousel/examples/static_auto.html However, when I set up my list and use it's ID to jCarousel, like the one in the example: $(#myListID).jcarousel({ auto: 3, wrap: last }); It doesn't move automatically. If I allow the buttons to remain in place then I can use those to scroll left and right, but never automatically. This is on a site using jQuery 1.1.3.1 and I've tried it with the script included in the jC download. Any suggestions? The site in question is still under development so I can't show where it is, unfortunately. If I had more time I'd put a small testcase together but alas, I'm running a little short on that commodity at the mo. Thanks for any help offered! Regards, Michael Price
[jQuery] Re: Getting the nearest label
Giovanni Battista Lenoci wrote: Hi, i'm looking in API/1.1.2/DOM/Traversing section of the doc for what I'm tryng to do... I think siblings() could be my function, but don't know how to use it.. I've a form like this: label for=test/label input id=test label for=test/label input id=test2 After the submit I do some server-side controls, then if there are errors I reload the page and in a hidden field I put the ids of the wrong fields. Then in document ready I want to load those id and add a class to nearest(prev) label to change the color. For example if the hidden field contains test I want to change the color of the first label. If I'm understanding you right, once you have the ID you need, you could find the associated label via: $([EMAIL PROTECTED]).whatever().wherever(); Replacing test in the above with whatever the ID is. Regards, Michael Price
[jQuery] Re: What does Unobtrusive Javascript mean?
What does Unobtrusive Javascript mean? I won't be the only one who answers this, I'm sure, but I'll try and explain it as best I can. As you'll probably be aware, a lot of users, due to personal preference, or firewall or proxy restrictions, browse the web without JavaScript, meaning they miss out on all of the cool effects and tricks it's capable of. This would include jQuery - no JavaScript, no jQ. Unobtrusive JavaScript is a term used to describe the application of JS to ENHANCE a page, rather than as a requirement of that page. The ultimate aim of any well crafted website is that it should be usable regardless of the technologies on a user's machine. A HTML version of a Flash only website might not look as good, but if the user doesn't or can't have Flash installed it's what they get. Likewise, if you develop a page which will work perfectly well without JavaScript, then you can add the snazzy effects in afterwards. A website should never REQUIRE JavaScript to work. Adding effects in without impairing basic functionality is what unobtrusive JavaScript is. As an example - you may decide to program a form to require a user to tick a checkbox in order to activate a submit button e.g. I accept the terms and conditions. If you have the submit button disabled by default and use JavaScript to enable it on the clicking of the checkbox, then you're in trouble - people with JavaScript can't submit your form. On the other hand, if you leave the button enabled by default, THEN apply JavaScript to turn it off and re-enable it, then you're safe. Your server side script can then check the terms box was ticked. This is unobtrusive - the form works without JavaScript. A small example but I hope it helps to clarify things. Hope that made sense. I rarely do. :) Regards, Michael Price
[jQuery] Re: [Slight OT] Quick straw pole about maps
Hi Tane, Excellent plugin, first of all - I plan to start using it on client sites which have jQ + Google Maps in the near future. However, that's all it will be - Google Maps. I get the general impression that Google's Maps API is far more popular than Yahoo, and not just on this list - I've never actually seen any sites using Yahoo's API - if I see a map, it's Google. If I MAKE a map, it's Google. So, to sum up, another vote for Google here. :) Regards, Michael Price
[jQuery] Re: Add class to specific list items
Glen Lipka wrote: Even though Ive been using jQuery for a while, I still go to this page all the time. http://docs.jquery.com/Selectors I can't remember all of it by heart. :) Near the bottom is has one like the one you wanted, $(p:gt(2)) So we just change it a little to $(li:gt(7)) and you got it. Perfect, thanks. I KNEW I wouldn't have to wait too long for an answer :) Mike
[jQuery] Re: A jQuery success story
Well, the old ways ARE dead to me now - I can't think of a situation where I'll ever need to write regular old JavaScript again :) But I DID look up eulogise before I posted just to make sure it would be an appropriate word and I think, from the definitions I found, I got away with it either way :) Put me down for complete revolution on that poll, I must've missed it! Glen Lipka wrote: That's awesome. One minor note: Convinced by my arguments and eulogising, I think you meant evangelizing. Unless you were declaring that old javascript programming is dead. In which case, eulogizing is perfect. :) jQuery has changed alot of our lives. In the recent survey, it was asked: How much has jQuery changed your development style? 100 responses: It hasnt: none Maybe a little: 11 Major Overhail 21 Complete revolution: 43 Keep up the great work! Glen On 7/20/07, *Christopher Jordan* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: This is awesome, Michael! Great work! And keep spreading the jQuery goodness around. :o) Chris On 7/20/07, * Sean Catchpole* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: A Great Story Michael, thank you. ~Sean -- http://cjordan.us No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.10/908 - Release Date: 19/07/2007 18:10
[jQuery] jQuery in latest Sitepoint Design View
Got the Sitepoint Tech Times newsletter last night and in it there's a rather cool tutorial on using jQuery to create a page turning widget: http://www.sitepoint.com/newsletter/viewissue.php?id=5issue=35format=html Ironically (I guess), it's being used to promote their book Simply Javascript which I don't think actually involves jQuery at all, but hey. Cool tutorial. :) Regards, Michael Price
[jQuery] Interface Autocomplete autofill
Hi all, I've got a text box which is hooked in to an Interface autocomplete. As you type it searches for client names in our database and returns the client name and client ID in the XML. The client ID is passed to a hidden form field when an option is selected from the displayed list but this does NOT appear to be happening if the autofill fills in the box. So to sum up, I need the autocomplete to populate the client ID when it autofills the search box with the most appropriate option. Is this possible? Regards, Michael Price
[jQuery] Re: Draggable Thickbox?
ricardoe wrote: Why dont you try a Window widget? Like the Interface Window http://interface.eyecon.ro/demos/windows.html 'tis good, I like it, thanks. :) However, not long after posting (as it always the way) I found jqModal, so at the moment I'm trying that out - client seems pleased although evidently if the window has a scroll bar then clicking on the scroll bar drags the window around the screen too! Will have to try and fix that methinks. Regards, Michael Price
[jQuery] Show / hide options based on class
Hi all, I've got two select boxes side by side - initially the right hand side box has ALL options in it - and the left hand box can be used to filter the options displayed. Probably not the best way to do it (in fact, defintiely - it doesn't work in IE) but the left hand list has options whose values correspond to class names of the options in the right hand list. When an option in the left hand list is selected, all options in the right hand one which DON'T have this class are hidden, and all which DO are displayed. Using $(option . + className).show() and .hide() works in Firefox but not in IE. Is there a better approach to this? -- Regards, Michael Price - [EMAIL PROTECTED] --- Edward Robertson Ltd. - 1 Bondgate, Darlington, DL3 7JA Direct: 01325 245077 - http://www.edwardrobertson.co.uk Office: 01325 489333 - http://www.internetwebsitedesign.co.uk --- Registered Address: 1 Bondgate, Darlington, County Durham, DL3 7JA, UK Registration Number: 3931089 - Company registered in England --- This electronic message transmission contains information from Edward Robertson Limited that may be proprietary, confidential and/or privileged. The information is intended only for the use of the individual(s) or entity named above. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic transmission in error, please notify the sender immediately by replying to the address listed in the From: field.
[jQuery] Re: Show / hide options based on class
Marc Jansen wrote: var $possibleOptsRight; $( document ).ready(function() { $possibleOptsRight = $('#rightselectlist option'); $( '#leftselectlist' ).bind('change', function() { $('#rightselectlist') .children().remove().end() .append( $possibleOptsRight ).children() .not('.' + $(this).val() ).hide(); }); }); I'll give this a try, thanks. :) Regards, Michael Price
[jQuery] Draggable Thickbox?
Hi all, I'm using a thickbox to display some content on a client's website. They've now asked if it would be possible to drag the box around the screen (presumably in case it's obscuring something) - is there an easy way to make the Thickbox draggable or, alternatively, a different plugin which offers similar functionality AND the ability to drag? Regards, Michael Price
[jQuery] Re: How to change of an input textbox
Try: $(#ID).val(New value); And: variablename = $(#ID).val(); To retrieve it. Regards, Michael Price
[jQuery] Re: 3D carousel?
Fred Janon wrote: Has anyone done or know how to do a carousel like the 3D circular carousel in Flash in Amazon? It looks pretty cool. Forgive me if the link doesn't work for you but the carousel shows the best-seller books in a 3D circular carousel. http://www.amazon.com/ref=topnav_gw_/105-7722567-3277224 http://amazon.com/ref=topnav_gw_/105-7722567-3277224 Hi Fred, There's one in the Interface effects library as well: http://interface.eyecon.ro/demos You can see it demonstrated from the above link, near the bottom of the Technical Demos list. Regards, Michael Price
[jQuery] Interface drag/drop: Limiting number of items
Here's a tricky one (although it probably won't turn out that way in the end!) I've got two unordered lists and I'm using Interface to allow items to be dragged between the two. However, if possible I'd like to limit the top list to only contain a maximum of 3 items, with any further items in the bottom list. If an item is dragged into the top list, any item outside the top 3 moves down into the bottom list. I've honestly got no idea where to start with this - can anyone provide some tips? Regards, Michael Price
[jQuery] Re: Could anyone send me a copy of Catfish Advert Plugin 1.3.
Logan Cai wrote: could you send me a copy of Catfish-Advert-Plugin-1.3, if you have. Logan, I don't think the problem is the plugin. The one I sent may well have been 1.3, but I think Catfish was written for jQuery 1.0.x and obviously we're on 1.1.x now and there may be incompatibilities between the two which prevent Catfish from working on newer versions of jQuery. This isn't something anyone can fix unless someone takes over development of the plugin or Matt, the original author, gets his website back online and updates it himself. Regards, Michael Price
[jQuery] Re: Could anyone send me a copy of Catfish Advert Plugin 1.3.
Su wrote: When you go 24hours without reposting this question, I'll go digging through the archive I'm pretty sure has a copy of it. I sent him a version I had - not sure it was 1.3 though. The last mention of it on Google was only 1.2 anyway. Regards, Michael Price
[jQuery] Re: Interface Sortables
Hi Robert, Sorry for the delayed reply but your post gave me a good starting point - this is how I did it in the end: $(document).ready(function() { $(#pagelist).Sortable({ accept: dragtag, axis: vertically, onchange: function() { theIds = ; $(#pagelist li).each(function() { theIds += $(this).attr(id).replace(page,) + ,; }); alert(theIds); } }); }); Thanks! On 7 Jun, 16:54, Robert O'Rourke [EMAIL PROTECTED] wrote: Michael Price wrote: Hi, Say I've got this list: ul id=sortable li id=element1stuff/li li id=element2stuff/li li id=element3stuff/li /ul UsingInterfacesortables I want to get a comma separated list of list item IDs after I've done some dragging. Say I've been doing some dragging and it's now: ul id=sortable li id=element3stuff/li li id=element1stuff/li li id=element2stuff/li /ul I can use SortSerialize but this gives me the POST-ready version. I just need element3,element1,element2. What is the best way to achieve this? Regards, Michael Price var listIds = $(#sortableli).attr(id); listIds.join(,); Is how I'd do it. Whether it'll work or not I don't know...
[jQuery] Re: Form with multipart/form-data not working
Looking at the sample form code provided, it doesn't look like it needs multipart/form-data anyway - isn't that only required when a file is being uploaded as part of the form submission? Regards, Michael Price Mike Alsup wrote: jQuery does not perform multipart/form-data encoding. It uses JavaScript's encodeURIComponent function to encode data so the correct enctype is application/x-www-form-urlencoded. Mike On 6/11/07, Neil Merton [EMAIL PROTECTED] wrote: Hi all, I'm trying to use the following example with a form that contains multipart/form-data in it but the ajax part won't work - http://www.shawngo.com/gafyd/index.html If I remove the enctype=multipart/form-data from the form tag it works. Here's the code... script type=text/javascript src=/code/jquery.js/script script type=text/javascript $(document).ready(function() { $('#loading').hide(); $('#product_code').blur(function() { $('#loading').show(); $.post(checkproductcode.cfm, { product_code: $('#product_code').val() }, function(response) { $('#result').fadeOut(); setTimeout(finishAjax('result', '+escape(response)+'), 400); }); return false; }); }); function finishAjax(id, response) { $('#loading').hide(); $('#'+id).html(unescape(response)); $('#'+id).fadeIn(); } /script form action=/checkproductcode.cfm method=post enctype=multipart/ form-data input type=text name=product_code id=product_code class=button size=50 / span id=loadingimg src=ajax-loader.gif alt=Loading... // span span id=result/span br / input type=submit value=Send / /form Any ideas? Thanks in advance for any replies -- Regards, Michael Price - [EMAIL PROTECTED] --- Edward Robertson Ltd. - 1 Bondgate, Darlington, DL3 7JA Direct: 01325 245077 - http://www.edwardrobertson.co.uk Office: 01325 489333 - http://www.internetwebsitedesign.co.uk --- Registered Address: 1 Bondgate, Darlington, County Durham, DL3 7JA, UK Registration Number: 3931089 - Company registered in England --- This electronic message transmission contains information from Edward Robertson Limited that may be proprietary, confidential and/or privileged. The information is intended only for the use of the individual(s) or entity named above. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic transmission in error, please notify the sender immediately by replying to the address listed in the From: field.
[jQuery] Interface Sortables
Hi, Say I've got this list: ul id=sortable li id=element1stuff/li li id=element2stuff/li li id=element3stuff/li /ul Using Interface sortables I want to get a comma separated list of list item IDs after I've done some dragging. Say I've been doing some dragging and it's now: ul id=sortable li id=element3stuff/li li id=element1stuff/li li id=element2stuff/li /ul I can use SortSerialize but this gives me the POST-ready version. I just need element3,element1,element2. What is the best way to achieve this? Regards, Michael Price
[jQuery] Re: security advice
Hi Michael, On my website I have a lot of pages called via AJAX, some of which are quite sensitive (private messages, user submission data etc.). At the top of every page I have a PHP include which, as well as opening the database connection etc., also includes code to check and authenticate a user if login data e.g. a cookie or session is detected. I also include this include at the top of all my AJAX pages and ensure any database queries are tightly written to ensure they only pull out the relevant data. e.g. logged in user is ID number is 1234, trying to read private message number 5678, my SQL is: SELECT * FROM private_messages WHERE to_user_id = 1234 and message_id = 5678. If the user is then trying to hack the message ID it won't work. Additionally, if a user isn't logged in then the include and / or script knows this and can stop the call and print an error message. I guess what I'm trying to say is apply the same level of security to your AJAX scripts as you do to the rest of your PHP. Regards, Michael Price
[jQuery] Re: Problem getting first paragraph
Try this. Given the following HTML: div id=book div class=page pParagraph one, page one/p pParagraph two, page one/p pParagraph three, page one/p /div div class=page pParagraph one, page two/p pParagraph two, page two/p pParagraph three, page two/p /div div class=page pParagraph one, page three/p pParagraph two, page three/p pParagraph three, page three/p /div div class=page pParagraph one, page four/p pParagraph two, page four/p pParagraph three, page four/p /div div class=page pParagraph one, page five/p pParagraph two, page five/p pParagraph three, page five/p /div /div The following jQuery code should do the trick: $(#book .page).each(function() { $(p:first,this).css(backgroundColor,yellow); }); The result of five minutes messing about, it seems to do what you're after but I'm sure it can be improved upon. Regards, Michael Price
[jQuery] Interface TransferTo
Hi all, I was trying to use the Interface TransferTo function last night and although I wasn't getting any errors, the function also wasn't working - nothing was happening, it was as if the function was being completely ignored. I had a custom-built interface.js containing all the effects from the middle column on the build your download page, plus autocomplete from the right hand column (for use elsewhere on my site) - when I used the full 78k interface.js file from the download on the website, it worked fine. Which other pieces of interface do I need to select on the page in order to make transfer animations work, instead of using the full file? Any help much appreciated! Regards, Michael Price
[jQuery] Re: Interface TransferTo
[EMAIL PROTECTED] wrote: Check the dependencies part of the site - most things will require iutils.js though :) According to that, ifxtransfer.js requires iutils.js and ifx.js - I'd assume iutils is included in the download by default (there's no option for it on the page to build a download) and I selected everything in the effects column which would give me ifx.js as well I think? In my opinion the whole Interface site needs an overhaul - with better documentation for the various parts - what's there at the moment doesn't really help. It - along with the examples - has gotten me to the point I'm at now so I'm managing OK and I'd hardly call myself an expert in this field. Really cool library too, I think I'm going to have a use for that 3D carousel in future.. Regards, Michael Price
[jQuery] Re: using jquery to see if an ID occurs twice
No, that won't work. And ID-selector returns always zero or one elements. But you can use this: $([EMAIL PROTECTED]).size() 1 Fair enough, I learn something new every day :) I just assumed (bad idea) it would work, I was coding off the top of my head, so to speak. Regards, Michael Price
[jQuery] Re: using jquery to see if an ID occurs twice
[EMAIL PROTECTED] wrote: Hi, How can I use JQuery to discover if a particular ID occurs twice in my page? I can't use View Source' because the DOM is changing as the user interacts with the page. Try: if ($(#your_id_here).length 1) { // CODE TO EXECUTE } This should fire the code if the ID occurs more than once. Regards, Michael Price
[jQuery] Re: test if element as a class
Alexandre Plennevaux wrote: hello, i'm trying to test a condition whether a link has a given class, and have it return true or false. if ($(this).attr(class)=='refresh') { alert(changing page); return true; } else { return false; } Try, from memory: if ($(this).is(.CLASSNAME)) { // IF TRUE } else { // IF FALSE } Regards, Michael Price
[jQuery] Re: Preview of my new website
On Apr 23, 8:59 am, Michael Price [EMAIL PROTECTED] wrote: Here's a video preview of the new version of Cyberscore which I'm hoping to launch in the summer: http://www.cyberscore.net/cs4/cs4.wmv It's a 21mb WMV file about 12 minutes in length with professional (arf!) narration by yours truly. jQuery is going to be used quite heavily throughout and that's why I'm linking this here, so people can see what I'm doing with it already - and I'm not finished yet! Listen out for the namecheck partway through as well :) Hope you like it - the feedback on my own forums has been very positive! Hi again all, Did anyone else have any thoughts on this? I realise video isn't the best way to deliver the preview but given the site is a few months from going live I thought it was - for now - the best way to highlight the features jQuery has allowed me to add to the site. Regards, Michael Price
[jQuery] Preview of my new website
Hi all, Here's a video preview of the new version of Cyberscore which I'm hoping to launch in the summer: http://www.cyberscore.net/cs4/cs4.wmv It's a 21mb WMV file about 12 minutes in length with professional (arf!) narration by yours truly. jQuery is going to be used quite heavily throughout and that's why I'm linking this here, so people can see what I'm doing with it already - and I'm not finished yet! Listen out for the namecheck partway through as well :) Hope you like it - the feedback on my own forums has been very positive! Regards, Michael Price
[jQuery] Re: Preview of my new website
Dan G. Switzer, II wrote: Here's a video preview of the new version of Cyberscore which I'm hoping to launch in the summer: http://www.cyberscore.net/cs4/cs4.wmv Looks like you've put a lot of time and hard work into the project! Here's to a little premature congratulations! Thanks :) I unveiled it on what was the site's 5th birthday and I'm hoping to have it launched in the summer - will look forward to taking my place on the jQuery sites list among some truly great sites. Regards, Michael Price
[jQuery] Input inside table cell
Hi all, Thanks for your help with my previous problem (input blanking on click, defaulting on blur if blank), worked a treat. Now for a new one! Consider the following source: table id=vetotable tr td class=lalignName/td tdinput type=checkbox name=x value=y //td /tr /table And the following JS: $(#vetotable td).not(.lalign).hover(function() { $(this).addClass(hovertd); },function() { $(this).removeClass(hovertd); }).click(function() { $(input,this).attr(checked,!$(input,this).attr(checked)); }); The purpose of the above is to highlight the cell when the mouse passes into it, remove the highlight as the mouse leaves, and if the CELL is clicked, toggle the checkbox inside it. This works fine, HOWEVER if I click the checkbox directly, it first checks, then unchecks itself giving no visible change to the end user. I'm assuming this is because a click on the checkbox causes the check, but then a click inside the table cell is detected, forcing the same action and thus unchecking again. How do I prevent this from happening so I can click the cell OR the checkbox and achieve the desired result? Thanks :) Regards, Michael Price