[jQuery] Re: SUPERFISH IE 6 help
Hello, Looks like you just need to do general IE CSS debugging. It's easy to trigger IE bugs when creating these menus, that's why I strongly advise beginning with the Superfish CSS file and build from that whilst checking IE at every step along the way. That way, when IE borks you know exactly which rule is responsible. If you can create and send me a set of test files that I can run locally I'll see if I can find your bugs for you. You'll need to change the image urls to point to your server, or include the images with the files etc. Joel Birch.
[jQuery] Re: MouseOver/MouseOut Hover
Hi Mike, Does it work if you remove the inline JavaScript from the div and instead attach the handlers like this: $(document).ready(function() { $('div.zoom').hover( function() { setHoverState(this.id); }, function() { setHoverState(this.id); } ); }); The .hover() function takes two arguments - the mouseover function and the mouseout function, and it takes care of the types of problem you seem to be describing, which is probably that mouseover is getting confused when you hover over child elements, like the img for instance. Joel Birch.
[jQuery] Re: Superfish - button width
The latest version of Superfish (version 1.4.2 - released a couple days ago) does this by default now. Joel Birch.
[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] horizontal and vertical accordion for jQuery?
I am using a prototype accordion from this site that has horizontal nested in vertical accordion. http://stickmanlabs.com/accordion/ Because it has some issue with IE, and that I'd been using jquery tab for the same site, therefor very much prefer to switch jQuery version, however I am unable to find a jQuery Accordion that shows both horizontal and vertical. I found Kwicks for jQuery which is very nice but has horizontal, but not vertical.
[jQuery] Re: Why (function($){ ...})(jQuery) instead of (function(){var $ = jQuery; ...})()?
Hi Mike, You are right, I meant to say enclosures of either kind... ;-) We are on the same page with this. You don't *have* to do with unless noConflict() is on, but it's safer to do it anyway, specially when you share your code (ie.: plugin developers). But like yourself, I do it all the time to avoid accidentally messing around with global vars. It's good practice... Anyway, I'm glad to meet the guy who started it all :-) I've actually ellaborated on the idea and come up with my own version: ;if(jQuery) (function($){ ... })(jQuery); ...which: - encloses local vars - silently ignores the code if jQuery is unavailable - avoid colisions when files are merged (; at the start) Cheers, Diego A. 2008/7/4 Michael Geary [EMAIL PROTECTED]: Sorry, Diego, but you may have made things *more* confusing! :-) If you change enclosures of *that* kind to enclosures of *either* kind it will probably be more clear. As you said, there isn't any real reason for plugin developers to prefer one of these two forms over the other. It's just a matter of historical accident. I posted a message in this group a couple of years ago that mentioned the (function($){...})(jQuery); approach, and everybody liked it and started using it in their plugins. It could have just as easily been the (function(){var $=jQuery;...})(); version. Regarding the comment that there may not be any need to do this other than the noConflict thing - actually I do it all the time just to get a local scope for some variables. I don't want to put variables into the global namespace when I can avoid it. -Mike -- *From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Diego A. *Sent:* Thursday, July 03, 2008 6:44 PM *To:* jquery-en@googlegroups.com *Subject:* [jQuery] Re: Why (function($){ ...})(jQuery) instead of (function(){var $ = jQuery; ...})()? Hi there, No, there's no difference. They both have the exact same effect. But there's a reason why plugin developers use enclosures of that kind. They do it to make sure they can use $ instead of jQuery even when the user is using jQuery.noConflict(). Perhaps you want to isolate your own variables within an anonymous function, but unless you're using jQuery.noConflict(), you don't actually need to do this at all. I hope that clears up any confusion... Diego 2008/7/3 jfine [EMAIL PROTECTED]: On 3 Jul, 21:35, Michael Geary [EMAIL PROTECTED] wrote: Yes, either one will do exactly the same thing. It's purely a matter of taste. Thank you both for this. I think Michael right, but perhaps Diego would like to response - he thinks there is a difference. Thank you also Michael for the semicolon warning. I'm now using js2- mode.el with Emacs. It warns me about such errors. -- Jonathan -- Cheers, Diego A. -- Cheers, Diego A.
[jQuery] Re: DELETE HTTP method
I think you said you were using Django? I suggest looking at what technique it uses to do REST/DELETE and such. Rails uses the trick where it does DELETE and such as a POST with a _method=delete argument. I would imagine Django has a solutio of their own/similar. On Thu, Jul 3, 2008 at 8:20 PM, Yosifov Pavel [EMAIL PROTECTED] wrote: Hmm, after googling I saw that problems not in XMLHttpRequest - it can do DELETE in all browsers. Richard, you mean HTML forms only? But I mean DELETE via ajax in jQuery without any forms... -- Chris Bailey [EMAIL PROTECTED]
[jQuery] Database Request
Hi .. I found your jquery script and it's great cause it's the first that i found with multiplie field. But you don't take list from a database ( sql ) , only from file. Is it possible to have a field that take the list from a sql database ?? Thanks
[jQuery] Re: $.getScript in Firefox 3
Any one got any ideas?? On Jun 25, 10:12 am, robert_shipley [EMAIL PROTECTED] wrote: I've been developing a website and we usegetScriptto load all of our javascript files (other than jQuery) so the header of the page is shorter. We have a mechanism in place which allows functions to be executed when the script has downloaded. (Registering a function as a dependency of a file and when that file has been downloaded the callback from thegetScripttriggers the dependent code) This all works fine in IE and Firefox 2.5. I recently installed the new version of Firefox (3) and am experiencing an unexpected behavior. It appears that the callback function from agetScriptcall is executing before the downloaded script has been run. For example: I use get script to download a script containing function 1. I have a piece of code in another script depending on function 1, so it gets registered in our listener functionality. The callback from thegetScriptcall for downloading function 1 triggers the running of the dependent code. This all works in IE and Firefox 2.5 but in Firefox 3 the dependent code is erroring because it can not find function 1. If I place a delay into the dependent code (1 sec), function 1 seems to be available and no errors occur. There appears to be an early triggering of the callback in Firefox 3. I believe this is a slight browser incompatibility in the new version of Firefox (3). Has any one experienced this? Is this a known issue? Can a fix be created as it's stopping everything from working for us. Thanks in advance to any one who can offer any help on this!!!
[jQuery] strange problem
Hi, all why $('#browsing_btns').children() just select nothing? - $('#browsing_btns').children().each(function(xindex){ console.log(xindex + ':'+$(this).attr('id')); }) ... td id=browsing_btns colspan=4 input id=first_pg_btn my_action=f class=button type=button value=first page/ input id=next_pg_btn my_action=n class=button type=button value=next page/ input id=prev_pg_btn my_action=p class=button type=button value=prev page/ input id=last_pg_btn my_action=t class=button type=button value=last page/ /td ... If I move all the bottons inside a span, then it works. Jack
[jQuery] Re: How to catch function call
Michael, thanks for your time, It's loaded form the same domain. On Jul 3, 3:41 pm, Michael Geary [EMAIL PROTECTED] wrote: Is the iframe loaded from the same domain as the containing page, or a different domain? From: Luiz Abrahao I have one page with one iframe, and there are few javascript function on the page inside the iframe. These functions are triggered by some flash presentations. Basically the parent page has to 'know' when the user has requested the next page (inside the iframe) and update its content with relevant data related with this new page inside the iframe. I can't change the javascript functions from the pages inside the iframe. Thanks Luiz.
[jQuery] jCarousel + Reflection.js - Need some help!
Hi, I am using the jCarousel (http://sorgalla.com/jcarousel/) to display thumbnail images. What I wanted to implement with jCarousel is a reflection under each thumbnail using Reflection.js (http:// cow.neondragon.net/stuff/reflection/). These reflections would need to be dynamic as well and move with the original image as the user uses the controls to scroll the thumbnails. I tried implementing the class=reflect in the : function mycarousel_getItemHTML(item) { return 'img src=' + item.url + ' class=reflect width=75 height=75 alt=' + item.url + '/'; }; but this does not show up the reflections under the images, nothign shows up. When you disable the stylesheets of the page, the reflections are generated, but are aligned along side the original image - since the images are set out as unordered list items. I have also tried loading the reflections with javascipt with no success. I was wondering whether somebody could come up with a solution that works as I am literally at an end with this. Please help!
[jQuery] Clear queued effects
I've mean messing with hover effects and one of the problems I can't resolve is the queueing of events/effects. What I'd like to do is to remove all effects from the queue once a new effect event has been triggered. Is this possible with a combination of the animate and stop functions? What I'd really like is just be able to remove all queued events for a selected object. You can see the problem I have at http://67.199.18.208/
[jQuery] Drap 'n' Drop with easing....
I want to use the drag'n'drop feature to create a virtual light-table of sorts, similar to the effect on http://www.thibaud.be/ where the object continues to move about after you have 'let go' of it. Could i combine an easing script with a d'n'd script to achieve this? Or is there anything out there already that will do this? Cheers Ryan
[jQuery] Re: UL drag drop
Take a look at jQuery UI. It has a sortable component that makes it as simple as: $(ul).sortable() Here's a demo: http://ui.jquery.com/functional_demos/#ui.sortable If you have any questions on it, there's a dedicated jQuery UI mailing list: http://groups.google.com/group/jquery-ui/ - Richard Richard D. Worth http://rdworth.org/ On Fri, Jul 4, 2008 at 5:01 AM, DannyT [EMAIL PROTECTED] wrote: Can someone point me to an example of drag-n-drop within an unordered list? I need to replace a scriptaculous library and am giving jQuery a go because of it's massive praise of late. I've found plugins and examples of pretty much everything I'd need except for a simple drag and drop in a UL. Cheers, Dan -- http://danny-t.co.uk
[jQuery] Re: Drap 'n' Drop with easing....
On Fri, Jul 4, 2008 at 11:28 AM, tigercore [EMAIL PROTECTED] wrote: I want to use the drag'n'drop feature to create a virtual light-table of sorts, similar to the effect on http://www.thibaud.be/ where the object continues to move about after you have 'let go' of it. Could i combine an easing script with a d'n'd script to achieve this? Or is there anything out there already that will do this? Cheers Ryan no, of course it's possible, but i would use flash for such effects _ very CPU/GPU intensive. -- Alexandre Plennevaux LAb[au] http://www.lab-au.com
[jQuery] jCarousel + Reflection.js - Need some help!
I am trying to implement jCarousel (http://sorgalla.com/jcarousel/) to display thumbnail images which the user can select to navigate media. However, I want to intergrate Reflection.js (http://cow.neondragon.net/ stuff/reflection/) as well to create dynamic reflections below my thumbnail images. But I am running to a few problems which I need some help solving. I tried adding the class=reflect to the generated images in the following function: function mycarousel_getItemHTML(item) { return 'img src=' + item.url + ' class=reflect width=75 height=75 alt=' + item.url + '/'; }; This should create the reflection for each thumbnail image. But what i am finding is that the reflections are not showing up on the page, unless you disable the stylesheets, to which they are generated but incorrectly aligned to the left of the image, instead of below. I have also tried loading the reflections using javascript with no success either. Can somebody try and help me get a working implementation of jCarousel + Reflection.js - I am almost at an end with trying to figure this problem out. Thank you in advanced!
[jQuery] Re: Cluetip: Why isn't my top left graphic displaying in my tip?
Because .cluetip-rounded #cluetip-title has a background color of #FF. When it's 'transparent', the underlying element's background image can be seen through it. As it is, it can be seen. On Jul 3, 10:41 pm, datatv [EMAIL PROTECTED] wrote: I finally have everything pretty much figured out for my initial ClueTip experience. Except for this one. Check the tips out here: http://www.datatv.com/sw/SW_wp_sampler2.html Now, I've only tested these in Firefox and Safari but the tl.gif isn't displaying even though I click on the View Background Image and I see my image. Here it is: http://www.datatv.com/sw/images/tl.gif So why don't I see it in my tip or is it just my computer driving me nuts?
[jQuery] Superfish 1.4.3 released - now with new documentation
Hi everyone, I just released Superfish 1.4.3. The documentation is completely overhauled and now uses Mike Alsup's fantastic templates. Please let me know if I've left anything incomplete - it's quite a big nail-biting change. The CSS has undergone further revision. Rather than each menu type (horizontal, vertical, navbar) having it's own CSS file, now you include superfish.css to create the standard menu-type, then add the extra CSS file relevant to the alternate style, as well as adding an extra class to the parent ul to suit. Hopefully the docs explain this well enough. http://users.tpg.com.au/j_birch/plugins/superfish/ Cheers Joel Birch.
[jQuery] IE7 problem with cycling images - help much appreciated
Hi everyone, Hopefully this hasnt been answered before - wasnt able to find it in my search. Im building a portfolio site, using wordpress and jcarousel. An example of one of the pages Im having problems with is: http://fahrentest.timekept.com/the-powder-room/ It works fine in all browsers except IE7 (and probably 6). In IE, the images shuffle fine up to a point - if you click an arrow at the start or end of the cycle (ie the previous arrow with the first image or the next arrow with the last image) it breaks the rotator. Theres 2 errors at the bottom of the page - Im guessing that has something to do with it, however it should be a quirks mode issue or anything. Anyway, heres my code: script type=text/javascript var mycarousel_itemList = [ ?php $full1 = get_post_meta($post-ID, full1, true); if ($full1 != ) { echo {url: ' . $full1 . ', title: ' . Thumnail1 . ' },; } ? ?php $full2 = get_post_meta($post-ID, full2, true); if ($full2 != ) {echo {url: ' . $full2 . ', title: ' . Thumnail2 . ' },; } ? ?php $full3 = get_post_meta($post-ID, full3, true); if ($full3 != ) {echo {url: ' . $full2 . ', title: ' . Thumnail3 . ' },; } ? ?php $full4 = get_post_meta($post-ID, full3, true); if ($full3 != ) {echo {url: ' . $full2 . ', title: ' . Thumnail3 . ' },; } ? ]; function mycarousel_itemLoadCallback(carousel, state) { for (var i = carousel.first; i = carousel.last; i++) { if (carousel.has(i)) { continue; } if (i mycarousel_itemList.length) { break; } carousel.add(i, mycarousel_getItemHTML(mycarousel_itemList[i-1])); } }; /** * Item html creation helper. */ function mycarousel_getItemHTML(item) { return 'img src=' + item.url + ' width=740 height=320 alt=' + item.title + ' /'; }; jQuery(document).ready(function() { jQuery('#mycarousel').jcarousel({ wrap: 'both', scroll: 1, size: mycarousel_itemList.length, itemLoadCallback: {onBeforeAnimation: mycarousel_itemLoadCallback} }); }); /script Any help would be greatly appreciated, Thanks
[jQuery] Re: Superfish 1.4.3 released - now with new documentation
This is really nice Joel. The css are well structured and I think easy to understand. Since it is a prerequisite to use superfish, perhaps you may consider adding a link to a pure css menu article (or to an exemple in your site). Overall the superfish package is very slick to use. I have also discovered the Supersubs plugin to superfish. It tackles really elegantly that common issue of the width of the submenus and the length of its items. On subtle issue I see is still there, that on FF some sub-item text are moving up 1px just after having been rendered. Also one point on which I am still confused since our last talk on how to find an elegant way to add background transparency to submenus, but having that background positioned from the bottom right corner of the submenu. I can myself only imagine rather bad tricks to reach that goal. Thanks a lot for this release. -Olivier http://tinyurl.com/6y8et2 Joel Birch wrote: Hi everyone, I just released Superfish 1.4.3. The documentation is completely overhauled and now uses Mike Alsup's fantastic templates. Please let me know if I've left anything incomplete - it's quite a big nail-biting change. The CSS has undergone further revision. Rather than each menu type (horizontal, vertical, navbar) having it's own CSS file, now you include superfish.css to create the standard menu-type, then add the extra CSS file relevant to the alternate style, as well as adding an extra class to the parent ul to suit. Hopefully the docs explain this well enough. http://users.tpg.com.au/j_birch/plugins/superfish/ Cheers Joel Birch.
[jQuery] Re: blockUI fadeOut
is the blockUI fadeout function working? I was unable to get it to fadeOut fast. (0 fadeOut) Here is an excerpt: $.blockUI({ centerX: true, centerY: 0, message: $('#inRum'), css: { top: '200px', width: '300px', border: '5px solid #535353', padding: '10px', backgroundColor: '#fff', '-webkit-border-radius': '20px', '-moz-border-radius': '20px', opacity: '1', color: '#000' }, fadeOut: 0, fadeTime: 0 }); what is wrong? fadeOut is an option for the unblockUI call.
[jQuery] Re: Why (function($){ ...})(jQuery) instead of (function(){var $ = jQuery; ...})()?
I've actually ellaborated on the idea and come up with my own version: ;if(jQuery) (function($){ ... })(jQuery); ...which: - encloses local vars - silently ignores the code if jQuery is unavailable - avoid colisions when files are merged (; at the start) That will fail if jQuery isn't included, you can do either: if( window.jQuery ) or if( typeof jQuery != 'undefined' ) Note that the (function($){ ... })(jQuery); approach is 6 bytes shorter than (function(){ var $ = jQuery; })(); It also looks cooler ;) -- Ariel Flesler http://flesler.blogspot.com
[jQuery] Re: Clear queued effects
$(element).queue( 'fx', [ ] ).stop(); Can be reduced to $(element).queue( [ ] ).stop(); -- Ariel Flesler http://flesler.blogspot.com On 4 jul, 08:32, caroig [EMAIL PROTECTED] wrote: I've mean messing with hover effects and one of the problems I can't resolve is the queueing of events/effects. What I'd like to do is to remove all effects from the queue once a new effect event has been triggered. Is this possible with a combination of the animate and stop functions? What I'd really like is just be able to remove all queued events for a selected object. You can see the problem I have athttp://67.199.18.208/
[jQuery] Re: Superfish 1.4.3 released - now with new documentation
Thanks Olivier! Regarding the link to a pure CSS menu article, there is a link to A List Apart article on the word suckerfish close to the top of the Overview section as soon as you enter the page. Also, obviously the demo CSS files do all the work for you anyway. Regarding the 1px jump on text: this is something Firefox does that can only be worked around by specifying vertical spacing (line-height, padding, top, etc) in pixels, and that's definitely something that would be worse than what it would solve. I guess we'll have to live with that. I don't remember the details of the background transparency issue you mentioned - sorry. Cheers for the reply! Joel Birch.
[jQuery] Re: Why (function($){ ...})(jQuery) instead of (function(){var $ = jQuery; ...})()?
That will fail if jQuery isn't included, you can do either: if( window.jQuery ) or if( typeof jQuery != 'undefined' ) Oops! :-O Fixed the problem. Thanks for pointing it out... 2008/7/4 Ariel Flesler [EMAIL PROTECTED]: I've actually ellaborated on the idea and come up with my own version: ;if(jQuery) (function($){ ... })(jQuery); ...which: - encloses local vars - silently ignores the code if jQuery is unavailable - avoid colisions when files are merged (; at the start) That will fail if jQuery isn't included, you can do either: if( window.jQuery ) or if( typeof jQuery != 'undefined' ) Note that the (function($){ ... })(jQuery); approach is 6 bytes shorter than (function(){ var $ = jQuery; })(); It also looks cooler ;) -- Ariel Flesler http://flesler.blogspot.com -- Cheers, Diego A.
[jQuery] selecting div's with dynamic id's
Whats the best way to provide functionality (eg. toggle an 'additional information' div) when dealing with records with unique id's. For example lets say we are dealing with product records each one has a unique id which is a number, so the HTML might look something like this: div class=products div class=product id=product_1 pName: Red Widget/p pPrice: 22.00/p pa href=Show description/a/p p id=description_1 style=display:none;sadasdasdasdasd/p /div div class=product id=product_2 pName: Blue Widget/p pPrice: 24.00/p pa href=Show description/a/p p id=description_2 style=display:none;sadasdasdasdasd/p /div etc. etc. /div I want to place unobtrusive jquery that will allow the 'show description' link to display the correct description div... Many thanks, K.
[jQuery] NEW: XML to JSON Plugin
I wrote this a few months but didn't have the time to share it. Now that I've re-done the documentation for 2 of my plugins I thought I'd give it a few hours, knock some examples together and share it with the whole world (ok, maybe just a few people). Basic example: var xml = 'xmlmessageHello world/message/xml'; var json = $.xml2json(xml); alert(json.message); // shows Hello world Ajax example: var file = 'data/hello.xml'; //xmlmessageHello world/message/ xml $.get(file, function(xml){ var json = $.xml2json(xml); alert(json.message); }); See the documentation page for more examples and demos. XML to JSON Plugin - http://fyneworks.com/jquery/xml-to-json/ As always, feedback is welcome! Cheers, Diego
[jQuery] tablesorter - adding rows - need help formating
I've got a table that pops up in an iframe, with data from mysql, with id of datatable.Underneath the table are two buttons: input type = button id = addNew value=Sign Me Up! / input type = button id = cancel value=Cancel / When I press Sign Me Up, I want an empty row to appear, for the user to enter. First question: the empty row comes up, but the formatting is all wrong - all of a sudden I have scrollbars, the text is large, etc. I've tried using the same id and class of my first table, but it's not working. Can someone look at the code below and see what I'm doing wrong? Secondly, is there a way once the user presses Sign Me Up, for that button to change to Save. Then the user will press Save, and I'll send the data back to mysql. $('#addNew').click(function() { $(#datatable).append(tr class='tablesorter'tdinput type='text' /tdinput type='text'/tdinput type='text' /tdinput type='text' /tdinput type='text' /tdinput type='text' //tr); $(#datatable).trigger(update); $(#datatable).trigger(appendCache); return false; }); -- View this message in context: http://www.nabble.com/tablesorter---adding-rows---need-help-formating-tp18281920s27240p18281920.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Validate + Captcha + Remote
up
[jQuery] Re: cluetip doesn't work with IE for me
I even changed it to just have the tip in the call: tr class=hambody id=row_529806td align=left a id=link_529806 class=thickbox tip rel=.tip_529806 href=view.php?mail_id=529806amp;cache_type=hamamp;address_id=6two/a script type=text/javascript$(#link_529806).cluetip(two);/script /td/tr tr class=hambody_alt id=row_550060td align=left a id=link_550060 class=thickbox tip rel=.tip_550060 href=view.php?mail_id=550060amp;cache_type=hamamp;address_id=6three/a script type=text/javascript$(#link_550060).cluetip(three);/script /td/tr And that crashes. On Fri, Jul 4, 2008 at 10:42 AM, Karl Swedberg [EMAIL PROTECTED] wrote: Hi, I can't tell from the information what is causing the problem, but if I had to guess, I'd suggest looking at the content that is being loaded. I've seen problems before when invalid markup, usually caused by unclosed tags, is inserted into the cluetip. Not sure if this is the problem here, but maybe it's a place to start. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 3, 2008, at 11:23 PM, dgm wrote: I'm trying to use cluetip (Looks great!) to display a full text of otherwise truncated data, in a table. (Email subjects are truncated for the normal view, but if you mouse over, I want a tooltip to show the full subject). I'm using php and smarty templates to generate the table rows: td align=left a id=link_{$row[hamloop].id} class=thickbox tip rel=.tip{$row[hamloop].id} href=view.php{$msid}mail_id={$row[hamloop].id}amp;cache_type={$cache_type}amp;address_id={$row[hamloop].address_id} {$row[hamloop].subject|truncate:$truncate_subject:...:true| escape:'htmlall'} /a span class=tip{$row[hamloop].id}{$row[hamloop].subject| escape:javascript|escape:'htmlall'}/span /td and then at the bottom of the file, I do: $('a.tip').cluetip({local:true, cursor: 'pointer'}); This works great on Firefox 3, but IE 6 and 7 just give a blank screen, or a bonk dialog that says the operation was aborted. No other info. :( If I take out the cluetip call, it loads ok. Example output from the code above: td align=left a id=link_12345 class=thickbox tip rel=.tip12345 href=view.php? mail_id=12345amp;cache_type=spamamp;address_id=10 A really long subject line... /a span class=tip12345A really long subject line was truncated/span /td As I understand the docs, the a rel=.tip12345 ... means it will put the span class=tip12345 text into he tooltip. This is repeated many times with different id's, so there is still a one to one mapping of rel's to spans. Any ideas as to what is going on? -- David Morton [EMAIL PROTECTED] - bulk address [EMAIL PROTECTED] - direct to my server -- David Morton [EMAIL PROTECTED] - bulk address [EMAIL PROTECTED] - direct to my server
[jQuery] firefox error NS_ERROR_XPC_JS_THREW_STRING with ajax form submission
Hi Have a problem that shows with firefox (2.0.0.15 on Windows) but not with IE (6). I'm using the Form plugin with a trivial form. I'm using a call to $.ajaxForm() to do an ajax form submission. It never works with firefox, and instead I get this really user friendly error message in the error console: Error: [Exception... 'Permission denied to call method XMLHttpRequest.open' when calling method: [nsIDOMEventListener::handleEvent] nsresult: 0x8057001e (NS_ERROR_XPC_JS_THREW_STRING) location: unknown data: no] Note, this is not fixed by sticking autocomplete=off into the input controls (some versions of firefox seem to have bugs in autocomplete that can lead to this kind of problem; adding autocomplete=off is supposed to work round that but it makes no difference here). Here is a cutdown sample html that demos the problem. You'll note that I've set handlers on the ajaxForm() call to output the request and response, but otherwise do nothing. When run on IE this does exactly what you'd expect - you see an alert before the ajax request is sent, and another when the response is received, and the page remains loaded in the browser. On firefox the first alert appears ok but the response alert never shows, instead you get the above error and the browser then changes the displayed page to be the ajax response text from the server. Any ideas? -- !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; lang=en-US xml:lang=en-US head script src=jquery-1.2.6.js type=text/javascript/script script src=jquery.form.js type=text/javascript/script /head body form method=get action=(url removed) id=rc_form input autocomplete=off type=text name=uv / input autocomplete=off type=submit name=.submit value=Search / /form script type=text/javascript $(function(){ $('#rc_form').ajaxForm({ beforeSubmit: function(formData, jqForm, options) { var queryString = $.param(formData); alert('About to submit: \n\n' + queryString); return true; }, success: function (responseText, statusText) { alert('status: ' + statusText + '\n\nresponseText: \n' + responseText); } }); }); /script /body /html -- Thanks Colin At 22:08 16/06/2008, you wrote: Hi Newbie user and I guess this probably has a simple answer. I have a hidden div on the page that is shown when user clicks a button. Its a help text, in a div, for the page that is only to be shown when the user wants it. But the page is long and when I un-hide the div I also want the browser to scroll the document so as to ensure this div actually visible within the browser window. Is there an easy way in jQuery to ensure a given element is actually visible on screen and not scrolled off the bottom? Thanks Colin -- No virus found in this outgoing message. Checked by AVG. Version: 7.5.523 / Virus Database: 270.3.0/1503 - Release Date: 14/06/2008 18:02 -- No virus found in this incoming message. Checked by AVG. Version: 7.5.523 / Virus Database: 270.3.0/1503 - Release Date: 14/06/2008 18:02 -- Internal Virus Database is out-of-date. Checked by AVG. Version: 7.5.523 / Virus Database: 270.3.0/1503 - Release Date: 14/06/2008 18:02
[jQuery] Re: cluetip doesn't work with IE for me
Well, I wondered about that, there are some funny characters, so I changed it. Now the text being loaded is just one word. Still errors out. On Fri, Jul 4, 2008 at 10:42 AM, Karl Swedberg [EMAIL PROTECTED] wrote: Hi, I can't tell from the information what is causing the problem, but if I had to guess, I'd suggest looking at the content that is being loaded. I've seen problems before when invalid markup, usually caused by unclosed tags, is inserted into the cluetip. Not sure if this is the problem here, but maybe it's a place to start. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 3, 2008, at 11:23 PM, dgm wrote: I'm trying to use cluetip (Looks great!) to display a full text of otherwise truncated data, in a table. (Email subjects are truncated for the normal view, but if you mouse over, I want a tooltip to show the full subject). I'm using php and smarty templates to generate the table rows: td align=left a id=link_{$row[hamloop].id} class=thickbox tip rel=.tip{$row[hamloop].id} href=view.php{$msid}mail_id={$row[hamloop].id}amp;cache_type={$cache_type}amp;address_id={$row[hamloop].address_id} {$row[hamloop].subject|truncate:$truncate_subject:...:true| escape:'htmlall'} /a span class=tip{$row[hamloop].id}{$row[hamloop].subject| escape:javascript|escape:'htmlall'}/span /td and then at the bottom of the file, I do: $('a.tip').cluetip({local:true, cursor: 'pointer'}); This works great on Firefox 3, but IE 6 and 7 just give a blank screen, or a bonk dialog that says the operation was aborted. No other info. :( If I take out the cluetip call, it loads ok. Example output from the code above: td align=left a id=link_12345 class=thickbox tip rel=.tip12345 href=view.php? mail_id=12345amp;cache_type=spamamp;address_id=10 A really long subject line... /a span class=tip12345A really long subject line was truncated/span /td As I understand the docs, the a rel=.tip12345 ... means it will put the span class=tip12345 text into he tooltip. This is repeated many times with different id's, so there is still a one to one mapping of rel's to spans. Any ideas as to what is going on? -- David Morton [EMAIL PROTECTED] - bulk address [EMAIL PROTECTED] - direct to my server
[jQuery] Re: selecting div's with dynamic id's
Hi Kris, I'd give the show description links a common class -- for example, show-description That way you can use a basic selector to apply to all of those links. Then, I'd use the this keyword to find the appropriate description relative to the clicked link. Adding return false will prevent the link's default event from being triggered. So, given your markup, it might look like this: $('a.show-description').click(functino() { $(this).parent().next().show(); return false; }); --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 4, 2008, at 10:36 AM, Kris wrote: Whats the best way to provide functionality (eg. toggle an 'additional information' div) when dealing with records with unique id's. For example lets say we are dealing with product records each one has a unique id which is a number, so the HTML might look something like this: div class=products div class=product id=product_1 pName: Red Widget/p pPrice: 22.00/p pa href=Show description/a/p p id=description_1 style=display:none;sadasdasdasdasd/p /div div class=product id=product_2 pName: Blue Widget/p pPrice: 24.00/p pa href=Show description/a/p p id=description_2 style=display:none;sadasdasdasdasd/p /div etc. etc. /div I want to place unobtrusive jquery that will allow the 'show description' link to display the correct description div... Many thanks, K.
[jQuery] ie6 bug w/ jquery accordion-drawer real world demo
Hi all, Is there anybody who has fixed the css of this apple menu demo under ie6 ? I mean the demo that's on this tutorial and also available under the jquery ui svn trunk : http://jqueryfordesigners.com/slide-out-and-drawer-effect/ TIA
[jQuery] Re: selecting div's with dynamic id's
Hi Karl, Of course, you're right. Javascript should be kept separate from the HTML. Cheers, Diego A. 2008/7/4 Karl Swedberg [EMAIL PROTECTED]: Hi Kris, I'd give the show description links a common class -- for example, show-description That way you can use a basic selector to apply to all of those links. Then, I'd use the this keyword to find the appropriate description relative to the clicked link. Adding return false will prevent the link's default event from being triggered. So, given your markup, it might look like this: $('a.show-description').click(functino() { $(this).parent().next().show(); return false; }); --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 4, 2008, at 10:36 AM, Kris wrote: Whats the best way to provide functionality (eg. toggle an 'additional information' div) when dealing with records with unique id's. For example lets say we are dealing with product records each one has a unique id which is a number, so the HTML might look something like this: div class=products div class=product id=product_1 pName: Red Widget/p pPrice: 22.00/p pa href=Show description/a/p p id=description_1 style=display:none;sadasdasdasdasd/p /div div class=product id=product_2 pName: Blue Widget/p pPrice: 24.00/p pa href=Show description/a/p p id=description_2 style=display:none;sadasdasdasdasd/p /div etc. etc. /div I want to place unobtrusive jquery that will allow the 'show description' link to display the correct description div... Many thanks, K. -- Cheers, Diego A.
[jQuery] Re: cluetip doesn't work with IE for me
Hi David, Seems that IE does not like the script being executed from within a table cell. If you move the scripts out of the body and put them in the head or in a separate file (and make sure you're calling cluetip from within a document ready), it should work. I had to clear my cache before IE would work again after making the changes, but that did the trick. Here is an example, with the table rows copied and pasted from your email: http://test.learningjquery.com/cluetip/demo/table.html Actually, putting the scripts after the table in the body works too. The ways of IE are mysterious. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 4, 2008, at 12:24 PM, David Morton wrote: I even changed it to just have the tip in the call: tr class=hambody id=row_529806td align=left a id=link_529806 class=thickbox tip rel=.tip_529806 href=view.php? mail_id=529806amp;cache_type=hamamp;address_id=6two/a script type=text/javascript$(#link_529806).cluetip(two);/ script /td/tr tr class=hambody_alt id=row_550060td align=left a id=link_550060 class=thickbox tip rel=.tip_550060 href=view.php? mail_id=550060amp;cache_type=hamamp;address_id=6three/a script type=text/javascript$(#link_550060).cluetip(three);/ script /td/tr And that crashes. On Fri, Jul 4, 2008 at 10:42 AM, Karl Swedberg [EMAIL PROTECTED] wrote: Hi, I can't tell from the information what is causing the problem, but if I had to guess, I'd suggest looking at the content that is being loaded. I've seen problems before when invalid markup, usually caused by unclosed tags, is inserted into the cluetip. Not sure if this is the problem here, but maybe it's a place to start. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 3, 2008, at 11:23 PM, dgm wrote: I'm trying to use cluetip (Looks great!) to display a full text of otherwise truncated data, in a table. (Email subjects are truncated for the normal view, but if you mouse over, I want a tooltip to show the full subject). I'm using php and smarty templates to generate the table rows: td align=left a id=link_{$row[hamloop].id} class=thickbox tip rel=.tip{$row[hamloop].id} href = view .php {$ msid }mail_id = {$ row [hamloop ].id }amp ;cache_type={$cache_type}amp;address_id={$row[hamloop].address_id} {$row[hamloop].subject|truncate:$truncate_subject:...:true| escape:'htmlall'} /a span class=tip{$row[hamloop].id}{$row[hamloop].subject| escape:javascript|escape:'htmlall'}/span /td and then at the bottom of the file, I do: $('a.tip').cluetip({local:true, cursor: 'pointer'}); This works great on Firefox 3, but IE 6 and 7 just give a blank screen, or a bonk dialog that says the operation was aborted. No other info. :( If I take out the cluetip call, it loads ok. Example output from the code above: td align=left a id=link_12345 class=thickbox tip rel=.tip12345 href=view.php? mail_id=12345amp;cache_type=spamamp;address_id=10 A really long subject line... /a span class=tip12345A really long subject line was truncated/span /td As I understand the docs, the a rel=.tip12345 ... means it will put the span class=tip12345 text into he tooltip. This is repeated many times with different id's, so there is still a one to one mapping of rel's to spans. Any ideas as to what is going on? -- David Morton [EMAIL PROTECTED] - bulk address [EMAIL PROTECTED] - direct to my server -- David Morton [EMAIL PROTECTED] - bulk address [EMAIL PROTECTED] - direct to my server
[jQuery] Re: NEW: XML to JSON Plugin
Very good!!! Are possible to do reverse? -- Alexsandro www.alexsandro.com.br On 4 jul, 12:34, Diego [EMAIL PROTECTED] wrote: I wrote this a few months but didn't have the time to share it. Now that I've re-done the documentation for 2 of my plugins I thought I'd give it a few hours, knock some examples together and share it with the whole world (ok, maybe just a few people). Basic example: var xml = 'xmlmessageHello world/message/xml'; var json = $.xml2json(xml); alert(json.message); // shows Hello world Ajax example: var file = 'data/hello.xml'; //xmlmessageHello world/message/ xml $.get(file, function(xml){ var json = $.xml2json(xml); alert(json.message); }); See the documentation page for more examples and demos. XML to JSON Plugin -http://fyneworks.com/jquery/xml-to-json/ As always, feedback is welcome! Cheers, Diego
[jQuery] Re: firefox error NS_ERROR_XPC_JS_THREW_STRING with ajax form submission
Error: [Exception... 'Permission denied to call method XMLHttpRequest.open' when calling method: [nsIDOMEventListener::handleEvent] Usually you get this error when you are trying to do an ajax call to a different domain than the calling template is on. That's a no-no. There are ways around it, such as JSONP or using a server proxy. -- Josh - Original Message - From: Colin Manning [EMAIL PROTECTED] To: jquery-en@googlegroups.com Sent: Friday, July 04, 2008 8:45 AM Subject: [jQuery] firefox error NS_ERROR_XPC_JS_THREW_STRING with ajax form submission Hi Have a problem that shows with firefox (2.0.0.15 on Windows) but not with IE (6). I'm using the Form plugin with a trivial form. I'm using a call to $.ajaxForm() to do an ajax form submission. It never works with firefox, and instead I get this really user friendly error message in the error console: Error: [Exception... 'Permission denied to call method XMLHttpRequest.open' when calling method: [nsIDOMEventListener::handleEvent] nsresult: 0x8057001e (NS_ERROR_XPC_JS_THREW_STRING) location: unknown data: no] Note, this is not fixed by sticking autocomplete=off into the input controls (some versions of firefox seem to have bugs in autocomplete that can lead to this kind of problem; adding autocomplete=off is supposed to work round that but it makes no difference here). Here is a cutdown sample html that demos the problem. You'll note that I've set handlers on the ajaxForm() call to output the request and response, but otherwise do nothing. When run on IE this does exactly what you'd expect - you see an alert before the ajax request is sent, and another when the response is received, and the page remains loaded in the browser. On firefox the first alert appears ok but the response alert never shows, instead you get the above error and the browser then changes the displayed page to be the ajax response text from the server. Any ideas? -- !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; lang=en-US xml:lang=en-US head script src=jquery-1.2.6.js type=text/javascript/script script src=jquery.form.js type=text/javascript/script /head body form method=get action=(url removed) id=rc_form input autocomplete=off type=text name=uv / input autocomplete=off type=submit name=.submit value=Search / /form script type=text/javascript $(function(){ $('#rc_form').ajaxForm({ beforeSubmit: function(formData, jqForm, options) { var queryString = $.param(formData); alert('About to submit: \n\n' + queryString); return true; }, success: function (responseText, statusText) { alert('status: ' + statusText + '\n\nresponseText: \n' + responseText); } }); }); /script /body /html -- Thanks Colin At 22:08 16/06/2008, you wrote: Hi Newbie user and I guess this probably has a simple answer. I have a hidden div on the page that is shown when user clicks a button. Its a help text, in a div, for the page that is only to be shown when the user wants it. But the page is long and when I un-hide the div I also want the browser to scroll the document so as to ensure this div actually visible within the browser window. Is there an easy way in jQuery to ensure a given element is actually visible on screen and not scrolled off the bottom? Thanks Colin -- No virus found in this outgoing message. Checked by AVG. Version: 7.5.523 / Virus Database: 270.3.0/1503 - Release Date: 14/06/2008 18:02 -- No virus found in this incoming message. Checked by AVG. Version: 7.5.523 / Virus Database: 270.3.0/1503 - Release Date: 14/06/2008 18:02 -- Internal Virus Database is out-of-date. Checked by AVG. Version: 7.5.523 / Virus Database: 270.3.0/1503 - Release Date: 14/06/2008 18:02
[jQuery] Help finding this script
Greetings! I'm trying to find some jquery plugin like on this webpage http://w1.siemens.com/entry/cc/en/ However I don't know that effect name, so I really don't know how to search :) For instance you have some links like: Drive Technologies, Automation Technologies, Solutions for Industries, etc; when onmouseover the header changes to other picture and changes the header text also, and when you click on those links you see an animation too. Can anyone help me finding this plugin (if jquery has something like that, of course :)) Best Regards!
[jQuery] Re: Why (function($){ ...})(jQuery) instead of (function(){var $ = jQuery; ...})()?
On Fri, Jul 4, 2008 at 7:29 AM, Ariel Flesler [EMAIL PROTECTED] wrote: Note that the (function($){ ... })(jQuery); approach is 6 bytes shorter than (function(){ var $ = jQuery; })(); It also looks cooler ;) These were exactly the points I was going to make. Since $ is really a utility function, having a variable declaration for it all the time seems ugly. The closure trick feels much cleaner, and nicely separates my local variables from the $ function. Plus it's shorter. --Erik
[jQuery] Re: selecting div's with dynamic id's
For anyone who is wondering, functino is Italian for tiny function. Here's another way to write the code, using only a single event handler (event delegation) instead of individual event handlers on every link. This will be faster if there are a lot of product descriptions. I'd also put an ID on the parent DIV - div class=products id=products - to make it even faster: $('#products').click( function( event ) { var $target = $(event.target); if( $target.is('a.show-description') ) { $target.parent().next().show(); return false; } }); -Mike From: Karl Swedberg Hi Kris, I'd give the show description links a common class -- for example, show-description That way you can use a basic selector to apply to all of those links. Then, I'd use the this keyword to find the appropriate description relative to the clicked link. Adding return false will prevent the link's default event from being triggered. So, given your markup, it might look like this: $('a.show-description').click(functino() { $(this).parent().next().show(); return false; }); --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 4, 2008, at 10:36 AM, Kris wrote: Whats the best way to provide functionality (eg. toggle an 'additional information' div) when dealing with records with unique id's. For example lets say we are dealing with product records each one has a unique id which is a number, so the HTML might look something like this: div class=products div class=product id=product_1 pName: Red Widget/p pPrice: 22.00/p pa href=Show description/a/p p id=description_1 style=display:none;sadasdasdasdasd/p /div div class=product id=product_2 pName: Blue Widget/p pPrice: 24.00/p pa href=Show description/a/p p id=description_2 style=display:none;sadasdasdasdasd/p /div etc. etc. /div I want to place unobtrusive jquery that will allow the 'show description' link to display the correct description div... Many thanks, K.
[jQuery] UI Dialog with BUG when resize in IE?
Hi Guys, I´m with problem with UI Dialog, and I´m thing it´s a bug. In this UI Dialog example http://docs.jquery.com/UI/Dialog is possible to verify. If you resize the Dialog to right, for example, and then try to resize to left, the titlebar and content doesn´t seems to reduce it´s width. You can observe looking the X icon used to close the Dialog. It´s a BUG? PS. In FF it´s ok. Regards
[jQuery] Re: selecting div's with dynamic id's
D'oh! silly typo. You crack me up, Michael. :-) --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 4, 2008, at 3:04 PM, Michael Geary wrote: For anyone who is wondering, functino is Italian for tiny function. Here's another way to write the code, using only a single event handler (event delegation) instead of individual event handlers on every link. This will be faster if there are a lot of product descriptions. I'd also put an ID on the parent DIV - div class=products id=products - to make it even faster: $('#products').click( function( event ) { var $target = $(event.target); if( $target.is('a.show-description') ) { $target.parent().next().show(); return false; } }); -Mike From: Karl Swedberg Hi Kris, I'd give the show description links a common class -- for example, show-description That way you can use a basic selector to apply to all of those links. Then, I'd use the this keyword to find the appropriate description relative to the clicked link. Adding return false will prevent the link's default event from being triggered. So, given your markup, it might look like this: $('a.show-description').click(functino() { $(this).parent().next().show(); return false; }); --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 4, 2008, at 10:36 AM, Kris wrote: Whats the best way to provide functionality (eg. toggle an 'additional information' div) when dealing with records with unique id's. For example lets say we are dealing with product records each one has a unique id which is a number, so the HTML might look something like this: div class=products div class=product id=product_1 pName: Red Widget/p pPrice: 22.00/p pa href=Show description/a/p p id=description_1 style=display:none;sadasdasdasdasd/p /div div class=product id=product_2 pName: Blue Widget/p pPrice: 24.00/p pa href=Show description/a/p p id=description_2 style=display:none;sadasdasdasdasd/p /div etc. etc. /div I want to place unobtrusive jquery that will allow the 'show description' link to display the correct description div... Many thanks, K.
[jQuery] Re: How to catch function call
That's good - if it were a different domain we'd be in trouble! I forgot to ask, but the JavaScript function you want to intercept is a global function in the iframe, correct? Then you could use something like this plugin (untested): ;(function( $ ) { $.fn.frameHook = function( name, hook ) { this.each( function() { var win = this.contentWindow; var target = win[name]; win[name] = function() { hook.apply( win, arguments ); return target.apply( win, arguments ); }; }); }; })( jQuery ); Given an iframe with id=myframe and a global function inside the iframe named 'foobar', you would do: $('#myframe').frameHook( 'foobar', function() { alert( 'about to call foobar' ); }); To help illustrate, here's a bare metal version without the jQuery boilerplate: function frameHook( iframe, name, hook ) { var win = iframe.contentWindow; var target = win[name]; win[name] = function() { hook.apply( win, arguments ); return target.apply( win, arguments ); }; } var iframe = $('#myframe')[0]; frameHook( iframe, 'foobar', function() { alert( 'about to call foobar' ); }); -Mike From: Luiz Abrahao Michael, thanks for your time, It's loaded form the same domain. On Jul 3, 3:41 pm, Michael Geary [EMAIL PROTECTED] wrote: Is the iframe loaded from the same domain as the containing page, or a different domain? From: Luiz Abrahao I have one page with one iframe, and there are few javascript function on the page inside the iframe. These functions are triggered by some flash presentations. Basically the parent page has to 'know' when the user has requested the next page (inside the iframe) and update its content with relevant data related with this new page inside the iframe. I can't change the javascript functions from the pages inside the iframe.
[jQuery] Re: Why (function($){ ...})(jQuery) instead of (function(){var $ = jQuery; ...})()?
On Fri, Jul 4, 2008 at 3:08 PM, benjam [EMAIL PROTECTED] wrote: What exactly does (function($){ ... })(jQuery) do? This function($){ ... } is an anonymous function. Because functions are first-class objects in JavaScript, they can be treated just like any other object; which means that you can immediately execute an anonymous function by doing this: function($){ ... }(jQuery) However, because of a quirk in JavaScript syntax, to be able to do this properly, you need to put parentheses around the anonymous function, like this: (function($){ ... })(jQuery) -- Aaron Heimlich Web Developer [EMAIL PROTECTED]
[jQuery] Re: Help finding this script
You probably want to use the hover event to replace a photo and a block of text on your page. What have you tried? Can you put up a simple test page for us to look at? Thanks! ~spicyj
[jQuery] Re: Help finding this script
The effects on this page are done with Adobe Flash. I am not sure how you would do that with jQuery. But I will bet it could be done to some extent. On Fri, Jul 4, 2008 at 2:32 PM, Pedro Correia [EMAIL PROTECTED] wrote: Greetings! I'm trying to find some jquery plugin like on this webpage http://w1.siemens.com/entry/cc/en/ However I don't know that effect name, so I really don't know how to search :) For instance you have some links like: Drive Technologies, Automation Technologies, Solutions for Industries, etc; when onmouseover the header changes to other picture and changes the header text also, and when you click on those links you see an animation too. Can anyone help me finding this plugin (if jquery has something like that, of course :)) Best Regards! -- Simone de Beauvoir - To catch a husband is an art; to hold him is a job.
[jQuery] Re: NEW: XML to JSON Plugin
See the documentation page for more examples and demos. XML to JSON Plugin -http://fyneworks.com/jquery/xml-to-json/ As always, feedback is welcome! Cheers, Diego Very nice, Diego!
[jQuery] Re: Why (function($){ ...})(jQuery) instead of (function(){var $ = jQuery; ...})()?
Not off topic at all, I'll bet a lot of people wonder about that. The short answer is that you are creating a function and calling it immediately. You pass in jQuery as an argument which goes into the function parameter named $, so that's how $ gets to be a reference to the jQuery object. Let's break it down. First, as you know, $ is simply another letter as far as JavaScript identifiers are concerned - there's no magic about that particular character, so $ is just a function or variable name like any other. You could call it JQ instead of $ and the same principles would apply. So, start with this: (function( $ ) { alert( $ === jQuery ); // true })( jQuery ); Now, pull out the inline anonymous function and make it a named function: function foobar( $ ) { alert( $ === jQuery ); // true } (foobar)( jQuery ); We don't need those odd parentheses any more (they were required for syntactic reasons with the inline function): function foobar( $ ) { alert( $ === jQuery ); // true } foobar( jQuery ); Look more familiar now? -Mike Slightly off topic question... What exactly does (function($){ ... })(jQuery) do? How does it work? I understand what it basically does, how it treats $ like jQuery, but how does that notation do that, exactly?
[jQuery] Using JQuery to embed HaloScan comments on a webpage
I am trying to use JQuery to embed Haloscan comments (http:// www.haloscan.com) on a webpage. Normally, one would hardcode the Haloscan reference code in the HTML just under a hardcoded comment. Then one includes the Haloscan javascript underneath the message, with the unique identifier to the message as a parameter: pMy cat message here/p diva href=javascript:HaloScan('cat'); target=_self script type=text/javascriptpostCount('cat');/ script /a | a href=javascript:HaloScanTB('cat'); target=_self script type=text/javascriptpostCountTB('cat'); /script /a/div I am trying to replace all of the javscript with a simple a tag that I can manipulate with JQuery at page load time to set the javascript dynamically. !-- here is my main body code -- diva href=haloscan_cat target=_selfhaloscan_cats/a/div !-- here is the code I insert in the head portion of the page -- SCRIPT type=text/javascript //![CDATA[ $(document).ready(function() { // examine each hyperlink. For each hyperlink with an href beginning with haloscan_, strip // off the haloscan_ prefix and execute the haloscan functions using the remainder of the href string // as the param. The param serves as the message key to haloscan. var sHaloscan_string = haloscan_; $('a').each(function(){ var sHref = $(this).attr(href).toLowerCase(); if (sHref.indexOf(sHaloscan_string) == 0) { sHref = sHref.substr(sHaloscan_string.length); var sNewHTML = a href=\javascript:HaloScan(' + sHref + ');\ target=\_self\ + script type=\text\/javascript\postCount(' + sHref + '); \/script/a; $(this).html(sNewHTML); $(this).click(); } }); }); //]] /SCRIPT The problem is that I can't seem to execute the postCount() function by creating the new HTML and invoking the click(). The postCount() is supposed to return a string that represents the number of comments that have already been made on that post. Any ideas on how I can get the postCount() to execute once I set the new HTML? Thanks experts!
[jQuery] Sumbit Twice a form
How can i submit a form twice, let say I want to save the form data on my database and with the send the same form data to a different script in an external host.
[jQuery] Form submit issues
What is wrong with this code? code$(document).ready(function() { $(#f_submit).hide(); $(#f_altsubmit).click(function(event) { $(#checkoutform)[0].submit(); return false; }); });/code In FF3 this throws an error in the Error console : Error: $(form) [0].submit is not a function but this error does not show up in Firebug. Also what is strange is that when i change the method from submit() to reset() ... the reset works ... It seems my form doesn't have the submit method in FF3 See for yourself at http://dev.rotarygiftshop.com/cart/checkout
[jQuery] Re: Cluetip: Why isn't my top left graphic displaying in my tip?
Yea, I see what you mean. However, it's not perfect it seems. The reason is that when I have .cluetip-rounded #cluetip-outer set to background: transparent; My content box isn't white anymore and it needs to be. This is what I'm using in my .css: .cluetip-rounded #cluetip-outer { background: transparent url(../images/tl.gif) no-repeat 0 0; margin-top: -12px; } If I go with #FFF for the background the background is now white but the tl.gif doesn't appear. That's why I switched everything over to #FFF. How do I get this to work properly? On Jul 4, 4:45 am, donb [EMAIL PROTECTED] wrote: Because .cluetip-rounded #cluetip-title has a background color of #FF. When it's 'transparent', the underlying element's background image can be seen through it. As it is, it can be seen. On Jul 3, 10:41 pm, datatv [EMAIL PROTECTED] wrote: I finally have everything pretty much figured out for my initial ClueTip experience. Except for this one. Check the tips out here: http://www.datatv.com/sw/SW_wp_sampler2.html Now, I've only tested these in Firefox and Safari but the tl.gif isn't displaying even though I click on the View Background Image and I see my image. Here it is: http://www.datatv.com/sw/images/tl.gif So why don't I see it in my tip or is it just my computer driving me nuts?
[jQuery] Re: Form submit issues
What is wrong with this code? code$(document).ready(function() { $(#f_submit).hide(); $(#f_altsubmit).click(function(event) { $(#checkoutform)[0].submit(); return false; }); });/code In FF3 this throws an error in the Error console : Error: $(form) [0].submit is not a function but this error does not show up in Firebug. Also what is strange is that when i change the method from submit() to reset() ... the reset works ... It seems my form doesn't have the submit method in FF3 See for yourself athttp://dev.rotarygiftshop.com/cart/checkout You have an input named 'submit'. Change the name/id of that input and you'll be fine.
[jQuery] jQuery asynchronous responses
Hi guys. jQuery docs(http://docs.jquery.com/Ajax/jQuery.ajax#options) present jQuery.ajax option with asynchronous requests by default. Is it possible with jQuery to do asynchronous responses? I'll want to display asynchronous server side responses after submit a form. Cheers Marco Antonio
[jQuery] Re: Help finding this script
You use an 'onmouseover=()' event to change the image in a specified div. e.g function changeImage(image_url){ $(#image_container).empty(); $(#image_container).append('img src=' + image_url + ' /'); } This function just swaps the images in the image container. On Jul 4, 9:48 pm, Kevin Pepperman [EMAIL PROTECTED] wrote: The effects on this page are done with Adobe Flash. I am not sure how you would do that with jQuery. But I will bet it could be done to some extent. On Fri, Jul 4, 2008 at 2:32 PM, Pedro Correia [EMAIL PROTECTED] wrote: Greetings! I'm trying to find some jquery plugin like on this webpage http://w1.siemens.com/entry/cc/en/ However I don't know that effect name, so I really don't know how to search :) For instance you have some links like: Drive Technologies, Automation Technologies, Solutions for Industries, etc; when onmouseover the header changes to other picture and changes the header text also, and when you click on those links you see an animation too. Can anyone help me finding this plugin (if jquery has something like that, of course :)) Best Regards! -- Simone de Beauvoir - To catch a husband is an art; to hold him is a job.
[jQuery] Re: cluetip doesn't work with IE for me
wait, that still doesn't quite explain it all... The other way I tried it was to have a span right after the link that contain the tooltip text, with a class matching the rel link in the anchor. Then I called the script to load local after the table, after the form actually. On Fri, Jul 4, 2008 at 6:41 PM, David Morton [EMAIL PROTECTED] wrote: erg. The data is available in a loop while in the table... I'll have to loop again to output the javascript. Drat that IE stuff. I'll give it a shot. Maybe I can capture the javascript string in variable as I loop and then output it later. I have tried to get rid of the tables altogether, but seeing as how it is rows and columns of data, it's some pretty hard CSS to make it work. Thanks for the help! On Fri, Jul 4, 2008 at 12:47 PM, Karl Swedberg [EMAIL PROTECTED] wrote: Hi David, Seems that IE does not like the script being executed from within a table cell. If you move the scripts out of the body and put them in the head or in a separate file (and make sure you're calling cluetip from within a document ready), it should work. I had to clear my cache before IE would work again after making the changes, but that did the trick. Here is an example, with the table rows copied and pasted from your email: http://test.learningjquery.com/cluetip/demo/table.html Actually, putting the scripts after the table in the body works too. The ways of IE are mysterious. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 4, 2008, at 12:24 PM, David Morton wrote: I even changed it to just have the tip in the call: tr class=hambody id=row_529806td align=left a id=link_529806 class=thickbox tip rel=.tip_529806 href=view.php?mail_id=529806amp;cache_type=hamamp;address_id=6two/a script type=text/javascript$(#link_529806).cluetip(two);/script /td/tr tr class=hambody_alt id=row_550060td align=left a id=link_550060 class=thickbox tip rel=.tip_550060 href=view.php?mail_id=550060amp;cache_type=hamamp;address_id=6three/a script type=text/javascript$(#link_550060).cluetip(three);/script /td/tr And that crashes. On Fri, Jul 4, 2008 at 10:42 AM, Karl Swedberg [EMAIL PROTECTED] wrote: Hi, I can't tell from the information what is causing the problem, but if I had to guess, I'd suggest looking at the content that is being loaded. I've seen problems before when invalid markup, usually caused by unclosed tags, is inserted into the cluetip. Not sure if this is the problem here, but maybe it's a place to start. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 3, 2008, at 11:23 PM, dgm wrote: I'm trying to use cluetip (Looks great!) to display a full text of otherwise truncated data, in a table. (Email subjects are truncated for the normal view, but if you mouse over, I want a tooltip to show the full subject). I'm using php and smarty templates to generate the table rows: td align=left a id=link_{$row[hamloop].id} class=thickbox tip rel=.tip{$row[hamloop].id} href=view.php{$msid}mail_id={$row[hamloop].id}amp;cache_type={$cache_type}amp;address_id={$row[hamloop].address_id} {$row[hamloop].subject|truncate:$truncate_subject:...:true| escape:'htmlall'} /a span class=tip{$row[hamloop].id}{$row[hamloop].subject| escape:javascript|escape:'htmlall'}/span /td and then at the bottom of the file, I do: $('a.tip').cluetip({local:true, cursor: 'pointer'}); This works great on Firefox 3, but IE 6 and 7 just give a blank screen, or a bonk dialog that says the operation was aborted. No other info. :( If I take out the cluetip call, it loads ok. Example output from the code above: td align=left a id=link_12345 class=thickbox tip rel=.tip12345 href=view.php? mail_id=12345amp;cache_type=spamamp;address_id=10 A really long subject line... /a span class=tip12345A really long subject line was truncated/span /td As I understand the docs, the a rel=.tip12345 ... means it will put the span class=tip12345 text into he tooltip. This is repeated many times with different id's, so there is still a one to one mapping of rel's to spans. Any ideas as to what is going on? -- David Morton [EMAIL PROTECTED] - bulk address [EMAIL PROTECTED] - direct to my server -- David Morton [EMAIL PROTECTED] - bulk address [EMAIL PROTECTED] - direct to my server -- David Morton [EMAIL PROTECTED] - bulk address [EMAIL PROTECTED] - direct to my server -- David Morton [EMAIL PROTECTED] - bulk address [EMAIL PROTECTED] - direct to my server
[jQuery] Re: Sumbit Twice a form
I'd script the database host to send the data on to the second site, myself... On Fri, Jul 4, 2008 at 6:18 PM, xomero [EMAIL PROTECTED] wrote: How can i submit a form twice, let say I want to save the form data on my database and with the send the same form data to a different script in an external host. -- David Morton [EMAIL PROTECTED] - bulk address [EMAIL PROTECTED] - direct to my server
[jQuery] Re: cluetip doesn't work with IE for me
Oh son of a . My entire layout has a table (I know, I know) and so I had to move the script call to the footer file. At least I can now stick the tooltip text in a span that gets hidden and avoid looping again. On Fri, Jul 4, 2008 at 7:01 PM, David Morton [EMAIL PROTECTED] wrote: wait, that still doesn't quite explain it all... The other way I tried it was to have a span right after the link that contain the tooltip text, with a class matching the rel link in the anchor. Then I called the script to load local after the table, after the form actually. On Fri, Jul 4, 2008 at 6:41 PM, David Morton [EMAIL PROTECTED] wrote: erg. The data is available in a loop while in the table... I'll have to loop again to output the javascript. Drat that IE stuff. I'll give it a shot. Maybe I can capture the javascript string in variable as I loop and then output it later. I have tried to get rid of the tables altogether, but seeing as how it is rows and columns of data, it's some pretty hard CSS to make it work. Thanks for the help! On Fri, Jul 4, 2008 at 12:47 PM, Karl Swedberg [EMAIL PROTECTED] wrote: Hi David, Seems that IE does not like the script being executed from within a table cell. If you move the scripts out of the body and put them in the head or in a separate file (and make sure you're calling cluetip from within a document ready), it should work. I had to clear my cache before IE would work again after making the changes, but that did the trick. Here is an example, with the table rows copied and pasted from your email: http://test.learningjquery.com/cluetip/demo/table.html Actually, putting the scripts after the table in the body works too. The ways of IE are mysterious. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 4, 2008, at 12:24 PM, David Morton wrote: I even changed it to just have the tip in the call: tr class=hambody id=row_529806td align=left a id=link_529806 class=thickbox tip rel=.tip_529806 href=view.php?mail_id=529806amp;cache_type=hamamp;address_id=6two/a script type=text/javascript$(#link_529806).cluetip(two);/script /td/tr tr class=hambody_alt id=row_550060td align=left a id=link_550060 class=thickbox tip rel=.tip_550060 href=view.php?mail_id=550060amp;cache_type=hamamp;address_id=6three/a script type=text/javascript$(#link_550060).cluetip(three);/script /td/tr And that crashes. On Fri, Jul 4, 2008 at 10:42 AM, Karl Swedberg [EMAIL PROTECTED] wrote: Hi, I can't tell from the information what is causing the problem, but if I had to guess, I'd suggest looking at the content that is being loaded. I've seen problems before when invalid markup, usually caused by unclosed tags, is inserted into the cluetip. Not sure if this is the problem here, but maybe it's a place to start. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 3, 2008, at 11:23 PM, dgm wrote: I'm trying to use cluetip (Looks great!) to display a full text of otherwise truncated data, in a table. (Email subjects are truncated for the normal view, but if you mouse over, I want a tooltip to show the full subject). I'm using php and smarty templates to generate the table rows: td align=left a id=link_{$row[hamloop].id} class=thickbox tip rel=.tip{$row[hamloop].id} href=view.php{$msid}mail_id={$row[hamloop].id}amp;cache_type={$cache_type}amp;address_id={$row[hamloop].address_id} {$row[hamloop].subject|truncate:$truncate_subject:...:true| escape:'htmlall'} /a span class=tip{$row[hamloop].id}{$row[hamloop].subject| escape:javascript|escape:'htmlall'}/span /td and then at the bottom of the file, I do: $('a.tip').cluetip({local:true, cursor: 'pointer'}); This works great on Firefox 3, but IE 6 and 7 just give a blank screen, or a bonk dialog that says the operation was aborted. No other info. :( If I take out the cluetip call, it loads ok. Example output from the code above: td align=left a id=link_12345 class=thickbox tip rel=.tip12345 href=view.php? mail_id=12345amp;cache_type=spamamp;address_id=10 A really long subject line... /a span class=tip12345A really long subject line was truncated/span /td As I understand the docs, the a rel=.tip12345 ... means it will put the span class=tip12345 text into he tooltip. This is repeated many times with different id's, so there is still a one to one mapping of rel's to spans. Any ideas as to what is going on? -- David Morton [EMAIL PROTECTED] - bulk address [EMAIL PROTECTED] - direct to my server -- David Morton [EMAIL PROTECTED] - bulk address [EMAIL PROTECTED] - direct to my server -- David Morton [EMAIL PROTECTED] - bulk address [EMAIL PROTECTED] - direct to my server -- David Morton [EMAIL PROTECTED] - bulk address [EMAIL PROTECTED] - direct to my server -- David Morton [EMAIL PROTECTED] - bulk address [EMAIL PROTECTED]
[jQuery] Re: UI Dialog with BUG when resize in IE?
On Fri, 4 Jul 2008 12:18:52 -0700 (PDT), Leandro Vieira Pinho wrote: I´m with problem with UI Dialog, and I´m thing it´s a bug. In this UI Dialog example http://docs.jquery.com/UI/Dialog is possible to verify. If you resize the Dialog to right, for example, and then try to resize to left, the titlebar and content doesn´t seems to reduce it´s width. You can observe looking the X icon used to close the Dialog. It´s a BUG? It works fine here in IE7. What version of IE are you using? Chuck
[jQuery] Re: cluetip doesn't work with IE for me
David, Is there any way that you can just reference a separate file with your script in it? That's the preferred way. You can then put script src=yourfilename.js/script in the head of your document. Then in yourfilename.js, you put the cluetip line inside a document ready: $(document).ready(function() { $('whatever').cluetip(); }); You won't have to worry about any of this stuff then, and you can keep the behavior separate from the content. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 4, 2008, at 8:01 PM, David Morton wrote: wait, that still doesn't quite explain it all... The other way I tried it was to have a span right after the link that contain the tooltip text, with a class matching the rel link in the anchor. Then I called the script to load local after the table, after the form actually. On Fri, Jul 4, 2008 at 6:41 PM, David Morton [EMAIL PROTECTED] wrote: erg. The data is available in a loop while in the table... I'll have to loop again to output the javascript. Drat that IE stuff. I'll give it a shot. Maybe I can capture the javascript string in variable as I loop and then output it later. I have tried to get rid of the tables altogether, but seeing as how it is rows and columns of data, it's some pretty hard CSS to make it work. Thanks for the help! On Fri, Jul 4, 2008 at 12:47 PM, Karl Swedberg [EMAIL PROTECTED] wrote: Hi David, Seems that IE does not like the script being executed from within a table cell. If you move the scripts out of the body and put them in the head or in a separate file (and make sure you're calling cluetip from within a document ready), it should work. I had to clear my cache before IE would work again after making the changes, but that did the trick. Here is an example, with the table rows copied and pasted from your email: http://test.learningjquery.com/cluetip/demo/table.html Actually, putting the scripts after the table in the body works too. The ways of IE are mysterious. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 4, 2008, at 12:24 PM, David Morton wrote: I even changed it to just have the tip in the call: tr class=hambody id=row_529806td align=left a id=link_529806 class=thickbox tip rel=.tip_529806 href=view.php? mail_id=529806amp;cache_type=hamamp;address_id=6two/a script type=text/javascript$(#link_529806).cluetip(two);/ script /td/tr tr class=hambody_alt id=row_550060td align=left a id=link_550060 class=thickbox tip rel=.tip_550060 href=view.php? mail_id=550060amp;cache_type=hamamp;address_id=6three/a script type=text/javascript$(#link_550060).cluetip(three);/ script /td/tr And that crashes. On Fri, Jul 4, 2008 at 10:42 AM, Karl Swedberg [EMAIL PROTECTED] wrote: Hi, I can't tell from the information what is causing the problem, but if I had to guess, I'd suggest looking at the content that is being loaded. I've seen problems before when invalid markup, usually caused by unclosed tags, is inserted into the cluetip. Not sure if this is the problem here, but maybe it's a place to start. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 3, 2008, at 11:23 PM, dgm wrote: I'm trying to use cluetip (Looks great!) to display a full text of otherwise truncated data, in a table. (Email subjects are truncated for the normal view, but if you mouse over, I want a tooltip to show the full subject). I'm using php and smarty templates to generate the table rows: td align=left a id=link_{$row[hamloop].id} class=thickbox tip rel=.tip{$row[hamloop].id} href = view .php {$ msid }mail_id = {$ row [hamloop ].id }amp ;cache_type={$cache_type}amp;address_id={$row[hamloop].address_id} {$row[hamloop].subject|truncate:$truncate_subject:...:true| escape:'htmlall'} /a span class=tip{$row[hamloop].id}{$row[hamloop].subject| escape:javascript|escape:'htmlall'}/span /td and then at the bottom of the file, I do: $('a.tip').cluetip({local:true, cursor: 'pointer'}); This works great on Firefox 3, but IE 6 and 7 just give a blank screen, or a bonk dialog that says the operation was aborted. No other info. :( If I take out the cluetip call, it loads ok. Example output from the code above: td align=left a id=link_12345 class=thickbox tip rel=.tip12345 href=view.php? mail_id=12345amp;cache_type=spamamp;address_id=10 A really long subject line... /a span class=tip12345A really long subject line was truncated/ span /td As I understand the docs, the a rel=.tip12345 ... means it will put the span class=tip12345 text into he tooltip. This is repeated many times with different id's, so there is still a one to one mapping of rel's to spans. Any ideas as to what is going on? -- David Morton [EMAIL PROTECTED] - bulk address [EMAIL PROTECTED] - direct to my server -- David Morton [EMAIL PROTECTED] - bulk
[jQuery] Re: NEW: XML to JSON Plugin
Hi Alexsandro, Do you mean (1)convert the generate JSON back to XML? OR... (2)define a javascript object and convert it to XML? If (1): I initially built this plugin for my personal use (for my convenience) so I could easily process XML data. Because of that, I didn't bother to differentiate between attributes / nodes. ie.: xmlpersonnameDiego/name/person/xml ...gives the same output as this... xmlperson name=Diego/person/xml ...so it would be impossible to reverse the conversion. If (2): This is quite easy. And actually, it would be pretty similar to the code I wrote to show the JSON structure in HTML (Under Examples Basic/Extended Structure) I will write this when I get a chance, but I'd rather wait for the feedback on this plugin to work out the best way to do it... Cheers, Diego Alexsandro_xpt wrote: Very good!!! Are possible to do reverse? -- Alexsandro www.alexsandro.com.br On 4 jul, 12:34, Diego [EMAIL PROTECTED] wrote: I wrote this a few months but didn't have the time to share it. Now that I've re-done the documentation for 2 of my plugins I thought I'd give it a few hours, knock some examples together and share it with the whole world (ok, maybe just a few people). Basic example: var xml = 'xmlmessageHello world/message/xml'; var json = $.xml2json(xml); alert(json.message); // shows Hello world Ajax example: var file = 'data/hello.xml'; //xmlmessageHello world/message/ xml $.get(file, function(xml){ �var json = $.xml2json(xml); �alert(json.message); }); See the documentation page for more examples and demos. XML to JSON Plugin -http://fyneworks.com/jquery/xml-to-json/ As always, feedback is welcome! Cheers, Diego
[jQuery] Lightbox/Zoom mashup
I am trying to find a solution that is like Lightbox but with an option to show a small box to show detail of the image in a separate box. Basically, integrate jqZoom into Lightbox. Anyone know of such a beast or how to mash them up? I tried but I am not getting the proper result. I used: http://www.balupton.com/sandbox/jquery_lightbox/ and http://www.mind-projects.it/blog/jqzoom_v10 Thanks -AP
[jQuery] Re: NEW: XML to JSON Plugin
Hi Mike, I actually wrote this to use with your form plugin (to process xml responses of a CMS). Really appreciate your feedback... Cheers, Diego Mike Alsup wrote: See the documentation page for more examples and demos. XML to JSON Plugin -http://fyneworks.com/jquery/xml-to-json/ As always, feedback is welcome! Cheers, Diego Very nice, Diego!
[jQuery] Re: cluetip doesn't work with IE for me
Sure, feel free to ask for feature enhancements here. Forgive me if you're already aware of this, but I thought I'd point out that you do not need to use the rel attribute to grab the content. You can use whatever attribute you'd like. In fact, if you're pointing to local content, it would make sense to use a link's href attribute to point to fetch the contents. That way, if JavaScript is turned off, you have an anchor link to the content on the page. You could use this HTML, for example: a class=tip href=#somecontentlink to clueTip contents/a div id=somecontentthis is the content that will show up in the clueTip/div And this jQuery: $(document).ready(function() { $('a.tip').cluetip({ attribute: 'href', local: true }); }); Would this meet your need? --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 4, 2008, at 10:35 PM, David Morton wrote: Yes, I think I can, now that I can use the local element concept. I was afraid before that I'd have to have a $ ('something').cluetip(dynamic) line for every row - and since that data is dynamic, I couldn't reference another file. Is this the proper place to ask for feature enhancements for cluetip? I like the idea of having a cluetip element automatically look for another element locally, but it is a slight abuse of html attributes. One example is the rel attribute for a elements - it's not really supposed to be used to reference another class... Also, since not everything that needs a tip is an anchor, I'm using label elements and for attributes for some of my cluetips, but it breaks the validation a little as the for attribute cannot start with a . or #. So.. a couple of ways around it, if cluetip could be made to follow... Have an option for the cluetip call that tells it to assume a . in front of the class name attribute, which would let the text validate, or an option to assume the tooltip text is in an element with an id the same as the anchor plus a prefix or suffix. ie, p class=MyTooltips id=somethingblah blah/p span id=cluetip_somethingHere's the text of the tooltip/span $('.MyTooltips').cluetip({ useids: true }); This gets rid of the need for the rel attribute hack. On Fri, Jul 4, 2008 at 9:02 PM, Karl Swedberg [EMAIL PROTECTED] wrote: David, Is there any way that you can just reference a separate file with your script in it? That's the preferred way. You can then put script src=yourfilename.js/script in the head of your document. Then in yourfilename.js, you put the cluetip line inside a document ready: $(document).ready(function() { $('whatever').cluetip(); }); You won't have to worry about any of this stuff then, and you can keep the behavior separate from the content. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 4, 2008, at 8:01 PM, David Morton wrote: wait, that still doesn't quite explain it all... The other way I tried it was to have a span right after the link that contain the tooltip text, with a class matching the rel link in the anchor. Then I called the script to load local after the table, after the form actually. On Fri, Jul 4, 2008 at 6:41 PM, David Morton [EMAIL PROTECTED] wrote: erg. The data is available in a loop while in the table... I'll have to loop again to output the javascript. Drat that IE stuff. I'll give it a shot. Maybe I can capture the javascript string in variable as I loop and then output it later. I have tried to get rid of the tables altogether, but seeing as how it is rows and columns of data, it's some pretty hard CSS to make it work. Thanks for the help! On Fri, Jul 4, 2008 at 12:47 PM, Karl Swedberg [EMAIL PROTECTED] wrote: Hi David, Seems that IE does not like the script being executed from within a table cell. If you move the scripts out of the body and put them in the head or in a separate file (and make sure you're calling cluetip from within a document ready), it should work. I had to clear my cache before IE would work again after making the changes, but that did the trick. Here is an example, with the table rows copied and pasted from your email: http://test.learningjquery.com/cluetip/demo/table.html Actually, putting the scripts after the table in the body works too. The ways of IE are mysterious. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 4, 2008, at 12:24 PM, David Morton wrote: I even changed it to just have the tip in the call: tr class=hambody id=row_529806td align=left a id=link_529806 class=thickbox tip rel=.tip_529806 href=view.php? mail_id=529806amp;cache_type=hamamp;address_id=6two/a script type=text/javascript$(#link_529806).cluetip(two);/ script /td/tr tr class=hambody_alt id=row_550060td align=left a id=link_550060 class=thickbox tip rel=.tip_550060 href=view.php?
[jQuery] Re: Using ClueTip with Image Maps in IE
ok. quick suggestion for now until I look more into this: you don't need to use the rel attribute at all. you can instead set the attribute option to any attribute you want. You could use the title attribute from the area for the clueTip title (default) or use the alt attribute for it; you can use the href attribute to fetch the contents from an element with a matching id. $('area').cluetip({ attribute: 'href', titleAttribute: 'alt', local: true }); --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 3, 2008, at 3:04 PM, C.Everson wrote: On Thu, 3 Jul 2008 14:12:56 -0400, Karl Swedberg wrote: Sorry for the delay in replying. I'll try to take a look at this tonight. Thanks Karl! BTW, another issue that I ran into with the Image Maps is that REL appears to NOT be a valid attribute of the AREA tag. This was causing HTML validation to croakg. I was able to reset ClueTip to use the href to pass the ID of a hidden content div down the page, but that seems a bit of a kludge... Thinking about that (and digging into your code some more) I found that the first parameter to ClueTip can be the tip. That made me wonder if (for Image Maps) it might be better to be able to set splitTitle: true and then pass both the tip and title as the first parameter (with the | or whatever as the split element. Of course that would not make the map 508 friendly (since there would be no Alt or Title over the AREA), but it might be a way to make things work and still pass validation. If that was an option, then I guess the only other consideration would be how to solve the REL issue (and still pass validation). Another idea (if possible), might be to use splitTitle and get it to pull the tip title from the first part of the content pulled in for the tip... Anyway - thanks again for your great work on this and I look forward to seeing what you come up with. Chuck