[jQuery] Re: the dropdown menu flashes on the screen on page load.
You may want to specifically tell the menu dive to not display, hard coded. div id=menuitems style=display:none;/div On May 1, 6:04 pm, Theodore Ni [EMAIL PROTECTED] wrote: You'll need to give us more information, a demo or at least some code, before we can help you diagnose. On Thu, May 1, 2008 at 5:18 PM, all4one [EMAIL PROTECTED] wrote: I have two drop-down lists in the main menu at the top of the page. When you click on link items in the top menu (different menu) which is below the main menu the drop-down menu flashs then disapears as the rest of the page loads. -- Ted
[jQuery] Re: event binding on dynamically created elements? stumped
LiveQuery plug-in will make you happy. On May 1, 8:07 pm, jquertil [EMAIL PROTECTED] wrote: Hello... I'm creating an input element like this: $(this).after('input type=text name=symptom value=Enter Symptom class=focusClear/ '); then I want to clear the value on focus like so: $('.focusClear').focus(function(){ $(this).val(''); }); Obviously this doesnt work cine jquery doesnt know about the element yet. Do I need to write it as an extension? Thanks!
[jQuery] Re: jQuery and JSON - newbie!
Hi eid, I've taken a look at what you are trying to do and I think there are two aspects that need to be 'corrected'. 1.) In the JSON, there is no need for an array of items - remove the [ ] after 'items'. items is then an object with elements called 'lanceOfMitraDivinity', 'wrathOfMitraDivinity', etc. Much easier to handle. 2.) To setup the buttons you would be better like this (not the only way to do it, but this works!): $.getJSON('featsCalculator/priestofmitra.js', function(data) { $('.featButton').click(function() { var t = $(this).attr('id'); if(data.items[t]) { $('#state').html(data.items[t].description.base); } }); }); You can use the items part of the json like an array, even though it is an object - because all objects can be accessed either via the dot operator (.) or using square brackets ([]). Here is some tested code that works with the modified json you provided. Just cut and paste (modify any filenames and paths) and try it. - start of code script type=text/javascript src=js/jquery.js/script script $(document).ready(function() { $.getJSON('featsCalculator/priestofmitra.js', function(data) { $('.featButton').click(function() { var t = $(this).attr('id'); if(data.items[t]) { $('#state').html(data.items[t].description.base); } }); }); }); /script div id='state'/div div class='featButton' id='lanceOfMitraDivinity'Lanc/div div class='featButton' id='piercingLanceDivinity'Pier/div div class='featButton' id='condemnationDivinity'Cond/div - end of code Hope that helps a bit. Cheers, Dave On May 1, 5:03 pm, eid [EMAIL PROTECTED] wrote: Okay I tried to do what you said. This is my JSON file:http://pastebin.com/m616d0550 and this is my js file: $(document).ready(function() { $.getJSON('featsCalculator/priestofmitra.js', function(data) { $('.featButton').hover(function() { if(data.items.jsname == $(this).attr('id')) { alert(data.items.jsname); } }); }); }); Nothing happens when I hover a .featButton. What's wrong?
[jQuery] Re: How to stop other elements on the page from dimming
I experienced the same problem and it haunted me in my sleep, I started to think it was a jQuery bug. I understand this is a FF bug, but don't you think at least there should be some sort of reference to this bug in the jquery fade docs? On May 2, 3:21 am, Karl Swedberg [EMAIL PROTECTED] wrote: It's fixed in the Firefox 3 beta. :-) --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On May 1, 2008, at 6:09 PM, Micky Hulse wrote: Ah, interesting. Thanks for the tip Karl! Anyone know if FF/Mac folks are planning on fixing this bug? Thanks, M On May 1, 1:59 pm, Karl Swedberg [EMAIL PROTECTED] wrote: Are you using FF Mac? If so, it's an opacity bug in the browser. Try setting this in the stylesheet: body { -moz-opacity: 0.; } --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On May 1, 2008, at 4:47 PM, Andy Matthews wrote: Unless those other elements are being included in the fade, they shouldn't be effected. -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Austin S. Sent: Thursday, May 01, 2008 2:37 PM To: jQuery (English) Subject: [jQuery] How to stop other elements on the page from dimming Hi All - Is there a way to stop the other elements on the page from dimming when a fade occurs?
[jQuery] Re: the dropdown menu flashes on the screen on page load.
Here is the link to the page: http://www3.appliedbiosystems.com/index.htm Notice how the My Account and My Basket/Orders dropdowns briefly display as the page loads. Also note that they display briefly when the page refreshes after clicking on Applications Technologis, Services or Support in the main (blue) menu bar. This is what I'm trying to prevent. I believe the following code displays the dropdowns on mouseover and hides them when the mouse leaves. Am I on the right path? dom.query('div.trigger').hide(); dom.query('div.trigger').bgIframe(); dom.query('div.subMenuAlt').bgIframe(); dom.query('div.subMenu').bgIframe(); dom.query(li#myAccount, li#myBasket).bind(mouseenter, function(){ dom.query(this).find(a).eq(0).addClass(active); dom.query(this).find(div.trigger).show(); dom.query(#topMenu ul li).css(position, static); }).bind(mouseleave, function(){ dom.query(this).find(a).eq(0).removeClass(active); dom.query(this).find(div.trigger).hide(); dom.query(#topMenu ul li).css(position, relative); }); On May 1, 3:04 pm, Theodore Ni [EMAIL PROTECTED] wrote: You'll need to give us more information, a demo or at least some code, before we can help you diagnose. On Thu, May 1, 2008 at 5:18 PM, all4one [EMAIL PROTECTED] wrote: I have two drop-down lists in the main menu at the top of the page. When you click on link items in the top menu (different menu) which is below the main menu the drop-down menu flashs then disapears as the rest of the page loads. -- Ted
[jQuery] Problem wih jQery Effect i FireFox
Hi everyone , currently I am using jQUery in my Projectwhich is a CMS and some kind of Portal , Recently I faced A little Problem with my jQuery at my FireFox Browser I check My codes with 2 browsers which are Standard and Suitable for testing 1-IE7 2- Firefox 2 I used some jQUery Effects such as toggle ,slideDown, slideUp and etc… There was no problem in my IE7 but in one situation there was a problem in my firefox … If we scroll the page down at thebottom of the page there is button which is Clickable and it will do some toggle and slide effects , in Firefox We will face some Flashes in the page and some jumping in the paging which only occurs in fireffox… Who could help me on this you can try it , I’ve seen this problem in everywhere and this is not user Friendly …. What should we do … For example in my project at the Bottom of the page I had some paging for the content And this is my code int my Firefox Browser which is versian 2.1.14 the latest versian of the 2 ... if the content Scrolls down in the page to the Bottom of the page then if we do some slideDown or slideUp Effect the page starts to Flash for a second ... but I don't have this Problem IN the IE 7 ... so what is the solution this is my code ... I did some Paging stuff with jQuery /Down Paging starts ***/ $(table#downProPaging span a).click(function(){ var PagingData={ start:$(this).parent().attr(id), bId:$(#DownDataPostBid).val() }; $.ajax({ url: 'pro/showpro/DownData.php', type: 'POST', data: PagingData,// id of the tree dataType: 'html', cache: false, beforeSend: function() { $(#showProDownMsg:visible).hide(); $(#down_in_data_pro).slideUp(1000); $(#down_in_loading_pro).show(1000); $(#down_in_loading_pro).html(inimg); }, error: function(){ // if the data has not been send alert('xml error'); }, success: function (txt){ $(#down_in_loading_pro).hide(1000); $(#down_in_data_pro).html(txt); $(#down_in_data_pro).slideDown(1000); } }); return false; }); /Down Paging Ends ***/ Regards Pedram
[jQuery] Using @ on Selector
Sometime awhile back, I copied and used a piece of code that contains an @ char on the selector: $([EMAIL PROTECTED])... I am now wondering the significance of using that character since it functions the same as $(input[name=message]) I tried looking for it on the docs, but could find its usage. Any ideas? Thanks Mike
[jQuery] Re: Manipulating Select Options Doesn't work in IE7
I'd also like to know how to do this. Thanks.
[jQuery] Re: Hide/Close div when clicked outside of it.
I was try to do in this way. But it also close div clicking inside of it. So, if I click in wrapper area it close divLoginBox1. But if I clicked divLoginBox1 area it close it also. Should be the way how exclude divLoginBox1 area from wrapper div. This line not help to do it: $(#wrapper).not('#divLoginBox1') On May 1, 10:14 pm, Jimslam [EMAIL PROTECTED] wrote: The Easiest method would be to create a wrapper div that takes up the entire screen and assign an onClick event to that, which would then contain the other div. For example: div id=wrapper div id=divLoginBox1 Login box content /div /div The CSS for the DIV id=wrapper would be something like: #wrapper { position:absolute; height:100%; width: 100%; } Then the JS would be: $(#wrapper').click(function() { $('#divLoginBox1').hide(); }); That should do it. You could leave the #wrapper background transparent or add in some opacity to a background color to emulate a faded effect to the page content. I believe this is similar to how well established libraries like thickbox handle the same functionality. On May 1, 11:14 am, Aleksandr [EMAIL PROTECTED] wrote: Yes you right. Also I have close link inside of the div. Everything is working, only outside click left. On May 1, 3:08 pm, Wes Duff [EMAIL PROTECTED] wrote: Let me see if I have this clear. Once I do I will write you up a script. When someone clicks a link a href=#Show Login Box/a you want to display a div that shows the login box. When someone clicks somewhere else on the screen and not on the link you want to hide the login box? On May 1, 5:08 am, Aleksandr [EMAIL PROTECTED] wrote: I still have the same issue. Yes, I have wrapper div how it can be solved in this case? Thanks On Apr 30, 7:05 pm, Wes Duff [EMAIL PROTECTED] wrote: Off the top of my head --- Try something like this $('div#mydiv').clcik(function(){$('div#mydiv').show();}); //click to show div $('div:not(#mydiv)').click(function(){$('div#mydiv').hide()}); click anywhere else to hide div ## Problem just thought of If you are using a wrapper div then you will have the same problem as before. Well you get the idea. This is just off the top of my head but if it donst work you get the idea. On Apr 30, 11:17 am, Aleksandr [EMAIL PROTECTED] wrote: Hi All, I am showing a div on click of a hyperlink. Now, when i click elsewhere in the document other than the div itself, then i want to hide the showing div... Is there any easy way to do this? I've already try: $('html').click(function() { $('#divLoginBox1').hide(); }); and $('body').click(function() { $('#divLoginBox1').hide(); }); but this close div when clicked inside of it. Thanks, Alex
[jQuery] Re: click(function(select) help
@Dave: when I selected the first product it showed me its options. Changing an option didn't do a thing. Clicking again on first product, hid its options. @motob: I used this instead: $(.product-type).change(function(){ if($(this).val() == filters){ $('fieldset.filters').slideDown(slow); } else { $('fieldset.filters').slideUp(slow); } }); Because I have about 8 products not only 2. It worked for one so, I guess it will work for all 8 if I define it separately for each product. First of all thank you. Second, is there anyway to streamline this code instead of repeating it 8 times? or should I just bite the bullet? What do you reckon? Cheers, Elle On May 2, 12:35 am, motob [EMAIL PROTECTED] wrote: Instead of adding click listeners to the option elements, add a change listener to the overall select menu. Once the change event is fired, determine which value is choosen, then show/hide the appropriate option fieldset. NOTE: You may want to change the values of the option elements so that they don't contain spaces. I'm not sure if those spaces will cause problems or not. $(document).ready(function(){ $(#product-type).change(function(){ if($(this).val() == product a){ $('fieldset.producta').slideDown(slow); $('fieldset.productb').slideUp(slow); } else { $('fieldset.productb').slideDown(slow); $('fieldset.producta').slideUp(slow); } }); }); The above code is untested, but that is the basic idea of what you would need to do. On May 1, 4:57 am, Waz and Elle [EMAIL PROTECTED] wrote: Hi again, I have a form with products select menu. I would like to show and hide product specific options as the user selects them. Now, I can show the product options but I don't know how to hide them if the user selects a different product. My HTML is: snip... select id=product-type name=product-type class=product-type option value=select selected=selected-Select-/option option value=product a class=productaProduct A/option option value=product b class=productbProduct B/option /select/p fieldset class=producta options ... /fieldset fieldset class=productb options ... /fieldset snip My code at the moment is: $('#orderform').find('.options').hide(); $('.product-type').find('option.producta').click(function(select) { $('fieldset.producta').slideDown(slow); }); $('.product-type').find('option.productb').click(function(select) { $('fieldset.productb').slideDown(slow); }); So, if I change the user changes his/her mind between product a to product b, the options stay visible, and I'm not sure how to hide them again. Also, if the user already entered information in the fieldset's fields, should I reset them when I hide them? Any advice will be great. Thanks, Elle
[jQuery] jcarousel in ie 5.5
Anybody knows how to make work jcarousel in ie 5.5?. Now i see a white space in the place of the jcarousel. Perfect in ie6, ie7 and Firefox. Thanks!
[jQuery] How to extend a function
Hi, I'm using thickbox to show content around a site, but the core thickbox.js is shared by multiple sites. For one particular site, I need to add some custom javascript when certain thickbox functions are called, such as TB_show and TB_remove. I've tried the code below, but this doesn't work. TB_show.extend({ $(.mpu).css(visibility,hidden); }) Any idea how I can extend an existing function?
[jQuery] Re: random tab and simple content switching
Hi Can anyone else help with this? I tried adding a third item in var ids = [ 'latestArticle', 'inTheMag' ]; but have had no joy in getting it to randomnly appear. Any ideas? Cheers On Apr 5, 3:49 pm, Tim Marshall [EMAIL PROTECTED] wrote: Hi Sperks I'm a bit new at JQuery and have been following what you have done here. I'm trying though to add a third id in and can't figure out how to get it to work with an additional set of div's or more for that matter. Can you help? On Feb 22, 2:33 pm, sperks [EMAIL PROTECTED] wrote: I worked a little longer and in case anyone has been watching trying to work out what I was on about... Here's my final code. I don't thinks it's very clean, and I'm sure there are easier ways of doing this, ways that don't require me to name the ids, etc., but I'm not familiar with the intricate workings of math functions. Heck I'm proud I got this far. $(document).ready(function() { var ids = [ 'latestArticle', 'inTheMag' ]; var index = Math.round( Math.random()*10 ) % 2; var id = ids[ index ]; $('#mainArticle #' + id + ' .teaser').hide(); $('#mainArticle #' + id + ' h1 span').addClass(hidden); $('#mainArticle div h1').click(function(){ var place = $(this).parent().attr(id); $('#mainArticle h1 span').addClass(hidden); $('#' + place + ' h1 span').removeClass(hidden); $('#mainArticle .teaser').hide(); $('#' + place + ' .teaser').slideDown('slow'); }); }); On Feb 21, 6:32 pm, sperks [EMAIL PROTECTED] wrote: update: I'm still looking for the random side of things, but I've got a solution for the switching. However, I'm a little concerned that I'm targeting h1 rather than the span (how do I go back two parents?) $(document).ready(function() { $('#mainArticle #latestArticle .teaser').hide(); $('#mainArticle #latestArticle h1 span').addClass(hidden); $('#mainArticle div h1').click(function(){ var place = $(this).parent().attr(id); $('#mainArticle h1 span').addClass(hidden); $('#' + place + ' h1 span').removeClass(hidden); $('#mainArticle .teaser').hide(); $('#' + place + ' .teaser').slideDown('slow'); }); });
[jQuery] Re: clone() help
Hi Karl, and thank you for your reply. This didn't really work -- unless I missed something important on the way. I was reading Learning jQuery and it says that .clone() doesn't copy the events related to the cloned items (which I need). It suggested to use copyEvents.js So, I have that script linked and I checked: http://www.learningjquery.com/2007/01/copy-events-from-one-element-to-another but... I still don't get it to work. What is my mistake??? My code now says: ... $(document).ready(function() { $('#orderform').find('.options').hide(); $('#add').one('click', function() { $('.product-template').copyEventsTo('#orderform .product- template'); return false; }); ... Any ideas??? Thanks, Elle On May 2, 12:44 am, Karl Swedberg [EMAIL PROTECTED] wrote: Hi Elle, Here are a few thoughts. Your code: $(#add).click(function() { $(.product-template).clone().appendTo(.product-template:last- child); }); - Do you have this inside a document.ready? $(document).ready(function() { $(#add).click(function() { $(.product-template).clone().appendTo(.product-template:last- child); }); }); - To clone the events along with the DOM elements you can do .clone(true) instead of .clone() - The problem with the click not working could have to do with the :last-child part. I'd change it to :last and also change the insertion method from .appendTo() to .insertAfter() - Probably a good idea to only clone the first .product-template each time. Try something like this: $(document).ready(function() { $(#add).click(function() { $(div.product-template:first).clone(true).insertAfter(div.product- template:last); }); }); Hope that points you in the right direction. --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On May 1, 2008, at 1:53 AM, Waz and Elle wrote: Hi, I'm new to jquery and went over quite a few tutorials -- some work great for me, with no problems at all. But I'm having trouble with the .clone() method. I am trying to build an order form, and have a button#add, which when clicked I want it to add another div.product-template (that includes a select list, options, quantity and add to cart button). So, my code says: http://pastie.caboo.se/189769 but... when I click on the button#add, once nothing happens, second time it adds the .product-template but any functions I had attached to the select list don't work. third click gets rid of my second .product- template. In my document I have: snip ... div#orderform form button#add fieldset#step1 div.product-template rest of options come here fieldset#step2 snip ... Would anyone know how to correct this? TIA, Elle
[jQuery] Need to create a really simple slide animation that slides a div left and right when the corresponding left and right arrows are clicked
I basically have a div of a fixed width and height with overflow:hidden in place to hide the content. Within that div (outerdiv) is another div (innerdiv) with a fixed width and move divs (contentdivs) floated left inside it to make them sit alongside each other. I have 2 arrows, one pointing left and the other pointing right. I need to attach code to the left and right arrows that will slide the innerdiv left and right a fixed amount of pixels (e.g. 280px) at a time. Anyone have any ideas? I would like to attach the easing plugin to it as well. Dave
[jQuery] How to extend a function
Hi guys, I'm using thickbox to pop up content, but the thickbox.js is shared between multiple projects which means I cannot edit the core functions in that file. Instead, I want to run some extra javascript on one particular project and I wondered if there was a way to extend an existing function? I've written some code below that I thought might work but it doesn't :( Any ideas? TB_show.extend({ $(.mpu).css(visibility,hidden); })
[jQuery] Re: Need to create a really simple slide animation that slides a div left and right when the corresponding left and right arrows are clicked
I basically have a div of a fixed width and height with overflow:hidden in place to hide the content. Within that div (outerdiv) is another div (innerdiv) with a fixed width and move divs (contentdivs) floated left inside it to make them sit alongside each other. I have 2 arrows, one pointing left and the other pointing right. I need to attach code to the left and right arrows that will slide the innerdiv left and right a fixed amount of pixels (e.g. 280px) at a time. Anyone have any ideas? I would like to attach the easing plugin to it as well. Dave, You can do that quite easily with the Cycle plugin: http://malsup.com/jquery/cycle/scrollhv.html Mike
[jQuery] Re: event binding on dynamically created elements? stumped
Why use LiveQuery for an element that is in the DOM at the desired moment ? -- Ariel Flesler http://flesler.blogspot.com On 2 mayo, 06:31, yabado [EMAIL PROTECTED] wrote: LiveQuery plug-in will make you happy. On May 1, 8:07 pm, jquertil [EMAIL PROTECTED] wrote: Hello... I'm creating an input element like this: $(this).after('input type=text name=symptom value=Enter Symptom class=focusClear/ '); then I want to clear the value on focus like so: $('.focusClear').focus(function(){ $(this).val(''); }); Obviously this doesnt work cine jquery doesnt know about the element yet. Do I need to write it as an extension? Thanks!- Ocultar texto de la cita - - Mostrar texto de la cita -
[jQuery] [SITE SUBMISSION] discovercard.com
I just noticed discovercard.com is using jQuery. When you're logged in, it also uses Klaus Hartl's excellent Tabs plugin. Cool. - Richard
[jQuery] Re: Using @ on Selector
The @ is deprecated, [foo=bar] should be used instead, but it will still work. -- Ariel Flesler http://flesler.blogspot.com On 2 mayo, 01:34, Mike Francisco [EMAIL PROTECTED] wrote: Sometime awhile back, I copied and used a piece of code that contains an @ char on the selector: $([EMAIL PROTECTED])... I am now wondering the significance of using that character since it functions the same as $(input[name=message]) I tried looking for it on the docs, but could find its usage. Any ideas? Thanks Mike
[jQuery] Re: How to stop other elements on the page from dimming
I'd say put it in the FAQ, that's where I'd go on a case like this. Why is my screen going dark when using fadeOut ? -- Ariel Flesler http://flesler.blogspot.com On 2 mayo, 07:17, Richard W [EMAIL PROTECTED] wrote: I experienced the same problem and it haunted me in my sleep, I started to think it was a jQuery bug. I understand this is a FF bug, but don't you think at least there should be some sort of reference to this bug in the jquery fade docs? On May 2, 3:21 am, Karl Swedberg [EMAIL PROTECTED] wrote: It's fixed in the Firefox 3 beta. :-) --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On May 1, 2008, at 6:09 PM, Micky Hulse wrote: Ah, interesting. Thanks for the tip Karl! Anyone know if FF/Mac folks are planning on fixing this bug? Thanks, M On May 1, 1:59 pm, Karl Swedberg [EMAIL PROTECTED] wrote: Are you using FF Mac? If so, it's an opacity bug in the browser. Try setting this in the stylesheet: body { -moz-opacity: 0.; } --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On May 1, 2008, at 4:47 PM, Andy Matthews wrote: Unless those other elements are being included in the fade, they shouldn't be effected. -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Austin S. Sent: Thursday, May 01, 2008 2:37 PM To: jQuery (English) Subject: [jQuery] How to stop other elements on the page from dimming Hi All - Is there a way to stop the other elements on the page from dimming when a fade occurs?- Ocultar texto de la cita - - Mostrar texto de la cita -
[jQuery] Finding the size of an image
Hello folks, I am wanting to find the width of an image loaded via an ajax call so that I can alter the width of a div holding the caption for that image. The image that is loaded is always tagged with an id of 'theImage'. Each image loaded with each ajax call has a slightly different width. The fitCaption function below doesn't work and I don't understand why - can someone help me please? function getNextPage(ej) { $.get(scripts/ajax_ramosus_client_second.asp?brm=+ej +q= + new Date().getTime(), function(responseText){ $(#wrapper).html(responseText); fitCaption(); }); }; function fitCaption(){ var img_width=50; if (($('#theImage').length0)) { img_width = $('#theImage').width(); }; alert (img_width); $(#sCaption).css(width,img_width); } The alert call displays 0 all the time. My mistake is??? Thanks, Bruce
[jQuery] Re: jQuery and JSON - newbie!
Hi Dave, it worked great with a little bit of modification. Thank you very, very much! And I even learned something new today then :) Thanks again eid Dave Probert wrote: Hi eid, I've taken a look at what you are trying to do and I think there are two aspects that need to be 'corrected'. 1.) In the JSON, there is no need for an array of items - remove the [ ] after 'items'. items is then an object with elements called 'lanceOfMitraDivinity', 'wrathOfMitraDivinity', etc. Much easier to handle. 2.) To setup the buttons you would be better like this (not the only way to do it, but this works!): $.getJSON('featsCalculator/priestofmitra.js', function(data) { $('.featButton').click(function() { var t = $(this).attr('id'); if(data.items[t]) { $('#state').html(data.items[t].description.base); } }); }); You can use the items part of the json like an array, even though it is an object - because all objects can be accessed either via the dot operator (.) or using square brackets ([]). Here is some tested code that works with the modified json you provided. Just cut and paste (modify any filenames and paths) and try it. - start of code script type=text/javascript src=js/jquery.js/script script $(document).ready(function() { $.getJSON('featsCalculator/priestofmitra.js', function(data) { $('.featButton').click(function() { var t = $(this).attr('id'); if(data.items[t]) { $('#state').html(data.items[t].description.base); } }); }); }); /script div id='state'/div div class='featButton' id='lanceOfMitraDivinity'Lanc/div div class='featButton' id='piercingLanceDivinity'Pier/div div class='featButton' id='condemnationDivinity'Cond/div - end of code Hope that helps a bit. Cheers, Dave
[jQuery] Re: jQuery and JSON - newbie!
Glad I could help :) Cheers, Dave On May 2, 6:35 pm, eid [EMAIL PROTECTED] wrote: Hi Dave, it worked great with a little bit of modification. Thank you very, very much! And I even learned something new today then :) Thanks again eid Dave Probert wrote: Hi eid, I've taken a look at what you are trying to do and I think there are two aspects that need to be 'corrected'. 1.) In the JSON, there is no need for an array of items - remove the [ ] after 'items'. items is then an object with elements called 'lanceOfMitraDivinity', 'wrathOfMitraDivinity', etc. Much easier to handle. 2.) To setup the buttons you would be better like this (not the only way to do it, but this works!): $.getJSON('featsCalculator/priestofmitra.js', function(data) { $('.featButton').click(function() { var t = $(this).attr('id'); if(data.items[t]) { $('#state').html(data.items[t].description.base); } }); }); You can use the items part of the json like an array, even though it is an object - because all objects can be accessed either via the dot operator (.) or using square brackets ([]). Here is some tested code that works with the modified json you provided. Just cut and paste (modify any filenames and paths) and try it. - start of code script type=text/javascript src=js/jquery.js/script script $(document).ready(function() { $.getJSON('featsCalculator/priestofmitra.js', function(data) { $('.featButton').click(function() { var t = $(this).attr('id'); if(data.items[t]) { $('#state').html(data.items[t].description.base); } }); }); }); /script div id='state'/div div class='featButton' id='lanceOfMitraDivinity'Lanc/div div class='featButton' id='piercingLanceDivinity'Pier/div div class='featButton' id='condemnationDivinity'Cond/div - end of code Hope that helps a bit. Cheers, Dave
[jQuery] Re: jcarousel in ie 5.5
Ray, Anybody knows how to make work jcarousel in ie 5.5?. Now i see a white space in the place of the jcarousel. Perfect in ie6, ie7 and Firefox. Thanks! jQuery only officially supports IE6 and above, so if you really need to support a browser that old you're probably going to have problems with any of the modern JS libraries (since they all pretty much required IE6+.) -Dan
[jQuery] Re: async treeview - Can we have a callback method that is invoked when the return status is not 200?
When the return code is an error, the global ajaxError event is triggered. Give that a try. Jörn On Thu, May 1, 2008 at 7:46 PM, rolfsf [EMAIL PROTECTED] wrote: Another request for the Async Treeview - in our application, we have an automatic session time out after a set period of idle time. After that timeout, the server will return a 302 Redirect status. We then popup a dialog or redirect to the login page. We need to have a callback method that is invoked when the return status is not 200 OK Is there an easy way to get that? Thanks, rolf
[jQuery] how to unbind the glid function in featurecontactglider.js
Dear All. I'm facing a problem in glider plug-in. Actually I want to disable the next link of toc class but in vain I unbind the glid function in my code but its throwing error of undefined glide. On the other hand If I unbind that function then no action perform in other condition like that: let suppose there's 3 tabs in my case, tab1Link, tab2Link, tab3Link I've a checkbox in my tab1Link. I want if user check that checkbox then browser let me go to next tab named: tab2Link otherwise it stop gliding and let the user tab remain on same tab named: tab2Link. if($(#checkbox).attr(checked)==undefined) { alert(Please check the checke box then proceed); $(#tab2Link).unbind(click,glide); } Can anybody help me out to solve this solution. Its very urgent. Regards, Mohsin
[jQuery] Selector Madness! How to Select all the Text on a Page?
Okay I have read and reread http://www.learningjquery.com/2006/11/how-to-get-anything-you-want-part-1 and http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2 and still cannot figure out how to grab all the text (not the markup) on a page. I am toying with the Google Translation API and am attempting to parse all text, translate, and put it back. I have the looping logic (and the 500 char limit issue with Google) sorted out, but I can't get the fundamental part down...GRABBING ALL THE TEXT. So let's say you have markup like so ul lia href=somelinkblabh blah 1/a/li lia href=somelinkblabh blah 2/a/li lia href=somelinkblabh blah 3/a/li /ul and even h1some heading/h1 and pSome paragraph text/p etc. etc. I want to be able to grab all the text and manipulate it. I've tried $(#mainContainerDiv *).each(...some function), but this crashed the system. I would like to do something like this: $(#mainContainerDiv *.text.each(some function...), but this clearly won't work. Any help is greatly appreciated.
[jQuery] Re: count lis within a ul.
So shouldnt it be $(div.belt ul li).length(); Nope, jQuery objects have a .size() method and a .length property, both return the number of elements in the object. I don't even see the size() method documented anymore so .length is the way to go. http://docs.jquery.com/Core
[jQuery] jQuery Effect Problem In Firefox 2
Recently I faced A little Problem with my jQuery at my FireFox Browser I check My codes with 2 browsers which are Standard and Suitable for testing 1-IE7 2- Firefox 2 I used some jQUery Effects such as toggle ,slideDown, slideUp and etc… There was no problem in my IE7 but in one situation there was a problem in my firefox … If we scroll the page down at thebottom of the page there is button which is Clickable and it will do some toggle and slide effects , in Firefox We will face some Flashes in the page and some jumping in the paging which only occurs in fireffox… Who could help me on this you can try it , I’ve seen this problem in everywhere and this is not user Friendly …. What should we do … For example in my project at the Bottom of the page I had some paging for the content And this is my code /Down Paging starts ***/ $(table#downProPaging span a).click(function(){ var PagingData={ start:$(this).parent().attr(id), bId:$(#DownDataPostBid).val() }; $.ajax({ url: 'pro/showpro/DownData.php', type: 'POST', data: PagingData,// id of the tree dataType: 'html', cache: false, beforeSend: function() { $(#showProDownMsg:visible).hide(); $(#down_in_data_pro).slideUp(1000); $(#down_in_loading_pro).show(1000); $(#down_in_loading_pro).html(inimg); }, error: function(){ // if the data has not been send alert('xml error'); }, success: function (txt){ $(#down_in_loading_pro).hide(1000); $(#down_in_data_pro).html(txt); $(#down_in_data_pro).slideDown(1000); } }); return false; }); /Down Paging Ends ***/ Regards Pedram
[jQuery] Re: [validate] RFC: buttons and cancel class
Yes, that is a better solution. Thank you. ks On Apr 28, 1:35 am, Jörn Zaefferer [EMAIL PROTECTED] wrote: Karan Sev schrieb: Hi, I have button (type: submit) with the class 'cancel' but this still results in the form being validated. It works if I change the button to an input. After // allow suppresing validation by adding a cancel class to the submit button this.find(input.cancel:submit).click(function() { validator.cancelSubmit = true; }); To fix this on line 42 I added, // allow suppresing validation by adding a cancel class to the submit button this.find(button.cancel:submit).click(function() { validator.cancelSubmit = true; }); I know this might be on a tangent, but was this just a simple omission or are button evils and I should stick with inputs? This was just an ommision. How about just .cancel:submit as the selector? That would match both inputs and buttons. Jörn- Hide quoted text - - Show quoted text -
[jQuery] Re: Selector Madness! How to Select all the Text on a Page?
ah why not try $(body).text() That should strip all of the markup? - jake On Fri, May 2, 2008 at 8:55 AM, Joe [EMAIL PROTECTED] wrote: Okay I have read and reread http://www.learningjquery.com/2006/11/how-to-get-anything-you-want-part-1 and http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2 and still cannot figure out how to grab all the text (not the markup) on a page. I am toying with the Google Translation API and am attempting to parse all text, translate, and put it back. I have the looping logic (and the 500 char limit issue with Google) sorted out, but I can't get the fundamental part down...GRABBING ALL THE TEXT. So let's say you have markup like so ul lia href=somelinkblabh blah 1/a/li lia href=somelinkblabh blah 2/a/li lia href=somelinkblabh blah 3/a/li /ul and even h1some heading/h1 and pSome paragraph text/p etc. etc. I want to be able to grab all the text and manipulate it. I've tried $(#mainContainerDiv *).each(...some function), but this crashed the system. I would like to do something like this: $(#mainContainerDiv *.text.each(some function...), but this clearly won't work. Any help is greatly appreciated.
[jQuery] livequery with hoverIntent
hello! i need to assign a behaviour triggered via the hoverIntent plugin to elements fetched via ajax. I would assume i should use the livequery plugin for that, but my attempts have failed miserably so far. Here is the non livequery code, that works for DOM elements present on document ready: $('ul.mainmenu:not(#applicationTitle)').hoverIntent({ sensitivity: 2, interval: 0, over: function(){ $('li, li a', $(this)).addClass('visible'); }, timeout: 0, out: function(){ $('li, li a', $(this)).removeClass('visible'); } }) i tried this, but it doesn't work _ Any help *much* appreciated, thanks !! $('ul.mainmenu:not(#applicationTitle)').livequery(function(){ $(this).hoverIntent({ sensitivity: 2, interval: 0, over: function(){ $('li, li a', $(this)).addClass('visible'); }, timeout: 0, out: function(){ $('li, li a', $(this)).removeClass('visible'); } }); })
[jQuery] Re: Ajax .click function after .get
Always read the docs first. http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_Ajax_request.3F -- Ariel Flesler http://flesler.blogspot.com On 1 mayo, 23:01, betomurcia [EMAIL PROTECTED] wrote: Hello guys I am just starting to play with and learn jquery. I have come to some problems and were able to solve them. I think that its something obvious that i am missing in the .get() I am trying to create a page that will never refresh so for the navigation bar i decided to use the ajax .get function to change the innerhtml of a special div tag. But when i do that the new content that is in the html does not seem to work with my jquery rules that i have $(a[href^=#]).not(.point).click(function(){ $(#main).html('div id=loadingLoading Contentbr /img src=images/loader.gif alt=Loading//div'); $.get(ajaxreader.php?idpage=+$(this).attr(id),function(data){ $(#main).html(data); }); }); the links inside the html that get changed are also href=#something so they should work but they don't. Any help or tips will be appreciated? If you have a better way to do refreshless sites using jquery can you please tell me? Thanks in advance
[jQuery] Re: Selector Madness! How to Select all the Text on a Page?
http://docs.jquery.com/Traversing/contents -- Ariel Flesler http://flesler.blogspot.com On 2 mayo, 09:55, Joe [EMAIL PROTECTED] wrote: Okay I have read and rereadhttp://www.learningjquery.com/2006/11/how-to-get-anything-you-want-pa... and http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-pa... and still cannot figure out how to grab all the text (not the markup) on a page. I am toying with the Google Translation API and am attempting to parse all text, translate, and put it back. I have the looping logic (and the 500 char limit issue with Google) sorted out, but I can't get the fundamental part down...GRABBING ALL THE TEXT. So let's say you have markup like so ul lia href=somelinkblabh blah 1/a/li lia href=somelinkblabh blah 2/a/li lia href=somelinkblabh blah 3/a/li /ul and even h1some heading/h1 and pSome paragraph text/p etc. etc. I want to be able to grab all the text and manipulate it. I've tried $(#mainContainerDiv *).each(...some function), but this crashed the system. I would like to do something like this: $(#mainContainerDiv *.text.each(some function...), but this clearly won't work. Any help is greatly appreciated.
[jQuery] Re: Selector Madness! How to Select all the Text on a Page?
i think you will need to feed a variable, because jquery loops through each node, so: var fullText =''; $('body *').each(function(){ fullText += $(this).text(); }); On Fri, May 2, 2008 at 3:24 PM, Jake McGraw [EMAIL PROTECTED] wrote: ah why not try $(body).text() That should strip all of the markup? - jake On Fri, May 2, 2008 at 8:55 AM, Joe [EMAIL PROTECTED] wrote: Okay I have read and reread http://www.learningjquery.com/2006/11/how-to-get-anything-you-want-part-1 and http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2 and still cannot figure out how to grab all the text (not the markup) on a page. I am toying with the Google Translation API and am attempting to parse all text, translate, and put it back. I have the looping logic (and the 500 char limit issue with Google) sorted out, but I can't get the fundamental part down...GRABBING ALL THE TEXT. So let's say you have markup like so ul lia href=somelinkblabh blah 1/a/li lia href=somelinkblabh blah 2/a/li lia href=somelinkblabh blah 3/a/li /ul and even h1some heading/h1 and pSome paragraph text/p etc. etc. I want to be able to grab all the text and manipulate it. I've tried $(#mainContainerDiv *).each(...some function), but this crashed the system. I would like to do something like this: $(#mainContainerDiv *.text.each(some function...), but this clearly won't work. Any help is greatly appreciated. -- Alexandre Plennevaux LAb[au] http://www.lab-au.com
[jQuery] Re: Selector Madness! How to Select all the Text on a Page?
@Jake and @Alexandre He doesn't want the text as a single string, he wants each node so he can replace them. -- Ariel Flesler http://flesler.blogspot.com On 2 mayo, 10:30, Alexandre Plennevaux [EMAIL PROTECTED] wrote: i think you will need to feed a variable, because jquery loops through each node, so: var fullText =''; $('body *').each(function(){ fullText += $(this).text(); }); On Fri, May 2, 2008 at 3:24 PM, Jake McGraw [EMAIL PROTECTED] wrote: ah why not try $(body).text() That should strip all of the markup? - jake On Fri, May 2, 2008 at 8:55 AM, Joe [EMAIL PROTECTED] wrote: Okay I have read and rereadhttp://www.learningjquery.com/2006/11/how-to-get-anything-you-want-pa... and http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-pa... and still cannot figure out how to grab all the text (not the markup) on a page. I am toying with the Google Translation API and am attempting to parse all text, translate, and put it back. I have the looping logic (and the 500 char limit issue with Google) sorted out, but I can't get the fundamental part down...GRABBING ALL THE TEXT. So let's say you have markup like so ul lia href=somelinkblabh blah 1/a/li lia href=somelinkblabh blah 2/a/li lia href=somelinkblabh blah 3/a/li /ul and even h1some heading/h1 and pSome paragraph text/p etc. etc. I want to be able to grab all the text and manipulate it. I've tried $(#mainContainerDiv *).each(...some function), but this crashed the system. I would like to do something like this: $(#mainContainerDiv *.text.each(some function...), but this clearly won't work. Any help is greatly appreciated. -- Alexandre Plennevaux LAb[au] http://www.lab-au.com- Ocultar texto de la cita - - Mostrar texto de la cita -
[jQuery] Re: livequery with hoverIntent
I don't see anything wrong with the code you posted. Could you post more of the code or a test page? -- Brandon Aaron On Fri, May 2, 2008 at 8:26 AM, Alexandre Plennevaux [EMAIL PROTECTED] wrote: hello! i need to assign a behaviour triggered via the hoverIntent plugin to elements fetched via ajax. I would assume i should use the livequery plugin for that, but my attempts have failed miserably so far. Here is the non livequery code, that works for DOM elements present on document ready: $('ul.mainmenu:not(#applicationTitle)').hoverIntent({ sensitivity: 2, interval: 0, over: function(){ $('li, li a', $(this)).addClass('visible'); }, timeout: 0, out: function(){ $('li, li a', $(this)).removeClass('visible'); } }) i tried this, but it doesn't work _ Any help *much* appreciated, thanks !! $('ul.mainmenu:not(#applicationTitle)').livequery(function(){ $(this).hoverIntent({ sensitivity: 2, interval: 0, over: function(){ $('li, li a', $(this)).addClass('visible'); }, timeout: 0, out: function(){ $('li, li a', $(this)).removeClass('visible'); } }); })
[jQuery] Re: Cluetip showing content below fold
Dimensions is definitely being included. jquery: 1.2.3, minified distribution dimensions: 1.2, minified distribution cluetip: 0.9.6 Tried turning the other libraries off, but that had no effect. I'll see what I can do about hosting the page so it is publically visible. - Luis On May 1, 1:53 pm, Karl Swedberg [EMAIL PROTECTED] wrote: thanks for the info. Another thing you can check is whether you are including the Dimensions plugin. (it's a dependancy.) If it's in there, then the next thing I'd like to know is the version # you're using for jquery core, dimensions, and cluetip. Of course, if you have a page you can show me with the problem, that would be even better. The more information I have regarding your particular situation, the better I can help you. The plugin is already doing the iteration ( return this.each() ), so that shouldn't be relevant. --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com
[jQuery] Horirzonal Accordion
I need a Horizonal Accordion code for Download .. if there is a link for Download Please let me know !!! Regards Pedram
[jQuery] $(script) : Why isn't it reliable?
Hi. I am reading jQuery in action book. On that book, I got a serious question. The book says, $(div) ... we won't be able to use this technique to reliably create script elements There's no reason why $(script) is not reliable. Does anyone can explain the reason? Thanks.
[jQuery] Shadow jQUery
I need Image Shadow with jQuery I think it is a the main jQuery. 1.2.3.js If there is an Example for the Code please let me know Regards Pedram
[jQuery] Re: Selector Madness! How to Select all the Text on a Page?
i just tried a very basic search/replace and it worked: $('body *').each(function(){ var original_text = $(this).text(); var new_text = 'hello baby'; $(this).text(new_text); }); it's over simplistic so for this firefox didn't have any issue. Heavier processing might require to sequence the work load, doing ajax calls (one for each node) sequentially for example. On Fri, May 2, 2008 at 4:00 PM, Joe [EMAIL PROTECTED] wrote: Ariel, You are correct. Attempting suggestions now. Thanks guys! Joe On May 2, 8:32 am, Ariel Flesler [EMAIL PROTECTED] wrote: @Jake and @Alexandre He doesn't want the text as a single string, he wants each node so he can replace them. -- Ariel Fleslerhttp://flesler.blogspot.com On 2 mayo, 10:30, Alexandre Plennevaux [EMAIL PROTECTED] wrote: i think you will need to feed a variable, because jquery loops through each node, so: var fullText =''; $('body *').each(function(){ fullText += $(this).text(); }); On Fri, May 2, 2008 at 3:24 PM, Jake McGraw [EMAIL PROTECTED] wrote: ah why not try $(body).text() That should strip all of the markup? - jake On Fri, May 2, 2008 at 8:55 AM, Joe [EMAIL PROTECTED] wrote: Okay I have read and rereadhttp://www.learningjquery.com/2006/11/how-to-get-anything-you-want-pa... and http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-pa... and still cannot figure out how to grab all the text (not the markup) on a page. I am toying with the Google Translation API and am attempting to parse all text, translate, and put it back. I have the looping logic (and the 500 char limit issue with Google) sorted out, but I can't get the fundamental part down...GRABBING ALL THE TEXT. So let's say you have markup like so ul lia href=somelinkblabh blah 1/a/li lia href=somelinkblabh blah 2/a/li lia href=somelinkblabh blah 3/a/li /ul and even h1some heading/h1 and pSome paragraph text/p etc. etc. I want to be able to grab all the text and manipulate it. I've tried $(#mainContainerDiv *).each(...some function), but this crashed the system. I would like to do something like this: $(#mainContainerDiv *.text.each(some function...), but this clearly won't work. Any help is greatly appreciated. -- Alexandre Plennevaux LAb[au] http://www.lab-au.com-Ocultar texto de la cita - - Mostrar texto de la cita - -- Alexandre Plennevaux LAb[au] http://www.lab-au.com
[jQuery] Re: Selector Madness! How to Select all the Text on a Page?
Don't feel like coding it all, but you need to iterate thru childNodes (contents() or $.each + .childNodes) and if it's a text node, you check the .nodeValue, create a new text node with the translation, and do original.parentNode.replaceChild( translated, original ); -- Ariel Flesler http://flesler.blogspot.com On 2 mayo, 11:13, Alexandre Plennevaux [EMAIL PROTECTED] wrote: i just tried a very basic search/replace and it worked: $('body *').each(function(){ var original_text = $(this).text(); var new_text = 'hello baby'; $(this).text(new_text); }); it's over simplistic so for this firefox didn't have any issue. Heavier processing might require to sequence the work load, doing ajax calls (one for each node) sequentially for example. On Fri, May 2, 2008 at 4:00 PM, Joe [EMAIL PROTECTED] wrote: Ariel, You are correct. Attempting suggestions now. Thanks guys! Joe On May 2, 8:32 am, Ariel Flesler [EMAIL PROTECTED] wrote: @Jake and @Alexandre He doesn't want the text as a single string, he wants each node so he can replace them. -- Ariel Fleslerhttp://flesler.blogspot.com On 2 mayo, 10:30, Alexandre Plennevaux [EMAIL PROTECTED] wrote: i think you will need to feed a variable, because jquery loops through each node, so: var fullText =''; $('body *').each(function(){ fullText += $(this).text(); }); On Fri, May 2, 2008 at 3:24 PM, Jake McGraw [EMAIL PROTECTED] wrote: ah why not try $(body).text() That should strip all of the markup? - jake On Fri, May 2, 2008 at 8:55 AM, Joe [EMAIL PROTECTED] wrote: Okay I have read and rereadhttp://www.learningjquery.com/2006/11/how-to-get-anything-you-want-pa... and http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-pa... and still cannot figure out how to grab all the text (not the markup) on a page. I am toying with the Google Translation API and am attempting to parse all text, translate, and put it back. I have the looping logic (and the 500 char limit issue with Google) sorted out, but I can't get the fundamental part down...GRABBING ALL THE TEXT. So let's say you have markup like so ul lia href=somelinkblabh blah 1/a/li lia href=somelinkblabh blah 2/a/li lia href=somelinkblabh blah 3/a/li /ul and even h1some heading/h1 and pSome paragraph text/p etc. etc. I want to be able to grab all the text and manipulate it. I've tried $(#mainContainerDiv *).each(...some function), but this crashed the system. I would like to do something like this: $(#mainContainerDiv *.text.each(some function...), but this clearly won't work. Any help is greatly appreciated. -- Alexandre Plennevaux LAb[au] http://www.lab-au.com-Ocultartexto de la cita - - Mostrar texto de la cita - -- Alexandre Plennevaux LAb[au] http://www.lab-au.com- Ocultar texto de la cita - - Mostrar texto de la cita -
[jQuery] Re: Selector Madness! How to Select all the Text on a Page?
Ariel, You are correct. Attempting suggestions now. Thanks guys! Joe On May 2, 8:32 am, Ariel Flesler [EMAIL PROTECTED] wrote: @Jake and @Alexandre He doesn't want the text as a single string, he wants each node so he can replace them. -- Ariel Fleslerhttp://flesler.blogspot.com On 2 mayo, 10:30, Alexandre Plennevaux [EMAIL PROTECTED] wrote: i think you will need to feed a variable, because jquery loops through each node, so: var fullText =''; $('body *').each(function(){ fullText += $(this).text(); }); On Fri, May 2, 2008 at 3:24 PM, Jake McGraw [EMAIL PROTECTED] wrote: ah why not try $(body).text() That should strip all of the markup? - jake On Fri, May 2, 2008 at 8:55 AM, Joe [EMAIL PROTECTED] wrote: Okay I have read and rereadhttp://www.learningjquery.com/2006/11/how-to-get-anything-you-want-pa... and http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-pa... and still cannot figure out how to grab all the text (not the markup) on a page. I am toying with the Google Translation API and am attempting to parse all text, translate, and put it back. I have the looping logic (and the 500 char limit issue with Google) sorted out, but I can't get the fundamental part down...GRABBING ALL THE TEXT. So let's say you have markup like so ul lia href=somelinkblabh blah 1/a/li lia href=somelinkblabh blah 2/a/li lia href=somelinkblabh blah 3/a/li /ul and even h1some heading/h1 and pSome paragraph text/p etc. etc. I want to be able to grab all the text and manipulate it. I've tried $(#mainContainerDiv *).each(...some function), but this crashed the system. I would like to do something like this: $(#mainContainerDiv *.text.each(some function...), but this clearly won't work. Any help is greatly appreciated. -- Alexandre Plennevaux LAb[au] http://www.lab-au.com-Ocultar texto de la cita - - Mostrar texto de la cita -
[jQuery] Re: Selector Madness! How to Select all the Text on a Page?
Ok Im stupid Just use $(div#primarycontentcontainer).animate({fontSize: '+=' + sliderStop}); On May 2, 9:00 am, Joe [EMAIL PROTECTED] wrote: Ariel, You are correct. Attempting suggestions now. Thanks guys! Joe On May 2, 8:32 am, Ariel Flesler [EMAIL PROTECTED] wrote: @Jake and @Alexandre He doesn't want the text as a single string, he wants each node so he can replace them. -- Ariel Fleslerhttp://flesler.blogspot.com On 2 mayo, 10:30, Alexandre Plennevaux [EMAIL PROTECTED] wrote: i think you will need to feed a variable, because jquery loops through each node, so: var fullText =''; $('body *').each(function(){ fullText += $(this).text(); }); On Fri, May 2, 2008 at 3:24 PM, Jake McGraw [EMAIL PROTECTED] wrote: ah why not try $(body).text() That should strip all of the markup? - jake On Fri, May 2, 2008 at 8:55 AM, Joe [EMAIL PROTECTED] wrote: Okay I have read and rereadhttp://www.learningjquery.com/2006/11/how-to-get-anything-you-want-pa... and http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-pa... and still cannot figure out how to grab all the text (not the markup) on a page. I am toying with the Google Translation API and am attempting to parse all text, translate, and put it back. I have the looping logic (and the 500 char limit issue with Google) sorted out, but I can't get the fundamental part down...GRABBING ALL THE TEXT. So let's say you have markup like so ul lia href=somelinkblabh blah 1/a/li lia href=somelinkblabh blah 2/a/li lia href=somelinkblabh blah 3/a/li /ul and even h1some heading/h1 and pSome paragraph text/p etc. etc. I want to be able to grab all the text and manipulate it. I've tried $(#mainContainerDiv *).each(...some function), but this crashed the system. I would like to do something like this: $(#mainContainerDiv *.text.each(some function...), but this clearly won't work. Any help is greatly appreciated. -- Alexandre Plennevaux LAb[au] http://www.lab-au.com-Ocultartexto de la cita - - Mostrar texto de la cita -
[jQuery] Re: Troubling IE problem
I'm not at all offended by the comments. I rarely get offended at people trying to help me. :) On May 1, 5:28 pm, ripple [EMAIL PROTECTED] wrote: It seems like all your doing is an accordion feature from page to page. Why? I went with the accordion effect because the number of links in the navigation gets a bit unwieldy. So hiding some of them accomplishes a couple of things: it focuses the user on the section they're in while leaving the rest available if they want to explore and it reveals the navigation structure if the user hops into the middle of the site without navigating from the top. And it doesn't work at all in IE(6 7). I suspected as much, but only had IE7 to test on. You might want to re-evaluate the script and how your handing it. Just a few comments to ponder on. 1. Using the hover function to highlight a link seems like overkill for scripting. Leave that to css. That's what css is made for. That would remove 8 lines of code. True. I was in scripting mode when I was building and thus mentally finished with the CSS. I'll have a look. 2. Using accordions to go from a page to new page on every click, make's little sense. Accordions are used mostly for containing grouped content and not for navigation controls. 3. Instead of having the script write the images to the page with all the prepend span-image stuff. Have the image as a css background. CSS background images wouldn't be clickable, however. So their purpose as interface elements would be lost. Example: $(this).css('background', 'url(images/blackDownTriangle.png)); 4. Since your using png images your going to run into a problem with IE6. Include pngfix.js or change the images to gif. Not too worried on this score. 1) the non-transparency isn't going to look that bad in IE6, 2) Less than 14% of my traffic comes from IE6 The whole script could really be simplfied into less than half the code it is now. I wouldn't use an accordion for this type of navigation to begin with. How would you approach this type of nav? -- Peter Hentges JBRU
[jQuery] Re: Selector Madness! How to Select all the Text on a Page?
I am having the same kind of problem. I am trying to select all the text inside a content div that has many div, p, a, ect.. all located nested inside the div and I do not want any other text except the text inside the content div. I tried $(*).not(div#printercontrol, div#footer).annimate({fontSize: '+=' + sliderStop}) If I leave out the not() then it works but I want to selected everything but the two divs. From what I read above should I write it like this $ (div#primarycontentcontainer).text().annimate({fontSize: '+=' + sliderStop}) Thanks On May 2, 9:00 am, Joe [EMAIL PROTECTED] wrote: Ariel, You are correct. Attempting suggestions now. Thanks guys! Joe On May 2, 8:32 am, Ariel Flesler [EMAIL PROTECTED] wrote: @Jake and @Alexandre He doesn't want the text as a single string, he wants each node so he can replace them. -- Ariel Fleslerhttp://flesler.blogspot.com On 2 mayo, 10:30, Alexandre Plennevaux [EMAIL PROTECTED] wrote: i think you will need to feed a variable, because jquery loops through each node, so: var fullText =''; $('body *').each(function(){ fullText += $(this).text(); }); On Fri, May 2, 2008 at 3:24 PM, Jake McGraw [EMAIL PROTECTED] wrote: ah why not try $(body).text() That should strip all of the markup? - jake On Fri, May 2, 2008 at 8:55 AM, Joe [EMAIL PROTECTED] wrote: Okay I have read and rereadhttp://www.learningjquery.com/2006/11/how-to-get-anything-you-want-pa... and http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-pa... and still cannot figure out how to grab all the text (not the markup) on a page. I am toying with the Google Translation API and am attempting to parse all text, translate, and put it back. I have the looping logic (and the 500 char limit issue with Google) sorted out, but I can't get the fundamental part down...GRABBING ALL THE TEXT. So let's say you have markup like so ul lia href=somelinkblabh blah 1/a/li lia href=somelinkblabh blah 2/a/li lia href=somelinkblabh blah 3/a/li /ul and even h1some heading/h1 and pSome paragraph text/p etc. etc. I want to be able to grab all the text and manipulate it. I've tried $(#mainContainerDiv *).each(...some function), but this crashed the system. I would like to do something like this: $(#mainContainerDiv *.text.each(some function...), but this clearly won't work. Any help is greatly appreciated. -- Alexandre Plennevaux LAb[au] http://www.lab-au.com-Ocultartexto de la cita - - Mostrar texto de la cita -
[jQuery] Re: async treeview - Can we have a callback method that is invoked when the return status is not 200?
Thanks for the tip. I figured there must be some global method On May 2, 5:21 am, Jörn Zaefferer [EMAIL PROTECTED] wrote: When the return code is an error, the global ajaxError event is triggered. Give that a try. Jörn
[jQuery] Re: Cluetip showing content below fold
ok. there was a problem someone noted a while back between cluetip and the more recent versions of dimensions. I'm sure this is fixed in svn, but don't think it made it into a release yet. would you mind trying the svn version? You can find it here: http://jqueryjs.googlecode.com/svn/trunk/plugins/cluetip/jquery.cluetip.js Thanks for your patience. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On May 2, 2008, at 9:12 AM, sprak wrote: Dimensions is definitely being included. jquery: 1.2.3, minified distribution dimensions: 1.2, minified distribution cluetip: 0.9.6 Tried turning the other libraries off, but that had no effect. I'll see what I can do about hosting the page so it is publically visible. - Luis On May 1, 1:53 pm, Karl Swedberg [EMAIL PROTECTED] wrote: thanks for the info. Another thing you can check is whether you are including the Dimensions plugin. (it's a dependancy.) If it's in there, then the next thing I'd like to know is the version # you're using for jquery core, dimensions, and cluetip. Of course, if you have a page you can show me with the problem, that would be even better. The more information I have regarding your particular situation, the better I can help you. The plugin is already doing the iteration ( return this.each() ), so that shouldn't be relevant. --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com
[jQuery] async treeview - still have problems re-initializing the tree
We're still having problems implementing a 'refresh' button for a treeview tree. We need to be able to re-initialize the tree, clearing out the current version completely, and reloading with data fresh from the server. we're clearing out the current tree with: $('#openExistingTree').empty(); and then re-initializing with $('#openExistingTree').treeview({ url: CalcBldrOpenExisting.ashx }); Each time we hit 'refresh', we're getting a duplicate set of 'hitarea' divs The initial json returned is: [{'text': 'Private Drafts','id': 3, 'hasChildren': true},{'text': 'Shared Drafts','id': 4, 'hasChildren': true},{'text': 'Published Calculations','id': 5, 'hasChildren': true}] Any help would be appreciated. I realize my previous posts came out a bit unreadable... thanks rolf
[jQuery] Re: clone() help
Hi Elle, When the book was published, .clone() didn't have the event-cloning option. That was added in one of the 1.2.x releases. So if you're using a version of jQuery after 1.1.x, you should remove the cloneEvents.js script and try with .clone(true) --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On May 2, 2008, at 4:57 AM, elle wrote: Hi Karl, and thank you for your reply. This didn't really work -- unless I missed something important on the way. I was reading Learning jQuery and it says that .clone() doesn't copy the events related to the cloned items (which I need). It suggested to use copyEvents.js So, I have that script linked and I checked: http://www.learningjquery.com/2007/01/copy-events-from-one-element-to-another but... I still don't get it to work. What is my mistake??? My code now says: ... $(document).ready(function() { $('#orderform').find('.options').hide(); $('#add').one('click', function() { $('.product-template').copyEventsTo('#orderform .product- template'); return false; }); ... Any ideas??? Thanks, Elle On May 2, 12:44 am, Karl Swedberg [EMAIL PROTECTED] wrote: Hi Elle, Here are a few thoughts. Your code: $(#add).click(function() { $(.product-template).clone().appendTo(.product-template:last- child); }); - Do you have this inside a document.ready? $(document).ready(function() { $(#add).click(function() { $(.product-template).clone().appendTo(.product- template:last- child); }); }); - To clone the events along with the DOM elements you can do .clone(true) instead of .clone() - The problem with the click not working could have to do with the :last-child part. I'd change it to :last and also change the insertion method from .appendTo() to .insertAfter() - Probably a good idea to only clone the first .product-template each time. Try something like this: $(document).ready(function() { $(#add).click(function() { $(div.product- template:first).clone(true).insertAfter(div.product- template:last); }); }); Hope that points you in the right direction. --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On May 1, 2008, at 1:53 AM, Waz and Elle wrote: Hi, I'm new to jquery and went over quite a few tutorials -- some work great for me, with no problems at all. But I'm having trouble with the .clone() method. I am trying to build an order form, and have a button#add, which when clicked I want it to add another div.product-template (that includes a select list, options, quantity and add to cart button). So, my code says: http://pastie.caboo.se/189769 but... when I click on the button#add, once nothing happens, second time it adds the .product-template but any functions I had attached to the select list don't work. third click gets rid of my second .product- template. In my document I have: snip ... div#orderform form button#add fieldset#step1 div.product-template rest of options come here fieldset#step2 snip ... Would anyone know how to correct this? TIA, Elle
[jQuery] Re: dimensiosn plugin
i'm sorry i still dotn think i follow entirely. so if i had an div element with an id of item1. and i wanted to get the position of it. the dimensions documentation says i would do: var position = {}; $(#myElement).position(position); so then in this example it should be: $(#item1).position(position); then to access the top position, i woudl do the following? $(#item1).offset().top is that correct? Karl Swedberg-2 wrote: Since it returns an object, you can use either dot notation or bracket notation. So, to get the top position of an element, you could do this ... $(element).offset().top or this ... $(element).offset()['top'] hope that helps. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On May 1, 2008, at 3:56 PM, bdee1 wrote: i am a little unclear on how exactly to get the position of an element using jquery dimensions plugin. documentation says it returns An object with top and left properties that are numbers representing the offset in pixels. and it says the object looks like this: { top: 10, left: 10 } so how do i access it? like a string? do i have to use string functions to pull out the height and width individually? -- View this message in context: http://www.nabble.com/dimensiosn-plugin-tp16995030s27240p16995030.html Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/dimensiosn-plugin-tp16995030s27240p17021373.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] $.ajaxStart bind on a unique element
Hi! I have this: - $(.submit_textarea).livequery(click, function(e){ e.preventDefault(); if($(this).attr(href) == #save) { var savencancel = $(this).parent(); var textarea = $ (this).parents(.imagencap).children(textarea); var caption = textarea.val(); var idimage = textarea.attr(id); idimage_array = idimage.split(-); var maindiv = $(this).parents(.imagencap); $.ajax({ type: POST, url: galleries.php, data: a=jchange- captionid=+idimage_array[1]+caption=+caption, success: function(data){ textarea.hide(slow, function(){ $(this).remove(); }); savencancel.remove(); maindiv.append(p id=+idimage++data+/p); } }); } [ect...] -- and i would to show an image (the loader) only attached to the element that have sended the ajax request (which have a unique id). If i do --- $(.imagencap) .ajaxStart(function(){ }) -- It will binds to all the element on the page... Any help? Thanks!
[jQuery] Re: Cluetip showing content below fold
That did the trick; everything works perfectly now. Thanks! - Luis On May 2, 10:47 am, Karl Swedberg [EMAIL PROTECTED] wrote: ok. there was a problem someone noted a while back between cluetip and the more recent versions of dimensions. I'm sure this is fixed in svn, but don't think it made it into a release yet. would you mind trying the svn version? You can find it here: http://jqueryjs.googlecode.com/svn/trunk/plugins/cluetip/jquery.cluet... Thanks for your patience. --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On May 2, 2008, at 9:12 AM, sprak wrote: Dimensions is definitely being included. jquery: 1.2.3, minified distribution dimensions: 1.2, minified distribution cluetip: 0.9.6 Tried turning the other libraries off, but that had no effect. I'll see what I can do about hosting the page so it is publically visible. - Luis
[jQuery] Re: Hide/Close div when clicked outside of it.
So the other option is to have the wrapper not contain the divLoginBox1 so that clicking inside of divLoginBox1 would not be clicking inside of wrapper. Just be sure to set the z-index on divLoginBox1 higher. On May 2, 4:21 am, Aleksandr [EMAIL PROTECTED] wrote: I was try to do in this way. But it also close div clicking inside of it. So, if I click in wrapper area it close divLoginBox1. But if I clicked divLoginBox1 area it close it also. Should be the way how exclude divLoginBox1 area from wrapper div. This line not help to do it: $(#wrapper).not('#divLoginBox1') On May 1, 10:14 pm, Jimslam [EMAIL PROTECTED] wrote: The Easiest method would be to create a wrapper div that takes up the entire screen and assign an onClick event to that, which would then contain the other div. For example: div id=wrapper div id=divLoginBox1 Login box content /div /div The CSS for the DIV id=wrapper would be something like: #wrapper { position:absolute; height:100%; width: 100%; } Then the JS would be: $(#wrapper').click(function() { $('#divLoginBox1').hide(); }); That should do it. You could leave the #wrapper background transparent or add in some opacity to a background color to emulate a faded effect to the page content. I believe this is similar to how well established libraries like thickbox handle the same functionality. On May 1, 11:14 am, Aleksandr [EMAIL PROTECTED] wrote: Yes you right. Also I have close link inside of the div. Everything is working, only outside click left. On May 1, 3:08 pm, Wes Duff [EMAIL PROTECTED] wrote: Let me see if I have this clear. Once I do I will write you up a script. When someone clicks a link a href=#Show Login Box/a you want to display a div that shows the login box. When someone clicks somewhere else on the screen and not on the link you want to hide the login box? On May 1, 5:08 am, Aleksandr [EMAIL PROTECTED] wrote: I still have the same issue. Yes, I have wrapper div how it can be solved in this case? Thanks On Apr 30, 7:05 pm, Wes Duff [EMAIL PROTECTED] wrote: Off the top of my head --- Try something like this $('div#mydiv').clcik(function(){$('div#mydiv').show();}); //click to show div $('div:not(#mydiv)').click(function(){$('div#mydiv').hide()}); click anywhere else to hide div ## Problem just thought of If you are using a wrapper div then you will have the same problem as before. Well you get the idea. This is just off the top of my head but if it donst work you get the idea. On Apr 30, 11:17 am, Aleksandr [EMAIL PROTECTED] wrote: Hi All, I am showing a div on click of a hyperlink. Now, when i click elsewhere in the document other than the div itself, then i want to hide the showing div... Is there any easy way to do this? I've already try: $('html').click(function() { $('#divLoginBox1').hide(); }); and $('body').click(function() { $('#divLoginBox1').hide(); }); but this close div when clicked inside of it. Thanks, Alex
[jQuery] Re: Giving more parameters to the async load function ?
Thanks Jörn, I will post code here when I get a good solution. However, I know the treeview is being worked on in the UI project as well, should I be looking at something other than treview.asynch to make these changes to? Additionally, I was considering adding a 'custom' persist option, I can provide a patch if you think it would be useful (and assuming it is done generically enough). Probably also going to be looking at adding a 'loading' spinner option, unless it is there and I have just missed it. On Apr 30, 11:42 am, Jörn Zaefferer [EMAIL PROTECTED] wrote: jayg schrieb: I need to set up dynamic urls with async trees as well, though I am using rails, so I am looking for something more like 'foo/bar/1', but same functionality. The problem I have with the idea to use source.php?id=firsttree or something similar is that I don't know how many subtrees I may have - this needs to be built dynamically. If I misunderstood, and this is intended to be dynamic, a code snippet would be greatly helpful. If not, my thought was in the getJSON function of thetreeview.asynch to have _that_ create the url info for the newly returned tree. We already have this.id and could easily return the name of the controller and method to call. Then, at the end when we call $(container).treeview({add:child}), we could insert the url we created into ts setting. I may hack on this until I hear another idea, but let me know what you think of that approach. Ideas, especially in the form of code, are very welcome. The basic problem, dynamic arguments and different URL formats, applies now to bothtreeviewand autocomplete plugins, so solving it properly would help a lot. Jörn
[jQuery] Re: Way to designate links as form submitters?
Well... the original plan was to use the pagination links on the page to submit the form fields. That way a user could change the search options and just continue clicking the pagination links instead of submitting the new options. However, I believe this might be confusing, so I created a Click here link after making option choices to make it clear what the user is supposed to do. And yes, Karl, there's only one form on the page... This solution (it's different than the example submit link I tossed out earlier) is working fine: $(document).ready(function() { $('.submitLink').click(function() { $('form').get(0).submit(); return false; }); }); With a text link like this: pUncheck the boxes above to remove those property types from the listings and click a class=submitLink href=cfoutput#listlast(cgi.script_name, '/')#?pagenumber=#pagenumber#/cfoutputhere/a./p So, up to this point, everything's working well. You can see it in action at: http://c21ar.wsm-dev.com/cfm/browse-properties.cfm Let me know if you have any trouble with it if you decide to check it out. Thanks for all the help! Rick -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of hj Sent: Friday, May 02, 2008 11:45 AM To: jQuery (English) Subject: [jQuery] Re: Way to designate links as form submitters? Anyway to do that? Have certain links, say with an id of link, to be programmed to submit a form when clicked? Why not mark up the links as buttons, or input type=submit elements, and then just use CSS to style them appropriately? -- hj
[jQuery] Re: Troubling IE problem
If you set the image to a background of a link the user wouldn't know any different. They would be attributes of the same element. 14% is still good traffic coming from one browser version. Regardless, it's the difference of looking professional and not. There's a few different ways you could handle the nav without it being an accordion. I quickly came up with this for an example which works on a click. Of course you would have to change some of this to work with the window.location. $(document).ready(function() { $(.navHead ul).hide(); $('#innerLeftNav a').click(function() { $(this).parent().next('ul').show(); $(this).css('background', 'url(http://www.msi.umn.edu/images/ bullet_arrow_down.png) #ffcc33 no-repeat'); return false; }) }); /*** CSS STYLE for above code and html list ul { list-style:none; } .navHead a{ background: url(http://www.msi.umn.edu/images/ bullet_arrow_right.png)no-repeat; padding-left:12px; } On May 2, 10:18 am, JBRU [EMAIL PROTECTED] wrote: I'm not at all offended by the comments. I rarely get offended at people trying to help me. :) On May 1, 5:28 pm, ripple [EMAIL PROTECTED] wrote: It seems like all your doing is an accordion feature from page to page. Why? I went with the accordion effect because the number of links in the navigation gets a bit unwieldy. So hiding some of them accomplishes a couple of things: it focuses the user on the section they're in while leaving the rest available if they want to explore and it reveals the navigation structure if the user hops into the middle of the site without navigating from the top. And it doesn't work at all in IE(6 7). I suspected as much, but only had IE7 to test on. You might want to re-evaluate the script and how your handing it. Just a few comments to ponder on. 1. Using the hover function to highlight a link seems like overkill for scripting. Leave that to css. That's what css is made for. That would remove 8 lines of code. True. I was in scripting mode when I was building and thus mentally finished with the CSS. I'll have a look. 2. Using accordions to go from a page to new page on every click, make's little sense. Accordions are used mostly for containing grouped content and not for navigation controls. 3. Instead of having the script write the images to the page with all the prepend span-image stuff. Have the image as a css background. CSS background images wouldn't be clickable, however. So their purpose as interface elements would be lost. Example: $(this).css('background', 'url(images/blackDownTriangle.png)); 4. Since your using png images your going to run into a problem with IE6. Include pngfix.js or change the images to gif. Not too worried on this score. 1) the non-transparency isn't going to look that bad in IE6, 2) Less than 14% of my traffic comes from IE6 The whole script could really be simplfied into less than half the code it is now. I wouldn't use an accordion for this type of navigation to begin with. How would you approach this type of nav? -- Peter Hentges JBRU
[jQuery] Re: How to stop other elements on the page from dimming
On May 2, 4:32 am, Ariel Flesler [EMAIL PROTECTED] wrote: Why is my screen going dark when using fadeOut ? For me, it is not really a case of going dark, but more of a ... elements outside of the fade are being affected (flickering?) during the fade ... So, I just tried this: body { -moz-opacity: 0.; } And it works great, but with one big problem... The swfObject embeded element on my page disappeared. I am using Firefox 2.0.0.12 and SlideShowPro: div id=ssp pThis SlideShowPro photo gallery requires the Flash Player plugin and a web browser with JavaScript enabled./p /div !-- /#ssp -- script type=text/javascript var ssp_so = new SWFObject(http://www.site.com/slideshowpro.swf;, mediaplayer, 630px, 350px, 9, #FF); ssp_so.addVariable(xmlfile, http://www.site.com/images.php? album=3); ssp_so.addParam(quality, best); ssp_so.addParam(base, .); ssp_so.addParam(wmode, opaque); ssp_so.write(ssp); /script When I removed the wmode param, it kinda worked, but there was major redraw problems. I guess I can live with the FF bug for now.
[jQuery] Re: Giving more parameters to the async load function ?
Maybe a callback function (given some usefull context parameters..) which produces the url could do the trick.. On 2 Mai, 17:24, jayg [EMAIL PROTECTED] wrote: Thanks Jörn, I will post code here when I get a good solution. However, I know the treeview is being worked on in the UI project as well, should I be looking at something other than treview.asynch to make these changes to? Additionally, I was considering adding a 'custom' persist option, I can provide a patch if you think it would be useful (and assuming it is done generically enough). Probably also going to be looking at adding a 'loading' spinner option, unless it is there and I have just missed it. On Apr 30, 11:42 am, Jörn Zaefferer [EMAIL PROTECTED] wrote: jayg schrieb: I need to set up dynamic urls with async trees as well, though I am using rails, so I am looking for something more like 'foo/bar/1', but same functionality. The problem I have with the idea to use source.php?id=firsttree or something similar is that I don't know how many subtrees I may have - this needs to be built dynamically. If I misunderstood, and this is intended to be dynamic, a code snippet would be greatly helpful. If not, my thought was in the getJSON function of thetreeview.asynch to have _that_ create the url info for the newly returned tree. We already have this.id and could easily return the name of the controller and method to call. Then, at the end when we call $(container).treeview({add:child}), we could insert the url we created into ts setting. I may hack on this until I hear another idea, but let me know what you think of that approach. Ideas, especially in the form of code, are very welcome. The basic problem, dynamic arguments and different URL formats, applies now to bothtreeviewand autocomplete plugins, so solving it properly would help a lot. Jörn
[jQuery] Re: Hide/Close div when clicked outside of it.
z-index of divLoginBox1 is higher than wrapper div. On May 2, 3:52 pm, Jimslam [EMAIL PROTECTED] wrote: So the other option is to have the wrapper not contain the divLoginBox1 so that clicking inside of divLoginBox1 would not be clicking inside of wrapper. Just be sure to set the z-index on divLoginBox1 higher. On May 2, 4:21 am, Aleksandr [EMAIL PROTECTED] wrote: I was try to do in this way. But it also close div clicking inside of it. So, if I click in wrapper area it close divLoginBox1. But if I clicked divLoginBox1 area it close it also. Should be the way how exclude divLoginBox1 area from wrapper div. This line not help to do it: $(#wrapper).not('#divLoginBox1') On May 1, 10:14 pm, Jimslam [EMAIL PROTECTED] wrote: The Easiest method would be to create a wrapper div that takes up the entire screen and assign an onClick event to that, which would then contain the other div. For example: div id=wrapper div id=divLoginBox1 Login box content /div /div The CSS for the DIV id=wrapper would be something like: #wrapper { position:absolute; height:100%; width: 100%; } Then the JS would be: $(#wrapper').click(function() { $('#divLoginBox1').hide(); }); That should do it. You could leave the #wrapper background transparent or add in some opacity to a background color to emulate a faded effect to the page content. I believe this is similar to how well established libraries like thickbox handle the same functionality. On May 1, 11:14 am, Aleksandr [EMAIL PROTECTED] wrote: Yes you right. Also I have close link inside of the div. Everything is working, only outside click left. On May 1, 3:08 pm, Wes Duff [EMAIL PROTECTED] wrote: Let me see if I have this clear. Once I do I will write you up a script. When someone clicks a link a href=#Show Login Box/a you want to display a div that shows the login box. When someone clicks somewhere else on the screen and not on the link you want to hide the login box? On May 1, 5:08 am, Aleksandr [EMAIL PROTECTED] wrote: I still have the same issue. Yes, I have wrapper div how it can be solved in this case? Thanks On Apr 30, 7:05 pm, Wes Duff [EMAIL PROTECTED] wrote: Off the top of my head --- Try something like this $('div#mydiv').clcik(function(){$('div#mydiv').show();}); //click to show div $('div:not(#mydiv)').click(function(){$('div#mydiv').hide()}); click anywhere else to hide div ## Problem just thought of If you are using a wrapper div then you will have the same problem as before. Well you get the idea. This is just off the top of my head but if it donst work you get the idea. On Apr 30, 11:17 am, Aleksandr [EMAIL PROTECTED] wrote: Hi All, I am showing a div on click of a hyperlink. Now, when i click elsewhere in the document other than the div itself, then i want to hide the showing div... Is there any easy way to do this? I've already try: $('html').click(function() { $('#divLoginBox1').hide(); }); and $('body').click(function() { $('#divLoginBox1').hide(); }); but this close div when clicked inside of it. Thanks, Alex
[jQuery] Re: event trigger doesnt work ?
I'm not sure that jQuery picks up on events that weren't assigned through jQuery... Maybe it does but I've only been using it as unobtrusive javascript and so haven't tried to trigger an event that I didn't bind through jQuery yet. Try this and see if it doesn't work for you instead: $(document).ready( function() { $(#myname).blur( function() { dosomething(this.value); }); }); Then your call to $(#myname).trigger('blur'); should work, or just abbreviate it and use $(#myname).blur(); instead. HTH! On May 1, 7:23 pm, Adwin Wijaya [EMAIL PROTECTED] wrote: I have a field with onblur function like this input type='text' name='myname' id='myname' value='' onblur='dosomething(this.value);'/ and then in a button i put $('#myname').trigger('blur'); ... it seems the trigger wont call dosomething when i call $ ('#myname').trigger('blur');
[jQuery] Re: Way to designate links as form submitters?
Anyway to do that? Have certain links, say with an id of link, to be programmed to submit a form when clicked? Why not mark up the links as buttons, or input type=submit elements, and then just use CSS to style them appropriately? -- hj
[jQuery] tablesorter
I'm working with tablesorter and I have multiple tables. I made it so when a button is pushed all the data from one table is put into one main table, basically doing this: $(SourceTable).find(tbody tr).appendTo($ (TargetTable).find(tbody)); $(TargetTable).trigger(update); This kind of works, all the rows get placed into the target table but when I trigger the update I get an error: table.config has no properties jquery.tablesorter.js line 136 I suspect the rows might have something bound to the old table which I'm destroying, so I think I have to disable tablesorter on the source tables before moving the rows but I can't figure out how to do this. Anyone have any ideas? -Scott
[jQuery] looking for simple AIR-jquery ajax example
Hi All, I'm looking for a code example (or tutorial or working app with source) that shows how to use jquery-fired ajax calls in an Adobe AIR application, preferably showing how to do things in the Application Sandbox and the Non-Application sandbox. To clarify, I'm not looking for examples of how to use the AIR-native functions to make AJAX calls, I want examples using jquery's implementation (I have an app with a lot of jquery in it that I want to port to AIR). Any recommendations? TIA, Jack
[jQuery] jQuery Corner no longer works in Safari 3.1
In previous versions this could be fixed by setting a background-color on a parent node, but in recent versions (WebKit nightly too) it no longer works.
[jQuery] Re: looking for simple AIR-jquery ajax example
Jack... There's absolutely no difference in making an AJAX call via traditional browser based app vs an AIR app. I just completed a sort of one-way messaging app written in HTML/jQuery and it couldn't have been easier. Hit me up offlist and I'll be happy to provide code samples. andy -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jack Killpatrick Sent: Friday, May 02, 2008 12:17 PM To: jquery-en@googlegroups.com Subject: [jQuery] looking for simple AIR-jquery ajax example Hi All, I'm looking for a code example (or tutorial or working app with source) that shows how to use jquery-fired ajax calls in an Adobe AIR application, preferably showing how to do things in the Application Sandbox and the Non-Application sandbox. To clarify, I'm not looking for examples of how to use the AIR-native functions to make AJAX calls, I want examples using jquery's implementation (I have an app with a lot of jquery in it that I want to port to AIR). Any recommendations? TIA, Jack
[jQuery] Re: looking for simple AIR-jquery ajax example
Andy, I'll very happy if you could send that code samples to me. Marco Antonio On Fri, May 2, 2008 at 2:20 PM, Andy Matthews [EMAIL PROTECTED] wrote: Jack... There's absolutely no difference in making an AJAX call via traditional browser based app vs an AIR app. I just completed a sort of one-way messaging app written in HTML/jQuery and it couldn't have been easier. Hit me up offlist and I'll be happy to provide code samples. andy -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jack Killpatrick Sent: Friday, May 02, 2008 12:17 PM To: jquery-en@googlegroups.com Subject: [jQuery] looking for simple AIR-jquery ajax example Hi All, I'm looking for a code example (or tutorial or working app with source) that shows how to use jquery-fired ajax calls in an Adobe AIR application, preferably showing how to do things in the Application Sandbox and the Non-Application sandbox. To clarify, I'm not looking for examples of how to use the AIR-native functions to make AJAX calls, I want examples using jquery's implementation (I have an app with a lot of jquery in it that I want to port to AIR). Any recommendations? TIA, Jack
[jQuery] Re: Hide/Close div when clicked outside of it.
try this $('#divLoginBox1').click(function(e) { e.stopPropagation(); }); $(document).click(function() { $('#divLoginBox1').hide(); }); --dave
[jQuery] JSON generated by php not parsed in IE
Hi I am going crazy on this. This is first time I tried to use JSON for the data I need and I have a php function that generates the data. While FF etc are showing the output the IE fails to go beyond the $.each to iterate over the JSON array. this is the data generated by PHP function {items:[{col: col1,id: 1,mod_title : yahoo_latest,mod_ct : 0,mod_code: http://rss .news.yahoo.com/rss/topstories},{col: col1,id: 2,mod_title : yahoo_business,mod_ct : 0 ,mod_code: http://rss.news.yahoo.com/rss/business},{col: col2,id: 3,mod_title : yahoo_world ,mod_ct : 0,mod_code: http://rss.news.yahoo.com/rss/world}, {col: col2,id: 4,mod_title : yahoo_entertainment,mod_ct : 0,mod_code: http:// rss.news.yahoo.com/rss/entertainment},{col : col3,id: 24,mod_title : bbc,mod_ct : 6,mod_code: http://newsrss.bbc.co.uk/rss/newsonline_world_edition /asia-pacific/rss.xml}]} and this is how I call $.JSON $.getJSON(/aj_drdp.php,{doq:getcol},function(data){ $.each(data.items, function(i,item){ alert(I am here); . . . . . . }) }) I don't get it. Seems like something basic I am unaware of with JSON but even after searching for hours I have not been able to show the data in IE. The alert also does not come up in IE which means it is not parsing the JSON to begin with. I have checked the JSON data again and again and it does not have any error. I even tried to use some other JSON data to see it it works but nope. Seems like IE does not like the data generated with PHP but how is that possible. Anyways I am totally out of sanity over it. Can please someone show me some light? thanks Vik
[jQuery] Re: event binding on dynamically created elements? stumped
Ah, yes, livequery looks nice. Thanks. I'm really trying to get away without any plugins however. Is livequery the only option for binding events to ajax-loaded DOM elements? All the suggestions so far would require the event handler to reside inside the function that loads the new DOM element. Thanks.
[jQuery] Re: event binding on dynamically created elements? stumped
http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_Ajax_request.3F -- Ariel Flesler http://flesler.blogspot.com On 2 mayo, 14:42, jquertil [EMAIL PROTECTED] wrote: Ah, yes, livequery looks nice. Thanks. I'm really trying to get away without any plugins however. Is livequery the only option for binding events to ajax-loaded DOM elements? All the suggestions so far would require the event handler to reside inside the function that loads the new DOM element. Thanks.
[jQuery] Re: event binding on dynamically created elements? stumped
I agree with not wanting to add another plugin. Any time when you introduce new content to a page, that content does not have the characteristics as the content at load time. Have you tried putting your bindings into a function and calling that function when you need to. function bind() { $('.focusClear').focus(function(){ $(this).val(''); }); } bind(); Now you can use that when you need to, by just calling the function. You can put bind() into the ready function and any place in your code when introducing some new objects to the document. This has worked for me on many occasions. Actually it has worked on all occasions and saves another script from having to download. 37k plugin reduced to 1k. On May 2, 1:50 pm, Ariel Flesler [EMAIL PROTECTED] wrote: http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_st... -- Ariel Fleslerhttp://flesler.blogspot.com On 2 mayo, 14:42, jquertil [EMAIL PROTECTED] wrote: Ah, yes, livequery looks nice. Thanks. I'm really trying to get away without any plugins however. Is livequery the only option for binding events to ajax-loaded DOM elements? All the suggestions so far would require the event handler to reside inside the function that loads the new DOM element. Thanks.
[jQuery] Re: Cluetip showing content below fold
excellent! so glad to hear it. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On May 2, 2008, at 11:23 AM, sprak wrote: That did the trick; everything works perfectly now. Thanks! - Luis On May 2, 10:47 am, Karl Swedberg [EMAIL PROTECTED] wrote: ok. there was a problem someone noted a while back between cluetip and the more recent versions of dimensions. I'm sure this is fixed in svn, but don't think it made it into a release yet. would you mind trying the svn version? You can find it here: http://jqueryjs.googlecode.com/svn/trunk/plugins/cluetip/ jquery.cluet... Thanks for your patience. --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On May 2, 2008, at 9:12 AM, sprak wrote: Dimensions is definitely being included. jquery: 1.2.3, minified distribution dimensions: 1.2, minified distribution cluetip: 0.9.6 Tried turning the other libraries off, but that had no effect. I'll see what I can do about hosting the page so it is publically visible. - Luis
[jQuery] adding a callback function?
Hello everyone. I am trying to modify the SpinButton code (from here http://www.softwareunity.com/sandbox/jqueryspinbtn/) to include a callback when the value is changed. I'm very new to callback functions and have tried searching the web for how to add them but so far have had no luck. My desired goal is to be able to pass a function or not and if the function is included have it executed when the spinner button is clicked. Here is what I have tried (along with the original code): $.fn.SpinButton = function(cfg){ return this.each(function(){ // Apply specified options or defaults: // (Ought to refactor this some day to use $.extend() instead) this.spinCfg = { //min: cfg cfg.min ? Number(cfg.min) : null, //max: cfg cfg.max ? Number(cfg.max) : null, min: cfg !isNaN(parseFloat(cfg.min)) ? Number(cfg.min) : null, // Fixes bug with min:0 max: cfg !isNaN(parseFloat(cfg.max)) ? Number(cfg.max) : null, step: cfg cfg.step ? Number(cfg.step) : 1, page: cfg cfg.page ? Number(cfg.page) : 10, upClass: cfg cfg.upClass ? cfg.upClass : 'up', downClass: cfg cfg.downClass ? cfg.downClass : 'down', reset: cfg cfg.reset ? cfg.reset : this.value, delay: cfg cfg.delay ? Number(cfg.delay) : 500, interval: cfg cfg.interval ? Number(cfg.interval) : 100, _btn_width: 20, _btn_height: 12, _direction: null, _delay: null, _repeat: null, callback: function(){} /* I added this*/ }; this.adjustValue = function(i){ var v = (isNaN(this.value) ? this.spinCfg.reset : Number(this.value)) + Number(i); if (this.spinCfg.min !== null) v = Math.max(v, this.spinCfg.min); if (this.spinCfg.max !== null) v = Math.min(v, this.spinCfg.max); callback(); /* I added this) this.value = v; }; when trying to run this I get callback is not defined. Any help is greatly appreciated!!!
[jQuery] Problem with logging form using the 'jQuery Form Plugin'
Good evening, I'm trying to code a logging form, but I have a problem redirecting the user to another page. The problem is that the page I want to redirect to is being loaded in the background, like it was an Ajax call (I've seen it thanks to the Firefox plugin Tamper Data). That's the code I'm using: $(document).ready(function() { var options = { beforeSubmit: ValidateForm, success: Logging, dataType: 'json' }; $('#login').submit(function() { $(this).ajaxSubmit(options); return false; }); }); function Logging(data) { if(data.login != true) window.location = user.html; //This page is loaded as an Ajax call and isn't shown else ShowError(Username or password incorrect); return false; } Hope someone will know how to fix it or a better way to do it. Thank you very much! Dani
[jQuery] Re: Hide/Close div when clicked outside of it.
I am now have this jQuery code and it is working in FireFox, Safari and Opera but not in IE 6, 7: $(document).ready(function(){ $(#link).click(function(){ if ($(#divLoginBox1).is(':hidden')) $(#divLoginBox1).show(); else{ $(#divLoginBox1).hide(); } return false; }) $('#divLoginBox1').click(function(e) { e.stopPropagation(); }); $(document).click(function() { $('#divLoginBox1').hide(); }); }); On May 2, 6:00 pm, sawmac [EMAIL PROTECTED] wrote: try this $('#divLoginBox1').click(function(e) { e.stopPropagation();}); $(document).click(function() { $('#divLoginBox1').hide(); }); --dave
[jQuery] Re: event binding on dynamically created elements? stumped
You can put the event handler anywhere you want if it doesn't have to be an anonymous function. Here's the example I gave modified: // put this in your ready block $j('input type=text name=symptom value=Enter Symptom class=focusClear/').insertAfter(this).focus(focusEventHandler); // put this wherever you want function focusEventHandler() { $(this).val(''); } Is there some other restriction you have that isn't obvious? Is there some reason why you don't want to actually bind the control until later? On May 2, 10:42 am, jquertil [EMAIL PROTECTED] wrote: Ah, yes, livequery looks nice. Thanks. I'm really trying to get away without any plugins however. Is livequery the only option for binding events to ajax-loaded DOM elements? All the suggestions so far would require the event handler to reside inside the function that loads the new DOM element. Thanks.
[jQuery] Re: looking for simple AIR-jquery ajax example
Sure thing...here's a method I'm using to log a user in from my app: submitLogin: function (u,p) { /* * submits login credentials to the server for verification */ $.ajax({ url: URL + 'method=authenticate', cache: false, data:{ username: Base64.encode(u), password: Base64.encode(p) }, datatype: 'xml', success: function(data){ $(data).find(string).each(function() { // store a reference to the first index in the returned array, // the only index at this point. var userInfo = eval($(this).text())[0]; // determine if the user has a valid login if (userInfo.isValidLogin) { // they do have a valid login, so we fire the valid login event // fire the submitLoginDataReturned event, // listened for by core.js. Return the userInfo object $(document).trigger('submitLoginDataValid',userInfo); } else { // their login is incorrect, so throw the invalid login event $(document).trigger('submitLoginDataInvalid',userInfo); } }); } }) } _ From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Web Specialist Sent: Friday, May 02, 2008 12:28 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: looking for simple AIR-jquery ajax example Andy, I'll very happy if you could send that code samples to me. Marco Antonio On Fri, May 2, 2008 at 2:20 PM, Andy Matthews [EMAIL PROTECTED] wrote: Jack... There's absolutely no difference in making an AJAX call via traditional browser based app vs an AIR app. I just completed a sort of one-way messaging app written in HTML/jQuery and it couldn't have been easier. Hit me up offlist and I'll be happy to provide code samples. andy -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jack Killpatrick Sent: Friday, May 02, 2008 12:17 PM To: jquery-en@googlegroups.com Subject: [jQuery] looking for simple AIR-jquery ajax example Hi All, I'm looking for a code example (or tutorial or working app with source) that shows how to use jquery-fired ajax calls in an Adobe AIR application, preferably showing how to do things in the Application Sandbox and the Non-Application sandbox. To clarify, I'm not looking for examples of how to use the AIR-native functions to make AJAX calls, I want examples using jquery's implementation (I have an app with a lot of jquery in it that I want to port to AIR). Any recommendations? TIA, Jack
[jQuery] Re: Hide/Close div when clicked outside of it.
Looks like you are missing a semicolon which will choke IE: $(#link).click(function(){ if ($(#divLoginBox1).is(':hidden')) $(#divLoginBox1).show(); else{ $(#divLoginBox1).hide(); } return false; }) -- ADD SEMICOLON HERE -- Josh - Original Message - From: Aleksandr [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Friday, May 02, 2008 11:00 AM Subject: [jQuery] Re: Hide/Close div when clicked outside of it. I am now have this jQuery code and it is working in FireFox, Safari and Opera but not in IE 6, 7: $(document).ready(function(){ $(#link).click(function(){ if ($(#divLoginBox1).is(':hidden')) $(#divLoginBox1).show(); else{ $(#divLoginBox1).hide(); } return false; }) $('#divLoginBox1').click(function(e) { e.stopPropagation(); }); $(document).click(function() { $('#divLoginBox1').hide(); }); }); On May 2, 6:00 pm, sawmac [EMAIL PROTECTED] wrote: try this $('#divLoginBox1').click(function(e) { e.stopPropagation();}); $(document).click(function() { $('#divLoginBox1').hide(); }); --dave
[jQuery] [PLUGIN] Excellent File Tree
Thanks to Karl Swedberg for pointing this jQuery-based File Tree out. http://abeautifulsite.net/notebook.php?article=58 Rey
[jQuery] Re: looking for simple AIR-jquery ajax example
Thanks Andy. Is this living in the AIR application sandbox or the non-application sandbox? I need to do some sandboxing on my app, because I want to use some native AIR stuff, but ideally have my sandboxed js be pretty much the same as the js that is used in my standard (non-AIR) web app, so I'm trying to figure out a good design approach (for organizing the code). - Jack Andy Matthews wrote: Sure thing...here's a method I'm using to log a user in from my app: submitLogin: function (u,p) { /* * submits login credentials to the server for verification */ $.ajax({ url: URL + 'method=authenticate', cache: false, data:{ username: Base64.encode(u), password: Base64.encode(p) }, datatype: 'xml', success: function(data){ $(data).find(string).each(function() { // store a reference to the first index in the returned array, // the only index at this point. var userInfo = eval($(this).text())[0]; // determine if the user has a valid login if (userInfo.isValidLogin) { // they do have a valid login, so we fire the valid login event // fire the submitLoginDataReturned event, // listened for by core.js. Return the userInfo object $(document).trigger('submitLoginDataValid',userInfo); } else { // their login is incorrect, so throw the invalid login event $(document).trigger('submitLoginDataInvalid',userInfo); } }); } }) } *From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Web Specialist *Sent:* Friday, May 02, 2008 12:28 PM *To:* jquery-en@googlegroups.com *Subject:* [jQuery] Re: looking for simple AIR-jquery ajax example Andy, I'll very happy if you could send that code samples to me. Marco Antonio On Fri, May 2, 2008 at 2:20 PM, Andy Matthews [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Jack... There's absolutely no difference in making an AJAX call via traditional browser based app vs an AIR app. I just completed a sort of one-way messaging app written in HTML/jQuery and it couldn't have been easier. Hit me up offlist and I'll be happy to provide code samples. andy -Original Message- From: jquery-en@googlegroups.com mailto:jquery-en@googlegroups.com [mailto:jquery-en@googlegroups.com mailto:jquery-en@googlegroups.com] On Behalf Of Jack Killpatrick Sent: Friday, May 02, 2008 12:17 PM To: jquery-en@googlegroups.com mailto:jquery-en@googlegroups.com Subject: [jQuery] looking for simple AIR-jquery ajax example Hi All, I'm looking for a code example (or tutorial or working app with source) that shows how to use jquery-fired ajax calls in an Adobe AIR application, preferably showing how to do things in the Application Sandbox and the Non-Application sandbox. To clarify, I'm not looking for examples of how to use the AIR-native functions to make AJAX calls, I want examples using jquery's implementation (I have an app with a lot of jquery in it that I want to port to AIR). Any recommendations? TIA, Jack
[jQuery] Re: looking for simple AIR-jquery ajax example
I'm not implementing the sandbox explicitly, so whatever that ends up being. This is an internal only app so I wasn't as worried about security as I normally would be. _ From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jack Killpatrick Sent: Friday, May 02, 2008 1:53 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: looking for simple AIR-jquery ajax example Thanks Andy. Is this living in the AIR application sandbox or the non-application sandbox? I need to do some sandboxing on my app, because I want to use some native AIR stuff, but ideally have my sandboxed js be pretty much the same as the js that is used in my standard (non-AIR) web app, so I'm trying to figure out a good design approach (for organizing the code). - Jack Andy Matthews wrote: Sure thing...here's a method I'm using to log a user in from my app: submitLogin: function (u,p) { /* * submits login credentials to the server for verification */ $.ajax({ url: URL + 'method=authenticate', cache: false, data:{ username: Base64.encode(u), password: Base64.encode(p) }, datatype: 'xml', success: function(data){ $(data).find(string).each(function() { // store a reference to the first index in the returned array, // the only index at this point. var userInfo = eval($(this).text())[0]; // determine if the user has a valid login if (userInfo.isValidLogin) { // they do have a valid login, so we fire the valid login event // fire the submitLoginDataReturned event, // listened for by core.js. Return the userInfo object $(document).trigger('submitLoginDataValid',userInfo); } else { // their login is incorrect, so throw the invalid login event $(document).trigger('submitLoginDataInvalid',userInfo); } }); } }) } _ From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Web Specialist Sent: Friday, May 02, 2008 12:28 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: looking for simple AIR-jquery ajax example Andy, I'll very happy if you could send that code samples to me. Marco Antonio On Fri, May 2, 2008 at 2:20 PM, Andy Matthews [EMAIL PROTECTED] wrote: Jack... There's absolutely no difference in making an AJAX call via traditional browser based app vs an AIR app. I just completed a sort of one-way messaging app written in HTML/jQuery and it couldn't have been easier. Hit me up offlist and I'll be happy to provide code samples. andy -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jack Killpatrick Sent: Friday, May 02, 2008 12:17 PM To: jquery-en@googlegroups.com Subject: [jQuery] looking for simple AIR-jquery ajax example Hi All, I'm looking for a code example (or tutorial or working app with source) that shows how to use jquery-fired ajax calls in an Adobe AIR application, preferably showing how to do things in the Application Sandbox and the Non-Application sandbox. To clarify, I'm not looking for examples of how to use the AIR-native functions to make AJAX calls, I want examples using jquery's implementation (I have an app with a lot of jquery in it that I want to port to AIR). Any recommendations? TIA, Jack
[jQuery] Re: Hide/Close div when clicked outside of it.
Everything is working now. Thanks to all. Last version of code is: $(document).ready(function(){ $(#link).click(function(){ if ($(#divLoginBox1).is(':hidden')) $(#divLoginBox1).show(); else{ $(#divLoginBox1).hide(); } return false; }); $('#divLoginBox1').click(function(e) { e.stopPropagation(); }); $(document).click(function() { $('#divLoginBox1').hide(); }); }); On May 2, 7:29 pm, Josh Nathanson [EMAIL PROTECTED] wrote: Looks like you are missing a semicolon which will choke IE: $(#link).click(function(){ if ($(#divLoginBox1).is(':hidden')) $(#divLoginBox1).show(); else{ $(#divLoginBox1).hide(); } return false; }) -- ADD SEMICOLON HERE -- Josh - Original Message - From: Aleksandr [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Friday, May 02, 2008 11:00 AM Subject: [jQuery] Re: Hide/Close div when clicked outside of it. I am now have this jQuery code and it is working in FireFox, Safari and Opera but not in IE 6, 7: $(document).ready(function(){ $(#link).click(function(){ if ($(#divLoginBox1).is(':hidden')) $(#divLoginBox1).show(); else{ $(#divLoginBox1).hide(); } return false; }) $('#divLoginBox1').click(function(e) { e.stopPropagation(); }); $(document).click(function() { $('#divLoginBox1').hide(); }); }); On May 2, 6:00 pm, sawmac [EMAIL PROTECTED] wrote: try this $('#divLoginBox1').click(function(e) { e.stopPropagation();}); $(document).click(function() { $('#divLoginBox1').hide(); }); --dave
[jQuery] How do I cancel event helpers?
I have attached the hover event to a div element and it works fine. But how do I dynamically remove and add it again? Once it's working I cant seem to find a way in javascript to stop it again. I've tried calling 'hover' again on the same element with empty function callbacks, but it doesn't seem to have any effect. thanks.
[jQuery] jQ implementation of CSS3 text-align-last property?
So, I got it in my head that I wanted to use this effect today, which is, of course, not supported by any browser. I was curious if anyone's mashed together a scripted implementation. Spec details here: http://www.w3.org/TR/2001/WD-css3-text-20010517/#last-line-alignment-prop or at css3.com: http://www.css3.com/css-text-align-last/ Unfortunately, I have a vague suspicion this may just not be possible. If it is, though, I am not above bribing with beer/books/money.
[jQuery] Help with selecting great grandchildren
Below is my html/EE code: pre div class=less-info !-- Standard configuration -- !-- Show more button -- span class=show-more{lang_showmoreinfo}/span !-- Standard configuration tab -- span class=tab{lang_standardconfigurations}/span !-- Parts list -- ul class=part-detail-box {related_entries id=cf_products_parts} !-- loop -- li class=line-item !-- Part number - floated right -- span class=part-number{cf_parts_partnumber}/span !-- Part title - aligned left -- {cf_parts_title} {if cf_parts_desc} div class=line-item-detail {cf_parts_desc} /div {/if} /li {/related_entries} !-- end loop -- /ul !-- part-detail-box -- /div !-- less-info -- /pre What I want is for the user to click the span.show-more and have it toggle show/hide all li.line-item's within its own parent (div.less- info). I tried all types of stuff. I can get the parent to show/ hide, so I can get that far. From there I need to get to all child li.line-items. Here is what i stopped with, which I know is incorrect snce children() only selects direct children: pre //toggle the display of the individual product details $(.show-more).toggle( function() { $(this).parent().children(.line-item).show(); }, function() { $(this).parent().children(.line-item).hide(); } ); /pre
[jQuery] Re: [PLUGIN] Excellent File Tree
Looks very well. Hoping that someone will include sorting ;-) Rey Bango wrote: Thanks to Karl Swedberg for pointing this jQuery-based File Tree out. http://abeautifulsite.net/notebook.php?article=58 Rey
[jQuery] Re: IE 6 double submit
I see. Thanks for explain it clearly. I was confused by the ajaxForm documentation. -- View this message in context: http://www.nabble.com/IE-6-double-submit-tp16964708s27240p17026592.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: clone() help
Hi KArl, I didn't know that. Will try again. Elle On May 3, 2:43 am, Karl Swedberg [EMAIL PROTECTED] wrote: Hi Elle, When the book was published, .clone() didn't have the event-cloning option. That was added in one of the 1.2.x releases. So if you're using a version of jQuery after 1.1.x, you should remove the cloneEvents.js script and try with .clone(true) --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On May 2, 2008, at 4:57 AM, elle wrote: Hi Karl, and thank you for your reply. This didn't really work -- unless I missed something important on the way. I was reading Learning jQuery and it says that .clone() doesn't copy the events related to the cloned items (which I need). It suggested to use copyEvents.js So, I have that script linked and I checked: http://www.learningjquery.com/2007/01/copy-events-from-one-element-to... but... I still don't get it to work. What is my mistake??? My code now says: ... $(document).ready(function() { $('#orderform').find('.options').hide(); $('#add').one('click', function() { $('.product-template').copyEventsTo('#orderform .product- template'); return false; }); ... Any ideas??? Thanks, Elle On May 2, 12:44 am, Karl Swedberg [EMAIL PROTECTED] wrote: Hi Elle, Here are a few thoughts. Your code: $(#add).click(function() { $(.product-template).clone().appendTo(.product-template:last- child); }); - Do you have this inside a document.ready? $(document).ready(function() { $(#add).click(function() { $(.product-template).clone().appendTo(.product- template:last- child); }); }); - To clone the events along with the DOM elements you can do .clone(true) instead of .clone() - The problem with the click not working could have to do with the :last-child part. I'd change it to :last and also change the insertion method from .appendTo() to .insertAfter() - Probably a good idea to only clone the first .product-template each time. Try something like this: $(document).ready(function() { $(#add).click(function() { $(div.product- template:first).clone(true).insertAfter(div.product- template:last); }); }); Hope that points you in the right direction. --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On May 1, 2008, at 1:53 AM, Waz and Elle wrote: Hi, I'm new to jquery and went over quite a few tutorials -- some work great for me, with no problems at all. But I'm having trouble with the .clone() method. I am trying to build an order form, and have a button#add, which when clicked I want it to add another div.product-template (that includes a select list, options, quantity and add to cart button). So, my code says: http://pastie.caboo.se/189769 but... when I click on the button#add, once nothing happens, second time it adds the .product-template but any functions I had attached to the select list don't work. third click gets rid of my second .product- template. In my document I have: snip ... div#orderform form button#add fieldset#step1 div.product-template rest of options come here fieldset#step2 snip ... Would anyone know how to correct this? TIA, Elle
[jQuery] Re: Ajax .click function after .get
Come on, be nice to noobies even if you have seen the same question asked over and over. Everyone has to get started somewhere and what you're referring to isn't even in the API reference where I would look first for answers (and where search takes you if you type events), its in the FAQ. It might be nice if that FAQ was linked to from the Events documentation page, preferably at the top next to the link for Events (Guide) and maybe fewer people would be asking all the time. On May 2, 6:20 am, Ariel Flesler [EMAIL PROTECTED] wrote: Always read the docs first. http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_st... -- Ariel Fleslerhttp://flesler.blogspot.com On 1 mayo, 23:01, betomurcia [EMAIL PROTECTED] wrote: Hello guys I am just starting to play with and learn jquery. I have come to some problems and were able to solve them. I think that its something obvious that i am missing in the .get() I am trying to create a page that will never refresh so for the navigation bar i decided to use the ajax .get function to change the innerhtml of a special div tag. But when i do that the new content that is in the html does not seem to work with my jquery rules that i have $(a[href^=#]).not(.point).click(function(){ $(#main).html('div id=loadingLoading Contentbr /img src=images/loader.gif alt=Loading//div'); $.get(ajaxreader.php?idpage=+$(this).attr(id),function(data){ $(#main).html(data); }); }); the links inside the html that get changed are also href=#something so they should work but they don't. Any help or tips will be appreciated? If you have a better way to do refreshless sites using jquery can you please tell me? Thanks in advance
[jQuery] Re: Excellent File Tree
I'll second that. I just implemented this control in our system (rollout was last night). Next step is drag-and-drop sorting for folders. Hoping somebody else will write it before I have to! On May 2, 2:45 pm, Snef [EMAIL PROTECTED] wrote: Looks very well. Hoping that someone will include sorting ;-) Rey Bango wrote: Thanks to Karl Swedberg for pointing this jQuery-based File Tree out. http://abeautifulsite.net/notebook.php?article=58 Rey
[jQuery] Re: How do I cancel event helpers?
Here's some info on how event binding works in jQuery: http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_Ajax_request.3F But specifically you can use .hover() and .unbind(hover) on your element to bind and unbind. On May 2, 11:41 am, jr [EMAIL PROTECTED] wrote: I have attached the hover event to a div element and it works fine. But how do I dynamically remove and add it again? Once it's working I cant seem to find a way in javascript to stop it again. I've tried calling 'hover' again on the same element with empty function callbacks, but it doesn't seem to have any effect. thanks.
[jQuery] Re: Help with selecting great grandchildren
You could use $(.line-item, $(this).parent()) which brings back all .line-items under the context of the parent or you could use $(this).parent().find(.line-item) which searches for any .line-items under the parent. Either one should work, so pick your favorite :) - Lindsay On May 2, 12:38 pm, Chuck Cheeze [EMAIL PROTECTED] wrote: Below is my html/EE code: pre div class=less-info !-- Standard configuration -- !-- Show more button -- span class=show-more{lang_showmoreinfo}/span !-- Standard configuration tab -- span class=tab{lang_standardconfigurations}/span !-- Parts list -- ul class=part-detail-box {related_entries id=cf_products_parts} !-- loop -- li class=line-item !-- Part number - floated right -- span class=part-number{cf_parts_partnumber}/span !-- Part title - aligned left -- {cf_parts_title} {if cf_parts_desc} div class=line-item-detail {cf_parts_desc} /div {/if} /li {/related_entries} !-- end loop -- /ul !-- part-detail-box -- /div !-- less-info -- /pre What I want is for the user to click the span.show-more and have it toggle show/hide all li.line-item's within its own parent (div.less- info). I tried all types of stuff. I can get the parent to show/ hide, so I can get that far. From there I need to get to all child li.line-items. Here is what i stopped with, which I know is incorrect snce children() only selects direct children: pre //toggle the display of the individual product details $(.show-more).toggle( function() { $(this).parent().children(.line-item).show(); }, function() { $(this).parent().children(.line-item).hide(); } ); /pre
[jQuery] Re: didactic question: collapsing div's
There is a nice tutorial on the learning jquery blog about this. Towards the bottom it gets into the hiding/showing of siblings: http://www.learningjquery.com/2007/02/more-showing-more-hiding Wil Everts [EMAIL PROTECTED]
[jQuery] Re: Get System Error with jCarousel and Thickbox 3
Hi, Thickbox fails to laod images from a REST Style URL has anyone faced this before ? On May 1, 11:59 am, Samant [EMAIL PROTECTED] wrote: Hi , I was trying to use jCarousel and Thickbox 3 plugin . From the jCarousel, examples folder - used the special_thickbox.html and replaced the URI to point at REST webservice call image output as shown below instead of static .jpg image links.http://re3.yt-thm-a01.yimg.com/image/25/m4/3024464321http://re3.yt-thm-a01.yimg.com/image/25/m4/3022951145 The initial thumbnail display works fine but on click of the image , get a System Error at Line 0. IE error window. Browser is IE 6. Has anyone faced this issue before ? Any resolution ? Thanks in Advance ! Thanks Samant
[jQuery] Re: Giving more parameters to the async load function ?
Excellent thought. I was thinking of having some sort of parameter hash to pass in, maybe I can hook that together with this idea. On May 2, 11:39 am, markus.staab [EMAIL PROTECTED] wrote: Maybe a callback function (given some usefull context parameters..) which produces the url could do the trick.. On 2 Mai, 17:24, jayg [EMAIL PROTECTED] wrote: Thanks Jörn, I will post code here when I get a good solution. However, I know the treeviewis being worked on in the UI project as well, should I be looking at something other than treview.asynch to make these changes to? Additionally, I was considering adding a 'custom' persist option, I can provide a patch if you think it would be useful (and assuming it is done generically enough). Probably also going to be looking at adding a 'loading' spinner option, unless it is there and I have just missed it. On Apr 30, 11:42 am, Jörn Zaefferer [EMAIL PROTECTED] wrote: jayg schrieb: I need to set up dynamic urls with async trees as well, though I am using rails, so I am looking for something more like 'foo/bar/1', but same functionality. The problem I have with the idea to use source.php?id=firsttree or something similar is that I don't know how many subtrees I may have - this needs to be built dynamically. If I misunderstood, and this is intended to be dynamic, a code snippet would be greatly helpful. If not, my thought was in the getJSON function of thetreeview.asynch to have _that_ create the url info for the newly returned tree. We already have this.id and could easily return the name of the controller and method to call. Then, at the end when we call $(container).treeview({add:child}), we could insert the url we created into ts setting. I may hack on this until I hear another idea, but let me know what you think of that approach. Ideas, especially in the form of code, are very welcome. The basic problem, dynamic arguments and different URL formats, applies now to bothtreeviewand autocomplete plugins, so solving it properly would help a lot. Jörn
[jQuery] IE Issues with onChange on form select and radio
Hello. I'm having a few issues, and I was hoping someone might be able to give me some perspective. I've been searching for an answer for a couple of weeks now, and I'm at the end of my rope. I have a form with a two select boxes (one for a country selection, the other for a language selection), and a set of radio buttons that define a filter. If a user selects a country, two events fire: 1) The first gets an HTML list of relevant state/provs and load()s them into an empty div right below the countries. 2) The second event does the same as above, but load()s a refined list of languages into place If the user changes the radio button filter, then two events fire: 1) gets and loads a new country list 2) gets and loads a new language list too It's a little more complex than that, as the country list is also narrowed when the language is changed. The issue is that in Both IE 6 7: 1) country select onchange fires the event and loads new languages , but not states; it looks like it might try to load the states, but nothing but a blank space appears below the countries. 2) radion onchange event fires, but only after you click somewhere In IE 6 the issue is exacerbated by a warning on every page load: - Error A runtime error has occurred Do you wish to debug? Line 2 Object does not support this property or method In Firefox 2 3 and Safari 3+, this all works exactly like it should. This is the dev URL: http://csdir.iteratemedia.com/ Following are two code snippets as inline examples. You'll see that I'm apply the onchange function directly to the ID (or class) of the form element being affected. I have a feeling that this is where my issue lay, but any amount of tweaking (applying the change the containing div for example) either makes no difference or breaks it in FF et al. script type=text/javascript $(document).ready(function() { $(select#country).change( function() { var filter = $('#filterList').attr('class'); var language = $('#languageList').attr('class'); $('#countryList').removeClass().addClass(this.value); var updateState = encodeURI('/?action=loadStatesfilter=' + filter + 'country=' + this.value); var languageLoad = encodeURI('/?action=loadLanguagesfilter=' + filter + 'country=' + this.value); $('#cityList').removeClass().addClass('all').empty(); $('#stateList').load(updateState, function() { $ ('#state').Shake(2);}); if(language == all){ $('#languageList').load(languageLoad, function() { $ ('#language').Shake(2); }); } return false; }); }); /script select name=country id=country option value=allSelect a Country/option ?php //loop through countries retrieved from DB foreach($countries as $country){ echo option; if($userCountry == $country-country) echo selected; echo . $country-country . /option\n; } ? /select And a snippet for the filter change: script type=text/javascript $(document).ready(function() { $(.filter).change( function() { var country = $('#countryList').attr('class'); var state = $('#stateList').attr('class'); $('#filterList').removeClass().addClass(this.value); $('#stateList').removeClass().empty(); $('#cityList').removeClass().empty(); var countryURL = '/?action=loadCountriesfilter='+this.value; var languageURL = '/?action=loadLanguagesfilter='+this.value; $('#countryList').load(countryURL, function() { $ ('#country').Shake(2); }); $('#languageList').load(languageURL, function() { $ ('#language').Shake(2); }); return false; }); }); /script fieldset id=filterList class=?= $classFilter ? legendFilter/legend div input type=radio name=filter class=filter value=none id=all ?php if(!$userFilter || $userFilter == none) echo checked; ? / label for=allAll Practitioners/labelbr/ input type=radio name=filter class=filter value=CSB id=teach ?php if($userFilter == CSB) echo checked; ? / label for=teachTeachers (CSB) Only/labelbr/ input type=radio name=filter class=filter value=Nurse id=nurse ?php if($userFilter == Nurse) echo checked; ?/label for=nurse Nurses Only/label /div /fieldset I'll buy a beer for someone who can point me in the right direction :-) Much Appreciated.
[jQuery] Re: Get System Error with jCarousel and Thickbox 3
You are getting this because Thickbox decides if your link is an image or not based on the file extension. If all your images are from yimg, you can fix this with a bit of a hack. Go into thickbox.js, find the function tb_show(), and these lines: var urlString = /\.jpg|\.jpeg|\.png|\.gif|\.bmp/g; var urlType = baseURL.toLowerCase().match(urlString); if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp'){//code to show images Just add a test to find a unique part of your URL string, such as var urlString = /\.jpg|\.jpeg|\.png|\.gif|\.bmp|\.yimg/g; var urlType = baseURL.toLowerCase().match(urlString); if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp' || urlType == '.yimg'){//code to show images Maybe Thickbox will add support for custom extensions down the line. HTH, Ted On Fri, May 2, 2008 at 6:07 PM, Samant [EMAIL PROTECTED] wrote: Hi, Thickbox fails to laod images from a REST Style URL has anyone faced this before ? On May 1, 11:59 am, Samant [EMAIL PROTECTED] wrote: Hi , I was trying to use jCarousel and Thickbox 3 plugin . From the jCarousel, examples folder - used the special_thickbox.html and replaced the URI to point at REST webservice call image output as shown below instead of static .jpg image links. http://re3.yt-thm-a01.yimg.com/image/25/m4/3024464321http://re3.yt-thm-a01.yimg.com/image/25/m4/3022951145 The initial thumbnail display works fine but on click of the image , get a System Error at Line 0. IE error window. Browser is IE 6. Has anyone faced this issue before ? Any resolution ? Thanks in Advance ! Thanks Samant -- Ted