[jQuery] Re: jQuery to create dynamic HTML-Content in a table
I thought to do it perhaps this way: -First read the header (columns). Thererfor, I have to provide something like in it so that jQuery can read out how many names there are and "save" their uids in an array -Secondly: Go throught each and prove wether the first contains a date mm.dd. (if not, than it's a perhaps the row with "April 08" etc ...). If yes, save the tid (therefor, provide something like: ) -In this (if it's a date) go through each and insert the html code with the %tid% and take the uid from the uids-Array Could somebody help me with it since I don't know much about it :( On 23 Apr., 22:13, KnoxBaby <[EMAIL PROTECTED]> wrote: > Hello, > > I have a big table. It has a header on the right side (dates) and on > the top (names of persons). > Each date has an ID (tid) and each person an user-id (uid). This table > is generated in PHP: > > http://img117.imageshack.us/img117/7624/zwischenablage02ow0.jpg(Table > Layout) > > Each user can set for himself a preference (Yes, No, Perhaps) to a > date. > > Therefor, he hovers in his column a row and the following html-code > comes up (marked pink): > > http://img373.imageshack.us/img373/7711/zwischenablage04aa7.jpg > > To achieve that, I do the following: > > I use an ID ($cell_id = $tid . $uid) for each cell and print-out > something like that: > > onmouseout="toggleOff($cell_id)"> > show here the actual status symbol ... > > > Edit: > ...the 3 links to change status to with their symbols as link > > > You can imagine that it's a lot of code. The filesize is about 1.3MB > and takes ages to load (the person that "runs" the date-planer wants > it like that; to show up all dates and persons on ONE page). Now I > removed the code that makes the hover and the hidden-div with the > change-links and get only about 177Kbyte. > > Now I ask myself if it would be possible with jQuery to manage it > somehow ... > > Any ideas? > > Thanks
[jQuery] Re: Question: Selecting all the links in div
Hi does this UserSubPanel is a gernal div like div id="UserSubPanel" or an asp.net div like div id="UserSubPanel" runat="server" if the second is the case than your div cannot be found because aps.netrwrites the id to something like wrote: > > Could you post the html? That would help a lot. If the links exist > your code should work. > > btw, ripple, you shouldn't need to use 'each' - addClass will apply to > all objects in the collection. Using 'each' just adds overhead. > > On Apr 24, 3:14 am, ripple <[EMAIL PROTECTED]> wrote: > > Why not loop through it? This is usually how I would do it. > > > > $(document).ready(function(){ > > > > $('#UserSubPanel a').each(function(i) { > > > > $(this).addClass('sideLink'); > > > > }); > > > > http://2whoa.com/dominate/ > > > > vladv <[EMAIL PROTECTED]> wrote: > > > > Thanks for your answer :) > > I tried this also, but no luck... > > > > What may be the problem? > > I have another jQuery function in the same place, but it works just > > fine > > > > can it be that nested div called in other way? > > > > Thanks again > > > > On Apr 23, 3:26 pm, "Giuliano Marcangelo" > > wrote: > > > > > > > > > > > > > $(document).ready(function(){ > > > > > $('#UserSubPanel a').addClass('sideLink'); > > > }); > > > > > 2008/4/23 vladv : > > > > > > Selecting all the links in div.. > > > > I know it should be really simple, but for some reason I can't make > it > > > > work.. > > > > > > I work with asp.net and try to run something like this: > > > > > > $(document).ready(function(){ > > > > > > $('#UserSubPanel > a').addClass('sideLink'); > > > > }); > > > > > > but it doesn't work. The links are LinkButtons but rendered as > > > > Can someone please help me with this? > > > > Thanks in advance. > > > > - > > Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try > it now.- Hide quoted text - > > > > - Show quoted text - > -- Armand Datema CTO SchwingSoft
[jQuery] Re: jQuery to create dynamic HTML-Content in a table
I tried it myself but I have probs with some things. Look at the code, I commented it: http://nopaste.php-quake.net/26562 E.g. I don't know how to combine $(this) in the each function with another selector. $(this + ' > img').attr('alt') didn't work to get the content of the 'alt' attribute (which serves to be the UID)... Same with the tid ... On 24 Apr., 09:18, KnoxBaby <[EMAIL PROTECTED]> wrote: > I thought to do it perhaps this way: > > -First read the header (columns). Thererfor, I have to provide > something like in it so that jQuery can read > out how many names there are and "save" their uids in an array > -Secondly: Go throught each and prove wether the first > contains a date mm.dd. (if not, than it's a perhaps the row with > "April 08" etc ...). If yes, save the tid (therefor, provide something > like: ) > -In this (if it's a date) go through each and insert the > html code with the %tid% and take the uid from the uids-Array > > Could somebody help me with it since I don't know much about it :( > > On 23 Apr., 22:13, KnoxBaby <[EMAIL PROTECTED]> wrote: > > > Hello, > > > I have a big table. It has a header on the right side (dates) and on > > the top (names of persons). > > Each date has an ID (tid) and each person an user-id (uid). This table > > is generated in PHP: > > >http://img117.imageshack.us/img117/7624/zwischenablage02ow0.jpg(Table > > Layout) > > > Each user can set for himself a preference (Yes, No, Perhaps) to a > > date. > > > Therefor, he hovers in his column a row and the following html-code > > comes up (marked pink): > > >http://img373.imageshack.us/img373/7711/zwischenablage04aa7.jpg > > > To achieve that, I do the following: > > > I use an ID ($cell_id = $tid . $uid) for each cell and print-out > > something like that: > > > > onmouseout="toggleOff($cell_id)"> > > show here the actual status symbol ... > > > > > > Edit: > > ...the 3 links to change status to with their symbols as link > > > > > You can imagine that it's a lot of code. The filesize is about 1.3MB > > and takes ages to load (the person that "runs" the date-planer wants > > it like that; to show up all dates and persons on ONE page). Now I > > removed the code that makes the hover and the hidden-div with the > > change-links and get only about 177Kbyte. > > > Now I ask myself if it would be possible with jQuery to manage it > > somehow ... > > > Any ideas? > > > Thanks
[jQuery] Re: jQuery to create dynamic HTML-Content in a table
On Thu, Apr 24, 2008 at 3:31 AM, KnoxBaby <[EMAIL PROTECTED]> wrote: > > E.g. I don't know how to combine $(this) in the each function with > another selector. > > $(this + ' > img').attr('alt') didn't work to get the content of the > 'alt' attribute (which serves to be the UID)... Same with the tid ... > Try this: jQuery('> img', this).attr('alt'); jQuery() has a second parameter which allows you specify the "context" (basically, where to start searching from) of a selector. It defaults to document if not specified. > > > On 24 Apr., 09:18, KnoxBaby <[EMAIL PROTECTED]> wrote: > > I thought to do it perhaps this way: > > > > -First read the header (columns). Thererfor, I have to provide > > something like in it so that jQuery can read > > out how many names there are and "save" their uids in an array > > -Secondly: Go throught each and prove wether the first > > contains a date mm.dd. (if not, than it's a perhaps the row with > > "April 08" etc ...). If yes, save the tid (therefor, provide something > > like: ) > > -In this (if it's a date) go through each and insert the > > html code with the %tid% and take the uid from the uids-Array > > > > Could somebody help me with it since I don't know much about it :( > > > > On 23 Apr., 22:13, KnoxBaby <[EMAIL PROTECTED]> wrote: > > > > > Hello, > > > > > I have a big table. It has a header on the right side (dates) and on > > > the top (names of persons). > > > Each date has an ID (tid) and each person an user-id (uid). This table > > > is generated in PHP: > > > > >http://img117.imageshack.us/img117/7624/zwischenablage02ow0.jpg(Table > > > Layout) > > > > > Each user can set for himself a preference (Yes, No, Perhaps) to a > > > date. > > > > > Therefor, he hovers in his column a row and the following html-code > > > comes up (marked pink): > > > > >http://img373.imageshack.us/img373/7711/zwischenablage04aa7.jpg > > > > > To achieve that, I do the following: > > > > > I use an ID ($cell_id = $tid . $uid) for each cell and print-out > > > something like that: > > > > > > > onmouseout="toggleOff($cell_id)"> > > > show here the actual status symbol ... > > > > > > > > > Edit: > > > ...the 3 links to change status to with their symbols as link > > > > > > > > You can imagine that it's a lot of code. The filesize is about 1.3MB > > > and takes ages to load (the person that "runs" the date-planer wants > > > it like that; to show up all dates and persons on ONE page). Now I > > > removed the code that makes the hover and the hidden-div with the > > > change-links and get only about 177Kbyte. > > > > > Now I ask myself if it would be possible with jQuery to manage it > > > somehow ... > > > > > Any ideas? > > > > > Thanks > -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] store the css current values of an element
Hi there ! i'm working on a plugin for my application, that needs to store the current value of all css properties of an element in the DOM. Do i have to store each property one by one or is it possible to just copy the entire css in one command? I tried: var myEl = new Object(); myEl.css = $('#helloworld').css(); But of course, that didn't work. Any help much appreciated ! -- Alexandre Plennevaux LAb[au] http://www.lab-au.com
[jQuery] Re: jQuery to create dynamic HTML-Content in a table
ah ok cool, thanks so far. I'm gonna try this out! If anybody has more tipps on how to achieve my goal, just reply :) Thanks a lot!!! On 24 Apr., 10:38, "Aaron Heimlich" <[EMAIL PROTECTED]> wrote: > On Thu, Apr 24, 2008 at 3:31 AM, KnoxBaby <[EMAIL PROTECTED]> wrote: > > > E.g. I don't know how to combine $(this) in the each function with > > another selector. > > > $(this + ' > img').attr('alt') didn't work to get the content of the > > 'alt' attribute (which serves to be the UID)... Same with the tid ... > > Try this: > > jQuery('> img', this).attr('alt'); > > jQuery() has a second parameter which allows you specify the "context" > (basically, where to start searching from) of a selector. It defaults to > document if not specified. > > > > > > > On 24 Apr., 09:18, KnoxBaby <[EMAIL PROTECTED]> wrote: > > > I thought to do it perhaps this way: > > > > -First read the header (columns). Thererfor, I have to provide > > > something like in it so that jQuery can read > > > out how many names there are and "save" their uids in an array > > > -Secondly: Go throught each and prove wether the first > > > contains a date mm.dd. (if not, than it's a perhaps the row with > > > "April 08" etc ...). If yes, save the tid (therefor, provide something > > > like: ) > > > -In this (if it's a date) go through each and insert the > > > html code with the %tid% and take the uid from the uids-Array > > > > Could somebody help me with it since I don't know much about it :( > > > > On 23 Apr., 22:13, KnoxBaby <[EMAIL PROTECTED]> wrote: > > > > > Hello, > > > > > I have a big table. It has a header on the right side (dates) and on > > > > the top (names of persons). > > > > Each date has an ID (tid) and each person an user-id (uid). This table > > > > is generated in PHP: > > > > >http://img117.imageshack.us/img117/7624/zwischenablage02ow0.jpg(Table > > > > Layout) > > > > > Each user can set for himself a preference (Yes, No, Perhaps) to a > > > > date. > > > > > Therefor, he hovers in his column a row and the following html-code > > > > comes up (marked pink): > > > > >http://img373.imageshack.us/img373/7711/zwischenablage04aa7.jpg > > > > > To achieve that, I do the following: > > > > > I use an ID ($cell_id = $tid . $uid) for each cell and print-out > > > > something like that: > > > > > > > > onmouseout="toggleOff($cell_id)"> > > > > show here the actual status symbol ... > > > > > > > > > > > > Edit: > > > > ...the 3 links to change status to with their symbols as link > > > > > > > > > You can imagine that it's a lot of code. The filesize is about 1.3MB > > > > and takes ages to load (the person that "runs" the date-planer wants > > > > it like that; to show up all dates and persons on ONE page). Now I > > > > removed the code that makes the hover and the hidden-div with the > > > > change-links and get only about 177Kbyte. > > > > > Now I ask myself if it would be possible with jQuery to manage it > > > > somehow ... > > > > > Any ideas? > > > > > Thanks > > -- > Aaron Heimlich > Web Developer > [EMAIL PROTECTED]://aheimlich.freepgs.com/
[jQuery] trac code download
hi! i needed a fix for the color plugin so taht it works with transparent backgrounds. I found one ticket solves it: http://dev.jquery.com/attachment/ticket/2281/rgba.diff but i don't understand how to actually download the resulting code. Can someone shed a light ? thank you, -- Alexandre Plennevaux LAb[au] http://www.lab-au.com
[jQuery] getting value out of datepicker
Hi, I want to display some default date in a TextBox element. I have bind datepicker to "startDate" with some default date On document ready function. jQuery('#startDate').datepicker({defaultDate: -7}); When I click on startDate input text box I do see datepicker control with highlighted current date. However the startDate textbox is still empty. How can I add startdate that was highlighted in datepicker as default value and apply that as date displayed in textbox(i.e. 4/23/2008) ? I tried using following but it returns null : alert(jQuery('#startDate').datepicker("getDate")); Thanks in advance, Amit -- Know that you are special but be ordinary. -Sri Sri Ravisankar
[jQuery] Testing jQuery (and jQuery UI) Components
How do you guys test jQuery UI components? If you’re reading this, you’re probably an expert JS developer, so you know how much the state of JavaScript testing sucks. Developers generally neglect JS testing because there’s really nothing out there that let's you simulate user interactions easily. So we built the Test plugin for JavaScriptMVC (http://javascriptmvc.com/ learningcenter/test/index.html) to do just that. It lets you simulate every major DOM event, as well as some combination events like Write and Drag, simulate Ajax, and use assertions. It runs functional and unit tests in a separate console window. Best of all, it is interdependent with jQuery. We’ve been using it to test our JS UI widgets, and I think it could be very useful for doing the same for jQuery and jQuery UI widgets. I’d love to hear feedback on it (as brutally honest as possible). Is better testing something jQuery developers are craving? Cheers, Brian Moschel
[jQuery] Re: Annouce: idTabs 2.0
Your functionality is bang on what I need, thanks for sharing. Just a few questions that I couldn't get from the webpage linked to in the original post: 1. Is jQuery 1.2.3 a requirement? 2. What do each of the individual files do? For example, there is a notice to download jQuery.idTabs.min.js on the web page, but the code example seems to call jquery.idTabs.pack.js. Do I need both? 3. Are jquery.newsticker.pack.js, jquery.chili.pack.js, chili.recipes.js, main.js required or needed for certain functionality? Thanks again. On Apr 21, 9:46 am, "Sean Catchpole" <[EMAIL PROTECTED]> wrote: > It's been a long time since I released idTabs 1.0 and I'm happy to say that > a lot more people than I was expecting are using it. > As time has passed, so has my programming style. I have completely recoded > the structure and added a few options people requested. > idTabs can now be bound dynamically, and via different events. > > http://www.sunsean.com/idTabs/ > > Check it out and let me know if you have any troubles. > ~Sean
[jQuery] Re: Ext went GPL
Yeah, the GPL 3 is viral and most open source developers don't even realize that once they distribute apps with the open source extjs 2.1 library they will have to license their apps under GPL3. I personally prefer LGPL. The problem for me was that ExtJS did not open source the images and style sheets.
[jQuery] YUI Compressor and JCarouselleLite
I was trying the yuicompressor on jcarousellite 1.0.1* and got this error: “invalid property id” at line 239: this is line 239: li.css({overflow: “hidden”, float: o.vertical ? “none” : “left”}); What could be wrong? * http://www.gmarwaha.com/jquery/jcarousellite/js/jcarousellite_1.0.1.js
[jQuery] Field Highlight when comparing form fields
Hi, I am trying to get a field highlighter working. I have a 2 column layout with a form in each. The form on the left is the 'original' data and the form on the right is newly updated. I would like to look at each form field and compare their values and if different add a class to highlight the change. I have the following code: http://rafb.net/p/UXZHd938.html The forms are quite large and this code basically kills the browser and I get a Slow script warning. Does anyone know if there is a way to speed this up or make it more efficient or should I handle it server side? Cheers Dave
[jQuery] onClick attribute filter broken in IE
Hi, var selectors = "a[href$=.pdf], [href$=.rtf], [href$=.ppt], [href $=.txt], [href$=.mp3], [href$=.xml], [href$=.exe], [href$=.zip], [href $=.rar], [href$=.dmg], [href$=.tar.Z], [href$=.tar.gz], [href$=.tgz]"; $(selectors).not("[onClick*=pageTracker._trackPageview]").click ( // Does stuff ) So the above code works fine in Firefox but errors in IE but I've managed to track the error down to the attribute filter. If i swap onClick with any other attribute the script won't error. Does anyone know why this is happening? and if you do know why could you tell me? James
[jQuery] Re: Ext went GPL
Does it mean, that if I have PHP application, that uses javascript under GPL3, I must release also PHP source? MichaL On Thu, Apr 24, 2008 at 7:16 AM, xwisdom <[EMAIL PROTECTED]> wrote: > > > Yeah, the GPL 3 is viral and most open source developers don't even > realize that once they distribute apps with the open source extjs 2.1 > library they will have to license their apps under GPL3. > > I personally prefer LGPL. The problem for me was that ExtJS did not > open source the images and style sheets. >
[jQuery] Re: Ajax Replacing HTML Using JSON
Glad to know you solved it. On Apr 23, 4:59 pm, "s.ross" <[EMAIL PROTECTED]> wrote: > On Apr 23, 2008, at 1:27 AM, Diego A. wrote: > > > > > Is the new link by any chance being inserted within the trigger > > itself? (doesn't seem like it would work because the code takes the > > href attribute from the trigger itself, not the link within it, but it > > could cause something weird to happen). > > Diego, you're pretty much on target here. I posted a follow-up > at:http://groups.google.com/group/jquery-en/browse_thread/thread/2cb9e3e... > that explains what the problem was. What I wound up using was event > bubbling so I could replace something inside the span without > affecting the binding between the handler and the element. > > > Other than that, are use using event delegation or live query or some > > other way of binding events that is automatically executing the > > ajaxBind function on the new link when it is inserted? > > > On Apr 22, 9:51 pm, "s.ross" <[EMAIL PROTECTED]> wrote: > >> I'm having a strange problem using $.ajax. Better to illustrate with > >> the code: > > >> function ajaxBind(trigger) { > >> trigger.click(function(){ > >>$.ajax({ > >> type: "POST", > >> url: $(this).attr('href'), > >> data: { > >>'authenticity_token': $ > >> ('input[name=authenticity_token]').val() > >> }, > >> dataType: 'json', > >> beforeSend: function(xhr) { > >>xhr.setRequestHeader("Accept", "application/json"); > >> }, > >> // json contains id and partial keys > >> success: function(json) { > >>$('#task' + json['task']).html(json['partial']); > >> } > >>}); > >>return false; > >> }); > > >> } > > >> When the DOM element "trigger" is clicked, a request to the server is > >> issued and the JSON response comes back. Hokey, dokey. The response > >> is > >> an html link. Something along the lines of: > > >> partial: "link in html that google would strip out anyway" > > >> This gets inserted using the html() function, as you see in the > >> success: part of the $.ajax call, and all is well until I click on > >> the > >> new link. Then the link is interpreted as a request to open a > >> document > >> of type application/json. Firebug doesn't reveal anything unusual > >> about the inserted HTML. Does anyone see the problem here? > > >> Thanks
[jQuery] get a inside a
I think it's simple but it doesn't work... to me. ;-) I want to fire an event when I click on that link inside a ... Inside of the there are: So would be the third element but it's the first and unique I tried something like that: $(document).ready(function(){ $("#id_div a").click(function(){ etc... but it doesn't work. I tried also: $(document).ready(function(){ $("#id_div").find("a").click(function(){ etc... and it doesn't work as well... If I do this it works but not the way I want to: $(document).ready(function(){ $("#id_div").click(function(){ etc... because, of course, it fires the event wherever you click inside of the ... instead I want to fire the event just when you click on the link. any idea? thanks in advance!!!
[jQuery] Adding a string to the end of links using Jquery?
Hi, Is it possible to add the string ?mytracker=yes onto the end of all links on my page using Qjuery?
[jQuery] Forms: Email before submit
Hello everybody. I have a form which data has to be sent to a CRM (salesforce), so in the form action I have to include "https://www.salesforce.com/ servlet/...", but I need to send emails before the form submits, because how the form is in an external url, I can't manage the data once the form is submitted. Any idea of how can manage that? Thanks a log.
[jQuery] Re: get a inside a
do you actually have an HREF attribute to your A tag ? Because its omission kills the click event i think. On Thu, Apr 24, 2008 at 1:22 PM, ^AndreA^ <[EMAIL PROTECTED]> wrote: > > I think it's simple but it doesn't work... to me. ;-) > > I want to fire an event when I click on that link inside a > ... > > Inside of the there are: > > > > > So would be the third element but it's the first and unique > > > I tried something like that: > $(document).ready(function(){ > $("#id_div a").click(function(){ etc... > > but it doesn't work. > > I tried also: > $(document).ready(function(){ > $("#id_div").find("a").click(function(){ etc... > > and it doesn't work as well... > > If I do this it works but not the way I want to: > $(document).ready(function(){ > $("#id_div").click(function(){ etc... > > because, of course, it fires the event wherever you click inside of > the ... > instead I want to fire the event just when you click on the link. > > any idea? > > thanks in advance!!! > -- Alexandre Plennevaux LAb[au] http://www.lab-au.com
[jQuery] Re: get a inside a
Yes, href="#"... Could it be a problem?!? I put # just in oder to make it a link... This is what I've got into my : Welcome $_user!!! Log out On Apr 24, 1:08 pm, "Alexandre Plennevaux" <[EMAIL PROTECTED]> wrote: > do you actually have an HREF attribute to your A tag ? Because its omission > kills the click event i think. > > > > On Thu, Apr 24, 2008 at 1:22 PM, ^AndreA^ <[EMAIL PROTECTED]> wrote: > > > I think it's simple but it doesn't work... to me. ;-) > > > I want to fire an event when I click on that link inside a > > ... > > > Inside of the there are: > > > > > > > > > So would be the third element but it's the first and unique > > > > > I tried something like that: > > $(document).ready(function(){ > > $("#id_div a").click(function(){ etc... > > > but it doesn't work. > > > I tried also: > > $(document).ready(function(){ > > $("#id_div").find("a").click(function(){ etc... > > > and it doesn't work as well... > > > If I do this it works but not the way I want to: > > $(document).ready(function(){ > > $("#id_div").click(function(){ etc... > > > because, of course, it fires the event wherever you click inside of > > the ... > > instead I want to fire the event just when you click on the link. > > > any idea? > > > thanks in advance!!! > > -- > Alexandre Plennevaux > LAb[au] > > http://www.lab-au.com
[jQuery] Re: Adding a string to the end of links using Jquery?
$('a').each(function(){ var href = $(this).attr('href'); var separator = (indexOf('?')>-1) ? '&' : '?'; $(this).attr('href', href+separator+'mytracker=yes'); }); On Thu, Apr 24, 2008 at 1:10 PM, denhamd2 <[EMAIL PROTECTED]> wrote: > > Hi, > > Is it possible to add the string ?mytracker=yes onto the end of all > links on my page using Qjuery? > -- Alexandre Plennevaux LAb[au] http://www.lab-au.com
[jQuery] Re: Adding a string to the end of links using Jquery?
oups slight mistake forgot the string part in the indexOf :) here is the correction: $('a').each(function(){ var href = $(this).attr('href'); var separator = (href .indexOf('?')>-1) ? '&' : '?'; $(this).attr('href', href+separator+'mytracker=yes' > > ); > }); On Thu, Apr 24, 2008 at 2:51 PM, Alexandre Plennevaux <[EMAIL PROTECTED]> wrote: > $('a').each(function(){ > var href = $(this).attr('href'); > var separator = (href .indexOf('?')>-1) ? '&' : '?'; > $(this).attr('href', href+separator+'mytracker=yes'); > }); > > > > > On Thu, Apr 24, 2008 at 1:10 PM, denhamd2 <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > > Is it possible to add the string ?mytracker=yes onto the end of all > > links on my page using Qjuery? > > > > > > -- > Alexandre Plennevaux > LAb[au] > > http://www.lab-au.com -- Alexandre Plennevaux LAb[au] http://www.lab-au.com
[jQuery] load http:// with load() ??
Hi, I need loading http request inside my div content. I do this it $("#content").load("http://www.google.com.br";); but not OK ?? How i can load this page in my div ? tks.. -- att. Luciano M. www.m2t.com.br
[jQuery] Re: show/hide nested divs?
Thanks Shawn, still not working though, i presume because .boxcontent is not a sibling of .closeimage_left but is a sibling of .box so would i need to find the parent div of .closeimage_left then toggle that sibling .boxcontent? If so, any idea how I would do it? On Apr 24, 2:07 am, Shawn <[EMAIL PROTECTED]> wrote: > oops.. that should probably be a .toggle() instead of a .hide() > > Shawn > > Shawn wrote: > > > $(".closeimage_left").click( function () { > > $(this).siblings(".boxcontent").hide(); > > }); > > > That *should* do the trick. > > > Shawn > > > thekman wrote: > >> Hi all, > >> I have code something like: > > >> > >> > >> Box Title > >> Box Title > >> box content... > >> > >> > >> > >> Box Title > >> Box Title > >> box content... > >> > > >> All numbers are dynamically generated from the database. > > >> What is the best way to use jquery to close the correct content div? > >> I am presuming I would use something like below, but what do I put in > >> the click function? > > >> $(".closeimage_left").click(function() { > >>});
[jQuery] Re: Annouce: idTabs 2.0
> 1. Is jQuery 1.2.3 a requirement? An excellent question, as I only tested with 1.2.3... but it's highly probably that it works with older versions too. I'll try to test it out later. > 2. What do each of the individual files do? For example, there is a > notice to download jQuery.idTabs.min.js on the web page, but the code > example seems to call jquery.idTabs.pack.js. Do I need both? You only need one file. The various pack and min files are merely different compressions of the same file. I recommend using: jQuery.idTabs.min.js (I'll try to make that more clear) > 3. Are jquery.newsticker.pack.js, jquery.chili.pack.js, > chili.recipes.js, main.js required or needed for certain > functionality? newsticker and chili are scripts I use for presentation, they are not required in any way. =P Thanks for all the feedback. ~Sean
[jQuery] Re: Question: Selecting all the links in div
The panel is asp.net Panel but if I look at generated html this is what I see: User Panel Link1 Link2 $(document).ready(function(){ $('div.UserSubPanel a').addClass('sideLink'); //http://bassistance.de/jquery-plugins/jquery-plugin- tooltip/ $('#nav a').tooltip({ track: true, delay: 0, showURL: false, showBody: " - ", extraClass: "pretty", fixPNG: true, opacity: 0.95, left: -60 }); }); each doesn't work too. Hope this will resolve the issue. Thanks to all :) On Apr 24, 10:44 am, "Armand Datema" <[EMAIL PROTECTED]> wrote: > Hi > > does this UserSubPanel is a gernal div like > > div id="UserSubPanel" > > or an asp.net div like > > div id="UserSubPanel" runat="server" > > if the second is the case than your div cannot be found because > aps.netrwrites the id to something like > Armand > > On Wed, Apr 23, 2008 at 11:16 PM, Hamish Campbell <[EMAIL PROTECTED]> > wrote: > > > > > > > Could you post the html? That would help a lot. If the links exist > > your code should work. > > > btw, ripple, you shouldn't need to use 'each' - addClass will apply to > > all objects in the collection. Using 'each' just adds overhead. > > > On Apr 24, 3:14 am, ripple <[EMAIL PROTECTED]> wrote: > > > Why not loop through it? This is usually how I would do it. > > > > $(document).ready(function(){ > > > > $('#UserSubPanel a').each(function(i) { > > > > $(this).addClass('sideLink'); > > > > }); > > > > http://2whoa.com/dominate/ > > > > vladv <[EMAIL PROTECTED]> wrote: > > > > Thanks for your answer :) > > > I tried this also, but no luck... > > > > What may be the problem? > > > I have another jQuery function in the same place, but it works just > > > fine > > > > can it be that nested div called in other way? > > > > Thanks again > > > > On Apr 23, 3:26 pm, "Giuliano Marcangelo" > > > wrote: > > > > > $(document).ready(function(){ > > > > > $('#UserSubPanel a').addClass('sideLink'); > > > > }); > > > > > 2008/4/23 vladv : > > > > > > Selecting all the links in div.. > > > > > I know it should be really simple, but for some reason I can't make > > it > > > > > work.. > > > > > > I work with asp.net and try to run something like this: > > > > > > $(document).ready(function(){ > > > > > > $('#UserSubPanel > a').addClass('sideLink'); > > > > > }); > > > > > > but it doesn't work. The links are LinkButtons but rendered as > > > > > Can someone please help me with this? > > > > > Thanks in advance. > > > > - > > > Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try > > it now.- Hide quoted text - > > > > - Show quoted text - > > -- > Armand Datema > CTO SchwingSoft
[jQuery] Re: Ext went GPL
On Apr 24, 2008, at 2:26 PM, MichaL Sanger wrote: Does it mean, that if I have PHP application, that uses javascript under GPL3, I must release also PHP source? AFAIK if you bundle something GPL everything will become GPL. This includes your PHP source. However if you do not bundle GPL code with your application situation is different. Instead if you force your user to download and install GPL:d library / code themselves then they are bound to GPL. Not you or your code. All this is exactly why I do not touch or write anything GPL. Other licenses such and MIT and BSD are clear. I give users freedom to do whatever they want with my code. I do not want to force anyone to change their license to something, for example GPL. -- Mika Tuupola http://www.appelsiini.net/
[jQuery] Re: Question: Selecting all the links in div
You have UserSubPanel as the id. But you call it as a class. $('div.UserSubPanel a').addClass('sideLink'); Call it by the id. $('#UserSubPanel a').addClass('sideLink'); http://2whoa.com/dominate/ vladv <[EMAIL PROTECTED]> wrote: The panel is asp.net Panel but if I look at generated html this is what I see: User Panel Link1 Link2 $(document).ready(function(){ $('div.UserSubPanel a').addClass('sideLink'); //http://bassistance.de/jquery-plugins/jquery-plugin- tooltip/ $('#nav a').tooltip({ track: true, delay: 0, showURL: false, showBody: " - ", extraClass: "pretty", fixPNG: true, opacity: 0.95, left: -60 }); }); each doesn't work too. Hope this will resolve the issue. Thanks to all :) On Apr 24, 10:44 am, "Armand Datema" wrote: > Hi > > does this UserSubPanel is a gernal div like > > div id="UserSubPanel" > > or an asp.net div like > > div id="UserSubPanel" runat="server" > > if the second is the case than your div cannot be found because > aps.netrwrites the id to something like > > Armand > > On Wed, Apr 23, 2008 at 11:16 PM, Hamish Campbell > wrote: > > > > > > > Could you post the html? That would help a lot. If the links exist > > your code should work. > > > btw, ripple, you shouldn't need to use 'each' - addClass will apply to > > all objects in the collection. Using 'each' just adds overhead. > > > On Apr 24, 3:14 am, ripple wrote: > > > Why not loop through it? This is usually how I would do it. > > > > $(document).ready(function(){ > > > > $('#UserSubPanel a').each(function(i) { > > > > $(this).addClass('sideLink'); > > > > }); > > > > http://2whoa.com/dominate/ > > > > vladv wrote: > > > > Thanks for your answer :) > > > I tried this also, but no luck... > > > > What may be the problem? > > > I have another jQuery function in the same place, but it works just > > > fine > > > > can it be that nested div called in other way? > > > > Thanks again > > > > On Apr 23, 3:26 pm, "Giuliano Marcangelo" > > > wrote: > > > > > $(document).ready(function(){ > > > > > $('#UserSubPanel a').addClass('sideLink'); > > > > }); > > > > > 2008/4/23 vladv : > > > > > > Selecting all the links in div.. > > > > > I know it should be really simple, but for some reason I can't make > > it > > > > > work.. > > > > > > I work with asp.net and try to run something like this: > > > > > > $(document).ready(function(){ > > > > > > $('#UserSubPanel > a').addClass('sideLink'); > > > > > }); > > > > > > but it doesn't work. The links are LinkButtons but rendered as > > > > > Can someone please help me with this? > > > > > Thanks in advance. > > > > - > > > Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try > > it now.- Hide quoted text - > > > > - Show quoted text - > > -- > Armand Datema > CTO SchwingSoft - Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
[jQuery] Re: show/hide nested divs?
Thanks Shawn, however it is still not working for me, I presume because .boxcontent is not a sibling of .closeimage_left but is a sibling of So, should I have to find the parent div then find the sibling .boxcontent? any idea how i would do this? On Apr 24, 2:07 am, Shawn <[EMAIL PROTECTED]> wrote: > oops.. that should probably be a .toggle() instead of a .hide() > > Shawn > > Shawn wrote: > > > $(".closeimage_left").click( function () { > > $(this).siblings(".boxcontent").hide(); > > }); > > > That *should* do the trick. > > > Shawn > > > thekman wrote: > >> Hi all, > >> I have code something like: > > >> > >> > >> Box Title > >> Box Title > >> box content... > >> > >> > >> > >> Box Title > >> Box Title > >> box content... > >> > > >> All numbers are dynamically generated from the database. > > >> What is the best way to use jquery to close the correct content div? > >> I am presuming I would use something like below, but what do I put in > >> the click function? > > >> $(".closeimage_left").click(function() { > >>});
[jQuery] Jquery and Low Pro - an example
Hi folks! I wrote an article that walks through the construction of a Low Pro behavior for jquery and explains the reasons behind coupling the awesome low pro behavioral style with jquery: http://sudara.modernthings.net/2008/4/23/oh-behave-the-anatomy-of-jquery-and-low-pro-behaviors Low Pro started as a library for Prototype, but was recently ported over to jQuery by popular demand. For me, it is more of an attitude and approach to handling and organizing a LOT of behaviors. For larger apps, it's great, allowing you to write readable and reusable code. It also has an inheritance scheme to save those fingers of yours, provides some goodies like Event Delegation to cut back on your Event Handler addiction, and ties in seamlessly with livequery if you want it to. You can read about LowPro here: http://www.danwebb.net/2008/2/3/how-to-use-low-pro-for-jquery And get it here: http://github.com/danwrong/low-pro-for-jquery/tree/master
[jQuery] jquery cycle plugin - displaying certain data problem
Hello ppl, I am havim problems with the jquery cycle plugin (http:// www.malsup.com/jquery/cycle/int2.html - the one titles "Callbacks". I modified it a bit so that it displays my, a bit larger images. Now, I do not want it to display the code which prints out the code needed the plugin to work correctly, but can't seem to solve this issue. My code is as follows: [BODY HTML CODE] $('#s5').cycle({ fx: 'scrollLeft', pause: '1', timeout: 4000, before: onBefore, after: onAfter }); [/BODY HTML CODE] I'd like not to display the part: [BODY HTML CODE] $('#s5').cycle({ fx: 'scrollLeft', pause: '1', timeout: 4000, before: onBefore, after: onAfter }); [/BODY HTML CODE] ...but when I remove that fragment of code the whole thing doesn't work. Any help is very appreciated, thank you.
[jQuery] bug in jquery ? css('border') returns undefined
I wonder why this doesn't work, either it's a but or a flaw in the documentation: consider this code: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> h1 { background-color: #FF00FF; color: white; border: 1px solid red; } $(document).ready(function(){ var mycss = $('h1').css('border'); alert("hi : " + mycss ); }); hello world ... mycss returns undefined instead of '1px solid red' Unless there is a good reason that i'm unaware of, this seems like a bug to me, no ? Thanks Alexandre
[jQuery] Re: Ext went GPL
> > Does it mean, that if I have PHP application, that uses javascript > > under GPL3, I must release also PHP source? > > > > AFAIK if you bundle something GPL everything will become GPL. This includes > your PHP source. Just an FYI, this is only for non-commercial versions of ExtJS. I suppose the logic here is that if you would like to use ExtJS without paying for a commercial license and reap the rewards of an open source application, you will have to make your software open source (quid pro quo). You have a couple of options if you'd like to continue using ExtJS: 1. Keep using versions prior to 2.1 without making any changes to your existing code base. 2. Buy a commercial license, you won't need to make any changes to your code base. 3. Use a GPL version of ExtJS, open source any of your code (server/client) which directly references ExtJS, no changes to you existing code base. 4. Use a GPL version of ExtJS, remove any direct references of ExtJS from your code, develop an interface (a JSON message server?) which doesn't directly reference ExtJS, use it as an intermediate with ExtJS. Using this method, you wouldn't need to open source any of your software because you aren't directly referencing ExtJS. Granted, none of this is as convenient as an MIT or BSD or LGPL or CC license, but then, the core team ExtJS has a right to license their software anyway they'd like to keep the project up and running. - jake
[jQuery] Re: Ext went GPL
If Ext is GPL, then only the Ext libraries need to be GPL. If you have code referencing Ext - that is NOT Ext, and so that specific code does NOT need to be GPL'd. All this means is that when you distribute your apps (sell em, give em away, etc.), you are obligated to include the source for Ext that you used. Shawn Jake McGraw wrote: Does it mean, that if I have PHP application, that uses javascript under GPL3, I must release also PHP source? AFAIK if you bundle something GPL everything will become GPL. This includes your PHP source. Just an FYI, this is only for non-commercial versions of ExtJS. I suppose the logic here is that if you would like to use ExtJS without paying for a commercial license and reap the rewards of an open source application, you will have to make your software open source (quid pro quo). You have a couple of options if you'd like to continue using ExtJS: 1. Keep using versions prior to 2.1 without making any changes to your existing code base. 2. Buy a commercial license, you won't need to make any changes to your code base. 3. Use a GPL version of ExtJS, open source any of your code (server/client) which directly references ExtJS, no changes to you existing code base. 4. Use a GPL version of ExtJS, remove any direct references of ExtJS from your code, develop an interface (a JSON message server?) which doesn't directly reference ExtJS, use it as an intermediate with ExtJS. Using this method, you wouldn't need to open source any of your software because you aren't directly referencing ExtJS. Granted, none of this is as convenient as an MIT or BSD or LGPL or CC license, but then, the core team ExtJS has a right to license their software anyway they'd like to keep the project up and running. - jake
[jQuery] Re: Jquery and Low Pro - an example
Cab you provide a sentence or two explanation of what Low Pro is, and what it does? -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Sudara Sent: Thursday, April 24, 2008 7:59 AM To: jQuery (English) Subject: [jQuery] Jquery and Low Pro - an example Hi folks! I wrote an article that walks through the construction of a Low Pro behavior for jquery and explains the reasons behind coupling the awesome low pro behavioral style with jquery: http://sudara.modernthings.net/2008/4/23/oh-behave-the-anatomy-of-jquery-and -low-pro-behaviors Low Pro started as a library for Prototype, but was recently ported over to jQuery by popular demand. For me, it is more of an attitude and approach to handling and organizing a LOT of behaviors. For larger apps, it's great, allowing you to write readable and reusable code. It also has an inheritance scheme to save those fingers of yours, provides some goodies like Event Delegation to cut back on your Event Handler addiction, and ties in seamlessly with livequery if you want it to. You can read about LowPro here: http://www.danwebb.net/2008/2/3/how-to-use-low-pro-for-jquery And get it here: http://github.com/danwrong/low-pro-for-jquery/tree/master
[jQuery] Re: Ext went GPL
Oh, and if you modify the EXT code. Then you need to make THOSE changes available. But, your PHP code can be licensed however you'd like - as long as you respect the EXT license (and PHP, and any other tools/libraries you are using). It does not make any sense at all that the EXT developers can dictate to me or anyone else how I license MY code just because their stuff might be included in small percentage of the code base. GPL was never meant to work this way (making ALL code that touches it GPL'd). That's propaganda from the people who fear the GPL. Shawn. Shawn wrote: If Ext is GPL, then only the Ext libraries need to be GPL. If you have code referencing Ext - that is NOT Ext, and so that specific code does NOT need to be GPL'd. All this means is that when you distribute your apps (sell em, give em away, etc.), you are obligated to include the source for Ext that you used. Shawn Jake McGraw wrote: Does it mean, that if I have PHP application, that uses javascript under GPL3, I must release also PHP source? AFAIK if you bundle something GPL everything will become GPL. This includes your PHP source. Just an FYI, this is only for non-commercial versions of ExtJS. I suppose the logic here is that if you would like to use ExtJS without paying for a commercial license and reap the rewards of an open source application, you will have to make your software open source (quid pro quo). You have a couple of options if you'd like to continue using ExtJS: 1. Keep using versions prior to 2.1 without making any changes to your existing code base. 2. Buy a commercial license, you won't need to make any changes to your code base. 3. Use a GPL version of ExtJS, open source any of your code (server/client) which directly references ExtJS, no changes to you existing code base. 4. Use a GPL version of ExtJS, remove any direct references of ExtJS from your code, develop an interface (a JSON message server?) which doesn't directly reference ExtJS, use it as an intermediate with ExtJS. Using this method, you wouldn't need to open source any of your software because you aren't directly referencing ExtJS. Granted, none of this is as convenient as an MIT or BSD or LGPL or CC license, but then, the core team ExtJS has a right to license their software anyway they'd like to keep the project up and running. - jake
[jQuery] Re: jQuery to create dynamic HTML-Content in a table
If i use uid = jQuery(' > img', this).attr(alt); no more code after this line is being executed :( E.g.: [code] $('table tr:eq(0) td:gt(0)').each(function(i) { // If it's a col that contains an (than the has the class 'imgg') if($(this).is('.imgg')) { alert(i); $(this).append('#1'); // Read out img's alt-attribute and save to array uid = jQuery('> img', this).attr(alt); uids[ i ] = uid; // Testoutput to the matched header-column $(this).append('#2'); } }); [/code] #1 is prepended, but #2 not :( And #1 only for the first even though there are more matched td's ... On 24 Apr., 11:52, KnoxBaby <[EMAIL PROTECTED]> wrote: > ah ok cool, thanks so far. I'm gonna try this out! If anybody has more > tipps on how to achieve my goal, just reply :) Thanks a lot!!! > > On 24 Apr., 10:38, "Aaron Heimlich" <[EMAIL PROTECTED]> wrote: > > > On Thu, Apr 24, 2008 at 3:31 AM, KnoxBaby <[EMAIL PROTECTED]> wrote: > > > > E.g. I don't know how to combine $(this) in the each function with > > > another selector. > > > > $(this + ' > img').attr('alt') didn't work to get the content of the > > > 'alt' attribute (which serves to be the UID)... Same with the tid ... > > > Try this: > > > jQuery('> img', this).attr('alt'); > > > jQuery() has a second parameter which allows you specify the "context" > > (basically, where to start searching from) of a selector. It defaults to > > document if not specified. > > > > On 24 Apr., 09:18, KnoxBaby <[EMAIL PROTECTED]> wrote: > > > > I thought to do it perhaps this way: > > > > > -First read the header (columns). Thererfor, I have to provide > > > > something like in it so that jQuery can read > > > > out how many names there are and "save" their uids in an array > > > > -Secondly: Go throught each and prove wether the first > > > > contains a date mm.dd. (if not, than it's a perhaps the row with > > > > "April 08" etc ...). If yes, save the tid (therefor, provide something > > > > like: ) > > > > -In this (if it's a date) go through each and insert the > > > > html code with the %tid% and take the uid from the uids-Array > > > > > Could somebody help me with it since I don't know much about it :( > > > > > On 23 Apr., 22:13, KnoxBaby <[EMAIL PROTECTED]> wrote: > > > > > > Hello, > > > > > > I have a big table. It has a header on the right side (dates) and on > > > > > the top (names of persons). > > > > > Each date has an ID (tid) and each person an user-id (uid). This table > > > > > is generated in PHP: > > > > > >http://img117.imageshack.us/img117/7624/zwischenablage02ow0.jpg(Table > > > > > Layout) > > > > > > Each user can set for himself a preference (Yes, No, Perhaps) to a > > > > > date. > > > > > > Therefor, he hovers in his column a row and the following html-code > > > > > comes up (marked pink): > > > > > >http://img373.imageshack.us/img373/7711/zwischenablage04aa7.jpg > > > > > > To achieve that, I do the following: > > > > > > I use an ID ($cell_id = $tid . $uid) for each cell and print-out > > > > > something like that: > > > > > > > > > > onmouseout="toggleOff($cell_id)"> > > > > > show here the actual status symbol ... > > > > > > > > > > > > > > > Edit: > > > > > ...the 3 links to change status to with their symbols as link > > > > > > > > > > > You can imagine that it's a lot of code. The filesize is about 1.3MB > > > > > and takes ages to load (the person that "runs" the date-planer wants > > > > > it like that; to show up all dates and persons on ONE page). Now I > > > > > removed the code that makes the hover and the hidden-div with the > > > > > change-links and get only about 177Kbyte. > > > > > > Now I ask myself if it would be possible with jQuery to manage it > > > > > somehow ... > > > > > > Any ideas? > > > > > > Thanks > > > -- > > Aaron Heimlich > > Web Developer > > [EMAIL PROTECTED]://aheimlich.freepgs.com/
[jQuery] Re: jQuery to create dynamic HTML-Content in a table
Argh, 'alt' not alt :) On 24 Apr., 16:32, KnoxBaby <[EMAIL PROTECTED]> wrote: > If i use > > uid = jQuery(' > img', this).attr(alt); > > no more code after this line is being executed :( > > E.g.: > > [code] > $('table tr:eq(0) td:gt(0)').each(function(i) { > // If it's a col that contains an (than the has > the class > 'imgg') > if($(this).is('.imgg')) > { > alert(i); > $(this).append('#1'); > > // Read out img's alt-attribute and save to array > uid = jQuery('> img', this).attr(alt); > uids[ i ] = uid; > > // Testoutput to the matched header-column > $(this).append('#2'); > } > }); > [/code] > > #1 is prepended, but #2 not :( And #1 only for the first even > though there are more matched td's ... > > On 24 Apr., 11:52, KnoxBaby <[EMAIL PROTECTED]> wrote: > > > ah ok cool, thanks so far. I'm gonna try this out! If anybody has more > > tipps on how to achieve my goal, just reply :) Thanks a lot!!! > > > On 24 Apr., 10:38, "Aaron Heimlich" <[EMAIL PROTECTED]> wrote: > > > > On Thu, Apr 24, 2008 at 3:31 AM, KnoxBaby <[EMAIL PROTECTED]> wrote: > > > > > E.g. I don't know how to combine $(this) in the each function with > > > > another selector. > > > > > $(this + ' > img').attr('alt') didn't work to get the content of the > > > > 'alt' attribute (which serves to be the UID)... Same with the tid ... > > > > Try this: > > > > jQuery('> img', this).attr('alt'); > > > > jQuery() has a second parameter which allows you specify the "context" > > > (basically, where to start searching from) of a selector. It defaults to > > > document if not specified. > > > > > On 24 Apr., 09:18, KnoxBaby <[EMAIL PROTECTED]> wrote: > > > > > I thought to do it perhaps this way: > > > > > > -First read the header (columns). Thererfor, I have to provide > > > > > something like in it so that jQuery can read > > > > > out how many names there are and "save" their uids in an array > > > > > -Secondly: Go throught each and prove wether the first > > > > > contains a date mm.dd. (if not, than it's a perhaps the row with > > > > > "April 08" etc ...). If yes, save the tid (therefor, provide something > > > > > like: ) > > > > > -In this (if it's a date) go through each and insert the > > > > > html code with the %tid% and take the uid from the uids-Array > > > > > > Could somebody help me with it since I don't know much about it :( > > > > > > On 23 Apr., 22:13, KnoxBaby <[EMAIL PROTECTED]> wrote: > > > > > > > Hello, > > > > > > > I have a big table. It has a header on the right side (dates) and on > > > > > > the top (names of persons). > > > > > > Each date has an ID (tid) and each person an user-id (uid). This > > > > > > table > > > > > > is generated in PHP: > > > > > > >http://img117.imageshack.us/img117/7624/zwischenablage02ow0.jpg(Table > > > > > > Layout) > > > > > > > Each user can set for himself a preference (Yes, No, Perhaps) to a > > > > > > date. > > > > > > > Therefor, he hovers in his column a row and the following html-code > > > > > > comes up (marked pink): > > > > > > >http://img373.imageshack.us/img373/7711/zwischenablage04aa7.jpg > > > > > > > To achieve that, I do the following: > > > > > > > I use an ID ($cell_id = $tid . $uid) for each cell and print-out > > > > > > something like that: > > > > > > > > > > > > onmouseout="toggleOff($cell_id)"> > > > > > > show here the actual status symbol ... > > > > > > > > > > > > > > > > > > Edit: > > > > > > ...the 3 links to change status to with their symbols as link > > > > > > > > > > > > > You can imagine that it's a lot of code. The filesize is about 1.3MB > > > > > > and takes ages to load (the person that "runs" the date-planer wants > > > > > > it like that; to show up all dates and persons on ONE page). Now I > > > > > > removed the code that makes the hover and the hidden-div with the > > > > > > change-links and get only about 177Kbyte. > > > > > > > Now I ask myself if it would be possible with jQuery to manage it > > > > > > somehow ... > > > > > > > Any ideas? > > > > > > > Thanks > > > > -- > > > Aaron Heimlich > > > Web Developer > > > [EMAIL PROTECTED]://aheimlich.freepgs.com/
[jQuery] Re: jquery cycle plugin - displaying certain data problem
> I am havim problems with the jquery cycle plugin (http:// > www.malsup.com/jquery/cycle/int2.html - the one titles "Callbacks". I > modified it a bit so that it displays my, a bit larger images. Now, I > do not want it to display the code which prints out the code needed > the plugin to work correctly, but can't seem to solve this issue. My > code is as follows: > [BODY HTML CODE] > > > > > > > width="540" height="200" alt="Ajduk, Opuzen" /> > width="540" height="200" alt="PODKRAJ - Metković" /> > > > $('#s5').cycle({ > fx: 'scrollLeft', > pause: '1', > timeout: 4000, > before: onBefore, > after: onAfter > }); > > > > > > > > [/BODY HTML CODE] > > I'd like not to display the part: > > [BODY HTML CODE] > > $('#s5').cycle({ > fx: 'scrollLeft', > pause: '1', > timeout: 4000, > before: onBefore, > after: onAfter > }); > > > [/BODY HTML CODE] > > ...but when I remove that fragment of code the whole thing doesn't > work. Any help is very appreciated, thank you. > > Remove that part of the HTML that you don't want and add it back in as script in the document head: $(document).ready(function() { $('#s5').cycle({ fx: 'scrollLeft', pause: '1', timeout: 4000, before: onBefore, after: onAfter }); }); Mike
[jQuery] Re: Jquery and Low Pro - an example
" Why low pro, when jquery is already unobtrusive? * Behaviors allow me to easily name and encapsulate functionality that I can later reuse. * Behaviors are inheritable, allowing me to group like things together, and avoiding writing chunks of similar code. * Low Pro's implementation of behaviors has Event Delegation built in, vital for larger web apps (unless you want browsers to try and cope with 400 event bindings). * I like the way behaviors look and way they read. My code feels more organized. I can quickly tell what is going on. I write less, and more importantly, I write less mess. " http://sudara.modernthings.net/2008/4/23/oh-behave-the-anatomy-of-jquery-and-low-pro-behaviors :) On Apr 24, 3:29 pm, "Andy Matthews" <[EMAIL PROTECTED]> wrote: > Cab you provide a sentence or two explanation of what Low Pro is, and what > it does? > > -Original Message- > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On > > Behalf Of Sudara > Sent: Thursday, April 24, 2008 7:59 AM > To: jQuery (English) > Subject: [jQuery] Jquery and Low Pro - an example > > Hi folks! > > I wrote an article that walks through the construction of a Low Pro behavior > for jquery and explains the reasons behind coupling the awesome low pro > behavioral style with jquery: > > http://sudara.modernthings.net/2008/4/23/oh-behave-the-anatomy-of-jqu... > -low-pro-behaviors > > Low Pro started as a library for Prototype, but was recently ported over to > jQuery by popular demand. > > For me, it is more of an attitude and approach to handling and organizing a > LOT of behaviors. For larger apps, it's great, allowing you to write > readable and reusable code. It also has an inheritance scheme to save those > fingers of yours, provides some goodies like Event Delegation to cut back on > your Event Handler addiction, and ties in seamlessly with livequery if you > want it to. > > You can read about LowPro here: > >http://www.danwebb.net/2008/2/3/how-to-use-low-pro-for-jquery > > And get it here: > >http://github.com/danwrong/low-pro-for-jquery/tree/master
[jQuery] Re: jQuery to create dynamic HTML-Content in a table
Could it be failing on your query? jQuery(' > img', this).attr(alt); I beleive that there has to be something before the >. The way it's set, you're saying all img tags that are the child of nothing. jQuery('body > img', this).attr(alt); might be better, but I don't know what you're looking for precisely. -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of KnoxBaby Sent: Thursday, April 24, 2008 9:33 AM To: jQuery (English) Subject: [jQuery] Re: jQuery to create dynamic HTML-Content in a table If i use uid = jQuery(' > img', this).attr(alt); no more code after this line is being executed :( E.g.: [code] $('table tr:eq(0) td:gt(0)').each(function(i) { // If it's a col that contains an (than the has the class 'imgg') if($(this).is('.imgg')) { alert(i); $(this).append('#1'); // Read out img's alt-attribute and save to array uid = jQuery('> img', this).attr(alt); uids[ i ] = uid; // Testoutput to the matched header-column $(this).append('#2'); } }); [/code] #1 is prepended, but #2 not :( And #1 only for the first even though there are more matched td's ... On 24 Apr., 11:52, KnoxBaby <[EMAIL PROTECTED]> wrote: > ah ok cool, thanks so far. I'm gonna try this out! If anybody has more > tipps on how to achieve my goal, just reply :) Thanks a lot!!! > > On 24 Apr., 10:38, "Aaron Heimlich" <[EMAIL PROTECTED]> wrote: > > > On Thu, Apr 24, 2008 at 3:31 AM, KnoxBaby <[EMAIL PROTECTED]> wrote: > > > > E.g. I don't know how to combine $(this) in the each function with > > > another selector. > > > > $(this + ' > img').attr('alt') didn't work to get the content of > > > the 'alt' attribute (which serves to be the UID)... Same with the tid ... > > > Try this: > > > jQuery('> img', this).attr('alt'); > > > jQuery() has a second parameter which allows you specify the "context" > > (basically, where to start searching from) of a selector. It > > defaults to document if not specified. > > > > On 24 Apr., 09:18, KnoxBaby <[EMAIL PROTECTED]> wrote: > > > > I thought to do it perhaps this way: > > > > > -First read the header (columns). Thererfor, I have to provide > > > > something like in it so that jQuery can > > > > read out how many names there are and "save" their uids in an > > > > array > > > > -Secondly: Go throught each and prove wether the first > > > > contains a date mm.dd. (if not, than it's a perhaps the row > > > > with "April 08" etc ...). If yes, save the tid (therefor, > > > > provide something > > > > like: ) > > > > -In this (if it's a date) go through each and insert > > > > the html code with the %tid% and take the uid from the > > > > uids-Array > > > > > Could somebody help me with it since I don't know much about it > > > > :( > > > > > On 23 Apr., 22:13, KnoxBaby <[EMAIL PROTECTED]> wrote: > > > > > > Hello, > > > > > > I have a big table. It has a header on the right side (dates) > > > > > and on the top (names of persons). > > > > > Each date has an ID (tid) and each person an user-id (uid). > > > > > This table is generated in PHP: > > > > > >http://img117.imageshack.us/img117/7624/zwischenablage02ow0.jpg > > > > >(Table > > > > > Layout) > > > > > > Each user can set for himself a preference (Yes, No, Perhaps) > > > > > to a date. > > > > > > Therefor, he hovers in his column a row and the following > > > > > html-code comes up (marked pink): > > > > > >http://img373.imageshack.us/img373/7711/zwischenablage04aa7.jpg > > > > > > To achieve that, I do the following: > > > > > > I use an ID ($cell_id = $tid . $uid) for each cell and > > > > > print-out something like that: > > > > > > > > > > onmouseout="toggleOff($cell_id)"> show here the actual status > > > > > symbol ... > > > > > > > > > > > > > > > Edit: > > > > > ...the 3 links to change status to with their symbols as link > > > > > > > > > > > You can imagine that it's a lot of code. The filesize is about > > > > > 1.3MB and takes ages to load (the person that "runs" the > > > > > date-planer wants it like that; to show up all dates and > > > > > persons on ONE page). Now I removed the code that makes the > > > > > hover and the hidden-div with the change-links and get only about 177Kbyte. > > > > > > Now I ask myself if it would be possible with jQuery to manage > > > > > it somehow ... > > > > > > Any ideas? > > > > > > Thanks > > > -- > > Aaron Heimlich > > Web Developer > > [EMAIL PROTECTED]://aheimlich.freepgs.com/
[jQuery] Re: Jquery and Low Pro - an example
Thanks. -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Thursday, April 24, 2008 9:54 AM To: jQuery (English) Subject: [jQuery] Re: Jquery and Low Pro - an example " Why low pro, when jquery is already unobtrusive? * Behaviors allow me to easily name and encapsulate functionality that I can later reuse. * Behaviors are inheritable, allowing me to group like things together, and avoiding writing chunks of similar code. * Low Pro's implementation of behaviors has Event Delegation built in, vital for larger web apps (unless you want browsers to try and cope with 400 event bindings). * I like the way behaviors look and way they read. My code feels more organized. I can quickly tell what is going on. I write less, and more importantly, I write less mess. " http://sudara.modernthings.net/2008/4/23/oh-behave-the-anatomy-of-jquery-and -low-pro-behaviors :) On Apr 24, 3:29 pm, "Andy Matthews" <[EMAIL PROTECTED]> wrote: > Cab you provide a sentence or two explanation of what Low Pro is, and > what it does? > > -Original Message- > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] > On > > Behalf Of Sudara > Sent: Thursday, April 24, 2008 7:59 AM > To: jQuery (English) > Subject: [jQuery] Jquery and Low Pro - an example > > Hi folks! > > I wrote an article that walks through the construction of a Low Pro > behavior for jquery and explains the reasons behind coupling the > awesome low pro behavioral style with jquery: > > http://sudara.modernthings.net/2008/4/23/oh-behave-the-anatomy-of-jqu... > -low-pro-behaviors > > Low Pro started as a library for Prototype, but was recently ported > over to jQuery by popular demand. > > For me, it is more of an attitude and approach to handling and > organizing a LOT of behaviors. For larger apps, it's great, allowing > you to write readable and reusable code. It also has an inheritance > scheme to save those fingers of yours, provides some goodies like > Event Delegation to cut back on your Event Handler addiction, and ties > in seamlessly with livequery if you want it to. > > You can read about LowPro here: > >http://www.danwebb.net/2008/2/3/how-to-use-low-pro-for-jquery > > And get it here: > >http://github.com/danwrong/low-pro-for-jquery/tree/master
[jQuery] Re: jQuery to create dynamic HTML-Content in a table
Like I said already, the error is that it has to be 'alt' not alt cause it's a string ;) On 24 Apr., 16:55, "Andy Matthews" <[EMAIL PROTECTED]> wrote: > Could it be failing on your query? > > jQuery(' > img', this).attr(alt); > > I beleive that there has to be something before the >. The way it's set, > you're saying all img tags that are the child of nothing. > > jQuery('body > img', this).attr(alt); > > might be better, but I don't know what you're looking for precisely. > > -Original Message- > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On > > Behalf Of KnoxBaby > Sent: Thursday, April 24, 2008 9:33 AM > To: jQuery (English) > Subject: [jQuery] Re: jQuery to create dynamic HTML-Content in a table > > If i use > > uid = jQuery(' > img', this).attr(alt); > > no more code after this line is being executed :( > > E.g.: > > [code] > $('table tr:eq(0) td:gt(0)').each(function(i) { > // If it's a col that contains an (than the has > the class > 'imgg') > if($(this).is('.imgg')) > { > alert(i); > $(this).append('#1'); > > // Read out img's alt-attribute and save to array > uid = jQuery('> img', this).attr(alt); > uids[ i ] = uid; > > // Testoutput to the matched header-column > $(this).append('#2'); > } > }); > [/code] > > #1 is prepended, but #2 not :( And #1 only for the first even though > there are more matched td's ... > > On 24 Apr., 11:52, KnoxBaby <[EMAIL PROTECTED]> wrote: > > ah ok cool, thanks so far. I'm gonna try this out! If anybody has more > > tipps on how to achieve my goal, just reply :) Thanks a lot!!! > > > On 24 Apr., 10:38, "Aaron Heimlich" <[EMAIL PROTECTED]> wrote: > > > > On Thu, Apr 24, 2008 at 3:31 AM, KnoxBaby <[EMAIL PROTECTED]> wrote: > > > > > E.g. I don't know how to combine $(this) in the each function with > > > > another selector. > > > > > $(this + ' > img').attr('alt') didn't work to get the content of > > > > the 'alt' attribute (which serves to be the UID)... Same with the tid > ... > > > > Try this: > > > > jQuery('> img', this).attr('alt'); > > > > jQuery() has a second parameter which allows you specify the "context" > > > (basically, where to start searching from) of a selector. It > > > defaults to document if not specified. > > > > > On 24 Apr., 09:18, KnoxBaby <[EMAIL PROTECTED]> wrote: > > > > > I thought to do it perhaps this way: > > > > > > -First read the header (columns). Thererfor, I have to provide > > > > > something like in it so that jQuery can > > > > > read out how many names there are and "save" their uids in an > > > > > array > > > > > -Secondly: Go throught each and prove wether the first > > > > > contains a date mm.dd. (if not, than it's a perhaps the row > > > > > with "April 08" etc ...). If yes, save the tid (therefor, > > > > > provide something > > > > > like: ) > > > > > -In this (if it's a date) go through each and insert > > > > > the html code with the %tid% and take the uid from the > > > > > uids-Array > > > > > > Could somebody help me with it since I don't know much about it > > > > > :( > > > > > > On 23 Apr., 22:13, KnoxBaby <[EMAIL PROTECTED]> wrote: > > > > > > > Hello, > > > > > > > I have a big table. It has a header on the right side (dates) > > > > > > and on the top (names of persons). > > > > > > Each date has an ID (tid) and each person an user-id (uid). > > > > > > This table is generated in PHP: > > > > > > >http://img117.imageshack.us/img117/7624/zwischenablage02ow0.jpg > > > > > >(Table > > > > > > Layout) > > > > > > > Each user can set for himself a preference (Yes, No, Perhaps) > > > > > > to a date. > > > > > > > Therefor, he hovers in his column a row and the following > > > > > > html-code comes up (marked pink): > > > > > > >http://img373.imageshack.us/img373/7711/zwischenablage04aa7.jpg > > > > > > > To achieve that, I do the following: > > > > > > > I use an ID ($cell_id = $tid . $uid) for each cell and > > > > > > print-out something like that: > > > > > > > > > > > > onmouseout="toggleOff($cell_id)"> show here the actual status > > > > > > symbol ... > > > > > > > > > > > > > > > > > > Edit: > > > > > > ...the 3 links to change status to with their symbols as link > > > > > > > > > > > > > You can imagine that it's a lot of code. The filesize is about > > > > > > 1.3MB and takes ages to load (the person that "runs" the > > > > > > date-planer wants it like that; to show up all dates and > > > > > > persons on ONE page). Now I removed the code that makes the > > > > > > hover and the hidden-div with the change-links and get only about > 177Kbyte. > > > > > > > Now I ask myself if it would be possible with jQuery to manage > > > > > > it somehow ... > > > > > > > Any ideas? > > > > > > > Thanks > > > > -- > > > Aaron Heimlich > >
[jQuery] Re: jQuery to create dynamic HTML-Content in a table
Ah...thought you were just correcting your post. -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of KnoxBaby Sent: Thursday, April 24, 2008 10:18 AM To: jQuery (English) Subject: [jQuery] Re: jQuery to create dynamic HTML-Content in a table Like I said already, the error is that it has to be 'alt' not alt cause it's a string ;) On 24 Apr., 16:55, "Andy Matthews" <[EMAIL PROTECTED]> wrote: > Could it be failing on your query? > > jQuery(' > img', this).attr(alt); > > I beleive that there has to be something before the >. The way it's > set, you're saying all img tags that are the child of nothing. > > jQuery('body > img', this).attr(alt); > > might be better, but I don't know what you're looking for precisely. > > -Original Message- > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] > On > > Behalf Of KnoxBaby > Sent: Thursday, April 24, 2008 9:33 AM > To: jQuery (English) > Subject: [jQuery] Re: jQuery to create dynamic HTML-Content in a table > > If i use > > uid = jQuery(' > img', this).attr(alt); > > no more code after this line is being executed :( > > E.g.: > > [code] > $('table tr:eq(0) td:gt(0)').each(function(i) { > // If it's a col that contains an (than the > has the class > 'imgg') > if($(this).is('.imgg')) > { > alert(i); > $(this).append('#1'); > > // Read out img's alt-attribute and save to array > uid = jQuery('> img', this).attr(alt); > uids[ i ] = uid; > > // Testoutput to the matched header-column > $(this).append('#2'); > } > }); > [/code] > > #1 is prepended, but #2 not :( And #1 only for the first even > though there are more matched td's ... > > On 24 Apr., 11:52, KnoxBaby <[EMAIL PROTECTED]> wrote: > > ah ok cool, thanks so far. I'm gonna try this out! If anybody has > > more tipps on how to achieve my goal, just reply :) Thanks a lot!!! > > > On 24 Apr., 10:38, "Aaron Heimlich" <[EMAIL PROTECTED]> wrote: > > > > On Thu, Apr 24, 2008 at 3:31 AM, KnoxBaby <[EMAIL PROTECTED]> wrote: > > > > > E.g. I don't know how to combine $(this) in the each function > > > > with another selector. > > > > > $(this + ' > img').attr('alt') didn't work to get the content of > > > > the 'alt' attribute (which serves to be the UID)... Same with > > > > the tid > ... > > > > Try this: > > > > jQuery('> img', this).attr('alt'); > > > > jQuery() has a second parameter which allows you specify the "context" > > > (basically, where to start searching from) of a selector. It > > > defaults to document if not specified. > > > > > On 24 Apr., 09:18, KnoxBaby <[EMAIL PROTECTED]> wrote: > > > > > I thought to do it perhaps this way: > > > > > > -First read the header (columns). Thererfor, I have to provide > > > > > something like in it so that jQuery can > > > > > read out how many names there are and "save" their uids in an > > > > > array > > > > > -Secondly: Go throught each and prove wether the first > > > > > contains a date mm.dd. (if not, than it's a perhaps > > > > > the row with "April 08" etc ...). If yes, save the tid > > > > > (therefor, provide something > > > > > like: ) > > > > > -In this (if it's a date) go through each and insert > > > > > the html code with the %tid% and take the uid from the > > > > > uids-Array > > > > > > Could somebody help me with it since I don't know much about > > > > > it :( > > > > > > On 23 Apr., 22:13, KnoxBaby <[EMAIL PROTECTED]> wrote: > > > > > > > Hello, > > > > > > > I have a big table. It has a header on the right side > > > > > > (dates) and on the top (names of persons). > > > > > > Each date has an ID (tid) and each person an user-id (uid). > > > > > > This table is generated in PHP: > > > > > > >http://img117.imageshack.us/img117/7624/zwischenablage02ow0.j > > > > > >pg > > > > > >(Table > > > > > > Layout) > > > > > > > Each user can set for himself a preference (Yes, No, > > > > > > Perhaps) to a date. > > > > > > > Therefor, he hovers in his column a row and the following > > > > > > html-code comes up (marked pink): > > > > > > >http://img373.imageshack.us/img373/7711/zwischenablage04aa7.j > > > > > >pg > > > > > > > To achieve that, I do the following: > > > > > > > I use an ID ($cell_id = $tid . $uid) for each cell and > > > > > > print-out something like that: > > > > > > > > > > > > onmouseout="toggleOff($cell_id)"> show here the actual > > > > > > status symbol ... > > > > > > > > > > > > > > > > > > Edit: > > > > > > ...the 3 links to change status to with their symbols as > > > > > > link > > > > > > > You can imagine that it's a lot of code. The filesize is > > > > > > about 1.3MB and takes ages to load (the person that "runs" > > > > > > the date-planer wants it like that; to show up all dates and
[jQuery] Re: bug in jquery ? css('border') returns undefined
Alexandre, to access the border properties, you have to be more specific.. border has four sides, top - right- bottom - left . and also style, color and width properties so to get your required cssyou need to access (as an example) border-bottom-style . or border-bottom-color . or border-bottom-width jQuery is good , but does not possess a crystal ball... if you think about the border ( and also padding / margin) properties, each border can be a different color/width and style to each of its neighbours, so you have to be explicit in your request hope this helps :-) 2008/4/24 Alexandre Plennevaux <[EMAIL PROTECTED]>: > I wonder why this doesn't work, either it's a but or a flaw in the > documentation: > > > > consider this code: > > http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> > > > > h1 { > background-color: #FF00FF; > color: white; > border: 1px solid red; > } > > > > $(document).ready(function(){ > var mycss = $('h1').css('border'); > alert("hi : " + mycss ); > }); > > > > > hello world > > > ... > > > mycss returns undefined instead of '1px solid red' > > > Unless there is a good reason that i'm unaware of, this seems like a bug > to me, no ? > > Thanks > > Alexandre >
[jQuery] Re: jquery cycle plugin - displaying certain data problem
Argh! So simple and such a big problem when you don't know what to do! :) Thanks for a fast reply, the problem is solved.
[jQuery] Superfish skins...
Hi all, I am new to jquery and superfish, but I am liking what I see. I am wondering if there is a repository of superfish skins to obtain new looks. The demo is making sense, but I see the site www.sharevault.com uses superfish and has a different menu look. I assume the different look is controlled only by the css file. Is there a source for obtaining different looks - it would make sense for everyone to take advantage of the more creative ones out there. Thanks, Phil
[jQuery] jQuery for loop - am I crazy?
I think I may have been looking at this a little too long or something to cause it not to work coz it seems like it should be pretty simple to do, but it no work for me :( What I want to do is loop through all the elements within a certain div and hide all of them except for the first one. Here's my broken code: function initDashboard(){ $(document).ready(function(){ if($(".adminMsgSummary").length > 0){ var theCount = $(".adminMsgSummary dl").length-1; for(z=1;z<=theCount;z++){ var theDl = $(".adminMsgSummary dl"); theDl[z].hide("fast"); } } }); } Any ideas??
[jQuery] Re: Which jQuery method to use in this scenario
Never mind :) $("#loading_icon").show(); $.post("process.asp", $('#myForm').serialize(), function(data) { $("#loading_icon").hide(); $("#login").text(data); }); ...neualex On Apr 23, 11:32 pm, neualex <[EMAIL PROTECTED]> wrote: > Mike, thanks for your response. > > When using this $.post method, the function is called once the data > comes back from the server page. > How can I show a loading icon while the function waits for the data to > be sent back? > > I'd appreciate your support. > > Thanks, > neualex > > On Apr 23, 10:17 pm, "Mike Alsup" <[EMAIL PROTECTED]> wrote: > > > You can do this easily w/o the form plugin also (with jQuery 1.2.2 and > > later): > > > $.post("process.asp", $('#myForm').serialize(), function(data) { > > alert(data); > > > }); > > > or > > > $.ajax({ > > url:'process.asp', > > type: 'POST', > > data:$('#myForm').serialize(), > > success: function(data) {alert(data); } > > > }); > > > Mike > > > On Wed, Apr 23, 2008 at 7:34 PM, Josh Nathanson <[EMAIL PROTECTED]> wrote: > > > > Yeah there's an easy way -- use the Form plugin by Mike Alsup: > > > > http://malsup.com/jquery/form/ > > > > -- Josh > > > > - Original Message - From: "neualex" <[EMAIL PROTECTED]> > > > To: "jQuery (English)" > > > Sent: Wednesday, April 23, 2008 2:17 PM > > > Subject: [jQuery] Which jQuery method to use in this scenario > > > > > Guys, I am new with jQuery, and I was trying to do something very > > > > simple for you at least. > > > > > I am using jQuery against classic ASP pages and I need to send a form > > > > to a ASP page and come back with XML results. > > > > > So, question: Is there an easy way to just identify the FORM and send > > > > all the element values by default without actually building up the > > > > "value string" in the $.post method. > > > > > $.post("process.asp", { name: "neualex", pass: "password" }, > > > > function(data){ alert(data); > > > > }); > > > > > I review the documentation, but to be honest I find it difficult. If > > > > you have samples on the scenario above in PHP or better yet ASP, > > > > please send them to me. > > > > > I'd appreciate your support. > > > > > Thanks, > > > > neualex
[jQuery] Tablesorter - Sorting a column with multiple tds
How do you sort a column that contains multiple tds? Look at this example: first name last name peter parker john hood Clicking on the "first name" header should sort on the second cell of each row.
[jQuery] Re: Field Highlight when comparing form fields
Here is a start. $('input:text:enabled, select:enabled').each(function() { var curFieldID = this.id; var orgnlFieldID = curFieldID + '_orig'; if( $('#' + orgnlFieldID).val() != $('#' + curFieldID).val()) { $(this).addClass('highlightchange'); } }); It would also help if you were able to give the initial selector a context. For example, if all the enabled inputs and selects were within an element with a particular id, you could do: $('#myid').find('input:text:enabled, select:enabled') ... Hope that helps. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Apr 24, 2008, at 5:31 AM, phipps_73 wrote: Hi, I am trying to get a field highlighter working. I have a 2 column layout with a form in each. The form on the left is the 'original' data and the form on the right is newly updated. I would like to look at each form field and compare their values and if different add a class to highlight the change. I have the following code: http://rafb.net/p/UXZHd938.html The forms are quite large and this code basically kills the browser and I get a Slow script warning. Does anyone know if there is a way to speed this up or make it more efficient or should I handle it server side? Cheers Dave
[jQuery] Re: jQuery for loop - am I crazy?
Hi, > function initDashboard(){ > $(document).ready(function(){ > if($(".adminMsgSummary").length > 0){ > var theCount = $(".adminMsgSummary dl").length-1; > for(z=1;z<=theCount;z++){ > var theDl = $(".adminMsgSummary dl"); > theDl[z].hide("fast"); > } > } > }); > } > > > Any ideas?? 1. You should not need $(document).ready in a function. 2. Use What jQuery can do for you ;-) selectors are really powerful function initDashboard() { $('.adminMsgSummary dl:not(:first)').hide(fast); } Christof
[jQuery] Re: Binding submit events via Taconite
Hi Peter, My tests confirmed the following: 1) the need to refresh all behavior after updating DOM. Lets say you have some behavior on table and you add new rows. Those rows will not inherit the events and behavior already attached on table. 2)inline events on added DOM elm will not fire in IE. onclick little redemption could be 3)if there is a space after eval before the CDATA like this " ... updateTable(); On Apr 17, 8:12 pm, lvp1138 <[EMAIL PROTECTED]> wrote: > Hi guys, > > Due to the problem with IE unable to "rebind" onclick events, I am now > binding click events viaTaconite'sEVAL command. > > All I want to do is, when the user clicks on the "submit" button, a > "loading" animation to appear. Before going any further, please be > aware that the way our app is designed, this is the only way to do it. > > So the submit INPUT is similar to: > > eval: > > > $('#imagetest').click(function() > { > $('#anim').show('fast') > return false; > } > ); > > > When I click the image, the animation shows up. That always works fine > so the eval code is correct. > > The EVALs are not necessary with Firefox, since Firefox seems to re- > bind the onclick events called through AJAX. And it works fine 100% of > the time in Firefox, with just the "onclick" on the input button. The > animation always shows up, even if it's just for a second until the > form gets submitted and re-inserted. > > This whole workaround is for IE. > > Any ideas? I also try with "submit" instead of "click". I'm assuming > that the jquery is not getting executed because the form is being > submitted. But why does it work always with just the "onclick" in the > input button? > > I'd greatly appreciate some feedback. > > Peter :)
[jQuery] Re: Binding submit events via Taconite
Hi Peter, My tests confirmed the following: 1) the need to refresh all behavior after updating DOM. Lets say you have some behavior on table and you add new rows. Those rows will not inherit the events and behavior already attached on table. 2)inline events on added DOM elm will not fire in IE. onclick little redemption could be 3)if there is a space after eval before the CDATA like this " ... updateTable(); Jan. On Apr 17, 8:12 pm, lvp1138 <[EMAIL PROTECTED]> wrote: > Hi guys, > > Due to the problem with IE unable to "rebind" onclick events, I am now > binding click events viaTaconite'sEVAL command. > > All I want to do is, when the user clicks on the "submit" button, a > "loading" animation to appear. Before going any further, please be > aware that the way our app is designed, this is the only way to do it. > > So the submit INPUT is similar to: > > eval: > > > $('#imagetest').click(function() > { > $('#anim').show('fast') > return false; > } > ); > > > When I click the image, the animation shows up. That always works fine > so the eval code is correct. > > The EVALs are not necessary with Firefox, since Firefox seems to re- > bind the onclick events called through AJAX. And it works fine 100% of > the time in Firefox, with just the "onclick" on the input button. The > animation always shows up, even if it's just for a second until the > form gets submitted and re-inserted. > > This whole workaround is for IE. > > Any ideas? I also try with "submit" instead of "click". I'm assuming > that the jquery is not getting executed because the form is being > submitted. But why does it work always with just the "onclick" in the > input button? > > I'd greatly appreciate some feedback. > > Peter :)
[jQuery] Re: Can you improve my Bring-to-Front code?
Cool, glad it worked! That's a nice-looking site. One thing, I forgot to use my own optimization: var zmax = 0; $( '.draggable' ).click( function () { $( this ).siblings( '.draggable' ).each(function() { var cur = $( this ).css( 'zIndex'); zmax = cur > zmax ? cur : zmax; // use 'cur' here instead of $( this ).css( 'zIndex') }); $( this ).css( 'zIndex', zmax+1 ); }); - Original Message - From: <[EMAIL PROTECTED]> To: "jQuery (English)" Sent: Wednesday, April 23, 2008 8:23 PM Subject: [jQuery] Re: Can you improve my Bring-to-Front code? > > Wow, brilliant, Josh! :D > > It was missing an extra > }); > at the end, but that's it afaik. > > If you want play with it, it's here (development page; only the first > half-dozen are real divs at present) > http://vanilla-spa.homeholistics.com/products.php > > Nice one :) > > > > On Apr 24, 1:20 am, "Josh Nathanson" <[EMAIL PROTECTED]> wrote: >> Give this a try. It will set the clicked div to the highest current z-index >> plus 1, without disturbing the other divs (untested): >> >> var zmax = 0; >> >> $( '.draggable' ).click( function () { >> $( this ).siblings( '.draggable' ).each(function() { >> var cur = $( this ).css( 'zIndex'); >> zmax = cur > zmax ? $( this ).css( 'zIndex') : zmax; >> }); >> $( this ).css( 'zIndex', zmax+1 ); >> >> }); >> - Original Message - >> From: <[EMAIL PROTECTED]> >> To: "jQuery (English)" >> Sent: Wednesday, April 23, 2008 4:22 PM >> Subject: [jQuery] Re: Can you improve my Bring-to-Front code? >> >> > Bother, I got Scite to fill in all the spaces & returns before >> > posting, too! Sorry the lines got mangled :/ >> >> > On Apr 24, 12:18 am, "[EMAIL PROTECTED]" >> > <[EMAIL PROTECTED]> wrote: >> >> Hi :) >> >> >> Fed up trying to figure out why my wonderful drag layers don't work in >> >> IE, I decided to get on with some more pretty stuff :) As we have >> >> layers fading in & out, and draggable, I reckon users will expect that >> >> clicking on a partially visible layer will bring it to front - like in >> >> desktop windows. >> >> >> So - well, I partially achieved it ;) You can bring a couple of layers >> >> to front, but my snippet doesn't handle the changed order well so it >> >> can't bring a previously-promoted layer further forwards. >> >> >> I'm OK with it for now, but I thought this would be useful for lots of >> >> other jQuery users ... and, if your Javascript is better than mine >> >> (very likely!), perhaps you'll be kind enough to post back an improved >> >> version? >> >> >> Cheers! >> >> Cherry >> >> >> $( '.draggable' ).click( function () { >> >> var i = 1; i++; >> >> otherZ = $ >> >> ( this ).siblings( '.draggable' ).css( 'zIndex' ); >> >> myZ = parseInt(otherZ) + i; >> >> $( this ).css( 'zIndex', myZ ); >> >> reset; >> >> });
[jQuery] Help with forms
Hello everybody. I need help with one form. I created a form which contained data that has to be submitted both to a CRM but before the submit, I have to send an email with the data included in the form. As the CRM is in an external site, I can't manage the data once the form is submitted, How can send an email and then submit the form to the CRM? Thanks
[jQuery] jQuery Child Toggle Problems
I have a subset of links that I am trying to manipulate to create a breadcrumb with in an application. The trouble being that typically it seems the toggle event targets a particular element. I effectively need to only be able to add a class attrbute to only one element out of the subset of anchor links. does anyone have any quick ideas or examples? thanks
[jQuery] Re: jQuery for loop - am I crazy?
How about this? function initDashboard() { $(document).ready(function() { if($(".adminMsgSummary").length) { $(".adminMsgSummary dl:not(first)").hide("fast"); } } } Code not tested, but should work. Carl cloudsteph wrote: > I think I may have been looking at this a little too long or something > to cause it not to work coz it seems like it should be pretty simple > to do, but it no work for me :( What I want to do is loop through all > the elements within a certain div and hide all of them except for > the first one. Here's my broken code: > > function initDashboard(){ > $(document).ready(function(){ > if($(".adminMsgSummary").length > 0){ > var theCount = $(".adminMsgSummary dl").length-1; > for(z=1;z<=theCount;z++){ > var theDl = $(".adminMsgSummary dl"); > theDl[z].hide("fast"); > } > } > }); > } > > > Any ideas?? > > >
[jQuery] jQuery selectors with reference to object
Hi, I am new to jQuery and is curious if this code can be shortened down? It feels like it can, but I couldn't find any way to use jQuery selectors if I have a specific reference to a object. What I want to do is to find the element to the parent of "el" that the id starts with linecolorbox. I know how to do it if I want to find ALL the ones that id start with linecolorbox, but not if I want to start with a specific element as reference (el.parentNode). jQ('.linecolor').each( function() { try { var el = this; if(el.value.match(/^f{6}$/i)) { el.value = ''; } var nodes = el.parentNode.childNodes; for(var i=0; i
[jQuery] Acessing Json Data
Hi, I'm sending an array encoded with Json in my PHP code server-side, but when I try to fetch it in JQuery, I don't know what is the type of the object I'm dealing with, and I can't get any information of it. I tried to access it with object.length, object[index] and so on, but I'm allways getting "undefined". PHP Code: //example array $arr = array ('a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5); echo json_encode($arr); JavaScriptCode: $.ajax ({ type: "POST", url: "/script/", dataType : "json", data: "id="+$("#distritos").val(), success: function(data) { alert(data.lenght); } }); I would be very grateful if anyone could help me, Cheers, Ygor
[jQuery] Re: Acessing Json Data
Try: alert(data['a']); On Apr 24, 2008, at 9:32 AM, Ygor wrote: > > Hi, > > I'm sending an array encoded with Json in my PHP code server-side, but > when I try to fetch it in JQuery, I don't know what is the type of the > object I'm dealing with, and I can't get any information of it. > > I tried to access it with object.length, object[index] and so on, but > I'm allways getting "undefined". > > PHP Code: > > //example array > $arr = array ('a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5); > echo json_encode($arr); > > JavaScriptCode: > > $.ajax > ({ > type: "POST", > url: "/script/", > dataType : "json", > data: > "id="+$("#distritos").val(), > success: function(data) > { > > alert(data.lenght); > } > }); > > > I would be very grateful if anyone could help me, > Cheers, > Ygor
[jQuery] UI Tabs - disable AJAX functionality?
Hi all, I've got a row of five tabs and I'm using Klaus' Tabs plugin to handle them. I want four of them to use the standard tab functionality. The fifth and final tab is actually a link to a different page, but if I try to click this link the page is loaded into the CURRENT page via the tab extension's AJAX functionality. Is there a way the AJAX loading can be disabled so that the browser can follow this link normally instead? Regards, Michael Price
[jQuery] Re: get a inside a
are you preventing the default event from firing? make sure you put return false; in the last line inside the .click() or you can use .click(function(event) { event.preventDefault(); etc... --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Apr 24, 2008, at 7:22 AM, ^AndreA^ wrote: I think it's simple but it doesn't work... to me. ;-) I want to fire an event when I click on that link inside a ... Inside of the there are: So would be the third element but it's the first and unique I tried something like that: $(document).ready(function(){ $("#id_div a").click(function(){ etc... but it doesn't work. I tried also: $(document).ready(function(){ $("#id_div").find("a").click(function(){ etc... and it doesn't work as well... If I do this it works but not the way I want to: $(document).ready(function(){ $("#id_div").click(function(){ etc... because, of course, it fires the event wherever you click inside of the ... instead I want to fire the event just when you click on the link. any idea? thanks in advance!!!
[jQuery] Re: bug in jquery ? css('border') returns undefined
i know all this Guiliano, and according to what i've googled about javascript style.border, it can retrieve the value if that value has been set before, which is the case here. in any case, if in the css, you 've set #id{ border: 1px solid #FF;} then it would only make sense that $('#id').css('border-color'); return #FF yet it does not. If it is not a bug, it's definitely a place for improvement. On Thu, Apr 24, 2008 at 5:41 PM, Giuliano Marcangelo < [EMAIL PROTECTED]> wrote: > Alexandre, > > to access the border properties, you have to be more specific.. > > border has four sides, top - right- bottom - left > . > and also style, color and width properties > > so to get your required cssyou need to access (as an example) > > border-bottom-style . or > border-bottom-color . or > border-bottom-width > > jQuery is good , but does not possess a crystal ball... > > if you think about the border ( and also padding / margin) properties, each > border can be a different color/width and style to each of its neighbours, > so you have to be explicit in your request > > hope this helps :-) > > 2008/4/24 Alexandre Plennevaux <[EMAIL PROTECTED]>: > > I wonder why this doesn't work, either it's a but or a flaw in the >> documentation: >> >> >> >> consider this code: >> >> > http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> >> >> >> >> h1 { >> background-color: #FF00FF; >> color: white; >> border: 1px solid red; >> } >> >> >> >> $(document).ready(function(){ >> var mycss = $('h1').css('border'); >> alert("hi : " + mycss ); >> }); >> >> >> >> >> hello world >> >> >> ... >> >> >> mycss returns undefined instead of '1px solid red' >> >> >> Unless there is a good reason that i'm unaware of, this seems like a bug >> to me, no ? >> >> Thanks >> >> Alexandre >> > > -- Alexandre Plennevaux LAb[au] http://www.lab-au.com
[jQuery] Re: Can you improve my Bring-to-Front code?
Aha, one of my favourite boolean-type if/else thingies ;) Thanks once more, Josh - this not only works faster, it does unexpectedly clever stuff :)) At some point I will have to do some serious optimisation on this site - it leaks like a sub-prime mortgage investor ;) For now, though, I'm loving all the jQuery gorgeousness! Cheers :) On Apr 24, 5:48 pm, "Josh Nathanson" <[EMAIL PROTECTED]> wrote: > Cool, glad it worked! That's a nice-looking site. > > One thing, I forgot to use my own optimization: > > var zmax = 0; > > $( '.draggable' ).click( function () { >$( this ).siblings( '.draggable' ).each(function() { > var cur = $( this ).css( 'zIndex'); > zmax = cur > zmax ? cur : zmax; // use 'cur' here instead of > $( this ).css( 'zIndex') > }); > $( this ).css( 'zIndex', zmax+1 ); > }); > > - Original Message - > From: <[EMAIL PROTECTED]> > To: "jQuery (English)" > Sent: Wednesday, April 23, 2008 8:23 PM > Subject: [jQuery] Re: Can you improve my Bring-to-Front code? > > > Wow, brilliant, Josh! :D > > > It was missing an extra > > }); > > at the end, but that's it afaik. > > > If you want play with it, it's here (development page; only the first > > half-dozen are real divs at > > present)http://vanilla-spa.homeholistics.com/products.php > > > Nice one :) > > > On Apr 24, 1:20 am, "Josh Nathanson" <[EMAIL PROTECTED]> wrote: > >> Give this a try. It will set the clicked div to the highest current > >> z-index > >> plus 1, without disturbing the other divs (untested): > > >> var zmax = 0; > > >> $( '.draggable' ).click( function () { > >> $( this ).siblings( '.draggable' ).each(function() { > >> var cur = $( this ).css( 'zIndex'); > >> zmax = cur > zmax ? $( this ).css( 'zIndex') : zmax; > >> }); > >> $( this ).css( 'zIndex', zmax+1 ); > > >> }); > >> - Original Message - > >> From: <[EMAIL PROTECTED]> > >> To: "jQuery (English)" > >> Sent: Wednesday, April 23, 2008 4:22 PM > >> Subject: [jQuery] Re: Can you improve my Bring-to-Front code? > > >> > Bother, I got Scite to fill in all the spaces & returns before > >> > posting, too! Sorry the lines got mangled :/ > > >> > On Apr 24, 12:18 am, "[EMAIL PROTECTED]" > >> > <[EMAIL PROTECTED]> wrote: > >> >> Hi :) > > >> >> Fed up trying to figure out why my wonderful drag layers don't work in > >> >> IE, I decided to get on with some more pretty stuff :) As we have > >> >> layers fading in & out, and draggable, I reckon users will expect that > >> >> clicking on a partially visible layer will bring it to front - like in > >> >> desktop windows. > > >> >> So - well, I partially achieved it ;) You can bring a couple of layers > >> >> to front, but my snippet doesn't handle the changed order well so it > >> >> can't bring a previously-promoted layer further forwards. > > >> >> I'm OK with it for now, but I thought this would be useful for lots of > >> >> other jQuery users ... and, if your Javascript is better than mine > >> >> (very likely!), perhaps you'll be kind enough to post back an improved > >> >> version? > > >> >> Cheers! > >> >> Cherry > > >> >> $( '.draggable' ).click( function () { > >> >> var i = 1; i++; > >> >> otherZ = $ > >> >> ( this ).siblings( '.draggable' ).css( 'zIndex' ); > >> >> myZ = parseInt(otherZ) + i; > >> >> $( this ).css( 'zIndex', myZ ); > >> >> reset; > >> >> });
[jQuery] Re: Cycle plugin an absolute positioning
Another follow up. I ran into cases where the first few photos were centered fine but the later ones were not. When you refreshed the page they were all centered. If the code is run in jquery ready() the photos may not all be loaded yet. Fix for this is to make sure they have width and height tags.
[jQuery] Trigger a key event with a particular keycode?
I need to manipulate a text input field -- enter a text and press "enter." How do I do that? $('div.name > input').val('value').trigger("keypress", ["13"]); didn't work, obviously Thanks. ari
[jQuery] $("#content").load('http://www.google.com.br') is a possible ?
Hi, I need loading http request inside my div content. I do this it $("#content").load("http://www.google.com.br";); but i hadn't sucess How i can load this page in my div ? tks..
[jQuery] Re: $("#content").load('http://www.google.com.br') is a possible ?
Use an iframe or read up on cross domain ajax. --Erik On Thu, Apr 24, 2008 at 1:27 PM, Luciano Mazzetto <[EMAIL PROTECTED]> wrote: > > Hi, > > I need loading http request inside my div content. > > I do this it > > $("#content").load("http://www.google.com.br";); > > but i hadn't sucess > > How i can load this page in my div ? > > tks.. >
[jQuery] Re: problem with animation()/stop()
Karl Swedberg schrieb: Hey guys, Remy wrote an article about this sort of thing on jqueryfordesigners.com the other day. In it he shows a couple approaches that were probably better than mine, but the one he got from me involved using .fadeTo() this one uses two images, and it might not directly apply, but the trick for me was to use .stop().fadeTo('speed', '1.0') -- or '0' -- if the element is :animated [...] Ok, we figured out an improvement, still rather hackish: This is the show part: if (helper.parent.is(":animated")) helper.parent.stop().fadeTo(settings(current).fade, 1); else helper.parent.is(':visible') ? helper.parent.fadeTo(settings(current).fade, 1) : helper.parent.fadeIn(settings(current).fade); This the hide: if (helper.parent.is(':animated')) helper.parent.stop().fadeTo(tsettings.fade, 0, complete); else helper.parent.stop().fadeOut(tsettings.fade, complete); Depending on your usecase you don't need all that and can just use Karl's solution. You can see the solution in action here, hover the four yahoo-links: http://dev.jquery.com/view/trunk/plugins/tooltip/demo/ Jörn
[jQuery] Re: bug in jquery ? css('border') returns undefined
Dear Alexandre, if we take #id{ border: 1px solid #FF;} , border is shorthand (convenience method) for border-top,border-right,border-bottom,border-left / width - style - color, all in all twelve combinations.if it would make sense for $('#id').css('border-color'); return #FF what would be the expected returned result for the following, #id{ border: 1px solid #FF;} #id{ border-bottom-color:#00} ? 2008/4/24 Alexandre Plennevaux <[EMAIL PROTECTED]>: > i know all this Guiliano, and according to what i've googled about > javascript style.border, it can retrieve the value if that value has been > set before, which is the case here. > > in any case, if in the css, you 've set #id{ border: 1px solid #FF;} > then it would only make sense that $('#id').css('border-color'); return > #FF yet it does not. If it is not a bug, it's definitely a place for > improvement. > > > > > On Thu, Apr 24, 2008 at 5:41 PM, Giuliano Marcangelo < > [EMAIL PROTECTED]> wrote: > >> Alexandre, >> >> to access the border properties, you have to be more specific.. >> >> border has four sides, top - right- bottom - left >> . >> and also style, color and width properties >> >> so to get your required cssyou need to access (as an example) >> >> border-bottom-style . or >> border-bottom-color . or >> border-bottom-width >> >> jQuery is good , but does not possess a crystal ball... >> >> if you think about the border ( and also padding / margin) properties, >> each border can be a different color/width and style to each of its >> neighbours, so you have to be explicit in your request >> >> hope this helps :-) >> >> 2008/4/24 Alexandre Plennevaux <[EMAIL PROTECTED]>: >> >> I wonder why this doesn't work, either it's a but or a flaw in the >>> documentation: >>> >>> >>> >>> consider this code: >>> >>> >> http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> >>> >>> >>> >>> h1 { >>> background-color: #FF00FF; >>> color: white; >>> border: 1px solid red; >>> } >>> >>> >> src="../jquery.latest.js"> >>> >>> $(document).ready(function(){ >>> var mycss = $('h1').css('border'); >>> alert("hi : " + mycss ); >>> }); >>> >>> >>> >>> >>> hello world >>> >>> >>> ... >>> >>> >>> mycss returns undefined instead of '1px solid red' >>> >>> >>> Unless there is a good reason that i'm unaware of, this seems like a bug >>> to me, no ? >>> >>> Thanks >>> >>> Alexandre >>> >> >> > > > -- > Alexandre Plennevaux > LAb[au] > > http://www.lab-au.com
[jQuery] Ajax and CSS classes
Using IE6 / WinXP SP2 / jQuery 1.2.3.pack Given an HTML nav list... Home SCFox and CSS #navtoplist a, #navtoplist a:link, #navtoplist a:visited { float: left; display: block; color: #fff; margin: 0 1px 0 0; padding: 5px 10px; text-decoration: none; letter-spacing: 1px; background: #333 url(../images/button.png) repeat-x; border-bottom: 1px solid #fff; } #navtoplist .current a { background: #5190b2 url(../images/button_current.png) repeat-x; border-color: #5190b2; } ...in an HTML page the li element with a class of current correctly sets the background image of the child 'a' element to a different image if set to a class of 'current'. If I load the menu with $(xxx).load and set the current tab with $("#navtoplist ul li").removeClass(); $("#navtoplist ul li#"+TabID).addClass("current"); the background image changes in FF2, but refuses to in IE6. More simply, plain html in the html page works fine, but when the same html fragment is loaded with ajax and the callback changes the classes of the elements, the background image does not come through for IE6 only, FF2 works fine. Firebug says everything is fine, but the IE developer toolbar says the class has not changed. Any insight appreciated. TIA. ~Shaun Any insight appreciated.
[jQuery] Re: get a inside a
^AndreA^ schrieb: Yes, href="#"... Could it be a problem?!? I put # just in oder to make it a link... This is what I've got into my : Welcome $_user!!! Log out why bind you not direct to the given ID, so: $(document).ready(function(){ $("#log_out_link").click(function(){ etc... -- Viele Grüße, Olaf --- [EMAIL PROTECTED] http://olaf-bosch.de/ http://ohorn.info/ http://www.akitafreund.de/ ---
[jQuery] $('foo').html(newhtml) loses bindings
Hey, Here's an outline of what I'm trying to accomplish: 1) Clone one div into another...maintaining events (works) 2) Append that html into a div (works) 3) Run a search and replace on the new contents (works) 4) Keep the events (doesn't work) Here's the code i'm using: $('.codex-relational-anchor').bind('click',function(){ //If the button is clicked for the first time, clear the divs contents if(iter == 0) $('.codex-relational- form').slideUp('fast').empty(); //Clone the contents of .manytomany-hidden along with their events into .codex-relational-form $('.manytomany-hidden .relational-form- extra').clone(true).appendTo(".codex-relational- form").parent().slideDown('fast'); var html = $('.codex-relational-form').html(); html = html.replace(/\{num\}/g,iter); $('.codex-relational-form').html(html); iter++; return false; }); If I comment out the string replacements, then the events remain.
[jQuery] Re: jQuery for loop - am I crazy?
this should do it: $(document).ready(function() { $('div.adminMsgSummary dl:not(:first)').hide(); }); :-) --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Apr 24, 2008, at 10:53 AM, cloudsteph wrote: I think I may have been looking at this a little too long or something to cause it not to work coz it seems like it should be pretty simple to do, but it no work for me :( What I want to do is loop through all the elements within a certain div and hide all of them except for the first one. Here's my broken code: function initDashboard(){ $(document).ready(function(){ if($(".adminMsgSummary").length > 0){ var theCount = $(".adminMsgSummary dl").length-1; for(z=1;z<=theCount;z++){ var theDl = $(".adminMsgSummary dl"); theDl[z].hide("fast"); } } }); } Any ideas??
[jQuery] broken image url check options on jquery
Hi all, For awhile now I have used a simple onerror check to show an alternative if an img url is broken in the page. Something as shown below. Problem with this script, it will produce an error if the alternative image is actually not available as well. Can any one point me to a jquery solution if available? I was thinking I could probably use the dimensions plugin, get the width of any image on the page and if the width is 0 display the alternative missing image. function ImgError(source) { source.src = "/images/noimage.gif"; source.onerror = ""; return true; } http://jquery.com/images/bibeault_cover150A.jpg"; border="1" height="100" alt="image" onerror="ImgError(this)">
[jQuery] Re: Can you improve my Bring-to-Front code?
> var cur = $( this ).css( 'zIndex'); > zmax = cur > zmax ? cur : zmax; You could also say zmax = Math.max(zmax, this.style.zIndex); I *think* should also work to replace that whole block of code, if you prefer a functional approach: $( this ).css( 'zIndex', Math.max.apply(null, $.map($( this ).siblings( '.draggable' ), function(){ return this.style.zIndex }) );
[jQuery] Re: show/hide nested divs?
Hi Shawn, got it with: $(this).parent().siblings(".boxcontent").hide(); thanks... On Apr 24, 1:54 pm, thekman <[EMAIL PROTECTED]> wrote: > Thanks Shawn, > however it is still not working for me, I presume because .boxcontent > is not a sibling of .closeimage_left but is a sibling of id="box_1" class="box"> > So, should I have to find the parent div then find the > sibling .boxcontent? > any idea how i would do this? > > On Apr 24, 2:07 am, Shawn <[EMAIL PROTECTED]> wrote: > > > oops.. that should probably be a .toggle() instead of a .hide() > > > Shawn > > > Shawn wrote: > > > > $(".closeimage_left").click( function () { > > > $(this).siblings(".boxcontent").hide(); > > > }); > > > > That *should* do the trick. > > > > Shawn > > > > thekman wrote: > > >> Hi all, > > >> I have code something like: > > > >> > > >> > > >> Box Title > > >> Box Title > > >> box content... > > >> > > >> > > >> > > >> Box Title > > >> Box Title > > >> box content... > > >> > > > >> All numbers are dynamically generated from the database. > > > >> What is the best way to use jquery to close the correct content div? > > >> I am presuming I would use something like below, but what do I put in > > >> the click function? > > > >> $(".closeimage_left").click(function() { > > >>});
[jQuery] Re: Retrieving the location of the mouse click within the browser window
Thank you. That is exactly what I was looking for. Thanks On Apr 23, 1:52 pm, "Glen Lipka" <[EMAIL PROTECTED]> wrote: > This might help.http://docs.jquery.com/Tutorials:Mouse_Position > > I also whipped up a simple demo > here:http://www.commadot.com/jquery/mousePosition.php > > Glen > > On Wed, Apr 23, 2008 at 6:40 AM, Kalpers <[EMAIL PROTECTED]> wrote: > > > I am trying to retrieve the location of the mouse click within the > > browser window. When a user clicks on an area that they thought was > > click-able but is not I want to record that location. There is a > > similar application already out there called heat click but I would > > like to create something more simpler in JQuery. I only need to add > > this to a couple of pages to see where there may be some issues with > > the layout of the web page. Right now I am using the following code > > but it it returning the offset of the element which makes perfect > > sense. > > > $(document).ready(function(){ > > >$("#Form2").click(function() { > > > var loc = $(this).offset(); > > > alert(loc.left + " - " + loc.top); > >}); > >}); > > > This always returns 0 - 0 which is the offset of the Form2. > > > Thanks
[jQuery] Re: $('foo').html(newhtml) loses bindings
Check out this FAQ entry: http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_Ajax_request.3F Karl Rudd On Fri, Apr 25, 2008 at 7:50 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hey, Here's an outline of what I'm trying to accomplish: > > 1) Clone one div into another...maintaining events (works) > 2) Append that html into a div (works) > 3) Run a search and replace on the new contents (works) > 4) Keep the events (doesn't work) > > Here's the code i'm using: > > $('.codex-relational-anchor').bind('click',function(){ > > //If the button is clicked for the first time, clear > the divs contents > if(iter == 0) > $('.codex-relational- > form').slideUp('fast').empty(); > > //Clone the contents of .manytomany-hidden along with > their events into .codex-relational-form > $('.manytomany-hidden .relational-form- > extra').clone(true).appendTo(".codex-relational- > form").parent().slideDown('fast'); > > > var html = $('.codex-relational-form').html(); > html = html.replace(/\{num\}/g,iter); > $('.codex-relational-form').html(html); > iter++; > > return false; > }); > > If I comment out the string replacements, then the events remain. >
[jQuery] Re: Trigger a key event with a particular keycode?
$('div.name > input').val('value').trigger("keypress", [{ preventDefault:function(){}, keyCode:13 }]); or in the handler: $('div.name > input').keypress(function( e, keyCode ){ keyCode = keyCode || e.keyCode; ... ... }); ... ... $('div.name > input').val('value').trigger( "keypress", [13] ); Cheers -- Ariel Flesler http://flesler.blogspot.com On 24 abr, 17:38, Ari Koinuma <[EMAIL PROTECTED]> wrote: > I need to manipulate a text input field -- enter a text and press > "enter." > > How do I do that? > > $('div.name > input').val('value').trigger("keypress", ["13"]); > > didn't work, obviously > > Thanks. > > ari
[jQuery] Re: broken image url check options on jquery
Probably this can help you. jQuery.Preload: http://flesler.blogspot.com/2008/01/jquerypreload.html The Placeholder Mode has a notFound option to set an alternative image. Also, using the onComplete event, you can do something specific for those that failed. Cheers -- Ariel Flesler http://flesler.blogspot.com On 24 abr, 20:37, JimD <[EMAIL PROTECTED]> wrote: > Hi all, > > For awhile now I have used a simple onerror check to show an > alternative if an img url is broken in the page. Something as shown > below. Problem with this script, it will produce an error if the > alternative image is actually not available as well. Can any one point > me to a jquery solution if available? I was thinking I could probably > use the dimensions plugin, get the width of any image on the page and > if the width is 0 display the alternative missing image. > > > > > function ImgError(source) > { > source.src = "/images/noimage.gif"; > source.onerror = ""; > return true;} > > > > > http://jquery.com/images/bibeault_cover150A.jpg"; > border="1" height="100" alt="image" onerror="ImgError(this)"> > >
[jQuery] Re: Cycle plugin an absolute positioning
Cycle needs all of the images to be in the DOM - but M. Alsup made an 'add images' option to load images after Cycle has set itself up. I couldn't get it to work right, but I think it was my fault for trying to be clever ;) Thread in this group here: http://tinyurl.com/6s2e2s . It has a link to Mike's 'add' page :) Cherry On Apr 24, 8:56 pm, Ken Gregg <[EMAIL PROTECTED]> wrote: > Another follow up. I ran into cases where the first few photos were > centered fine but the later ones were not. When you refreshed the page > they were all centered. > > If the code is run in jquery ready() the photos may not all be loaded > yet. Fix for this is to make sure they have width and height tags.
[jQuery] post ajax jquery
hi, i tryed do it http://www.malsup.com/jquery/form/#getting-started but my form do submit normal, and not in ajax... so no return callback function somebody can help-me ? thanks code $(document).ready(function() { $('#myForm').ajaxForm(function() { alert("Thank you for your comment!"); var queryString = $('#myForm').formSerialize(); // the data could now be submitted using $.get, $.post, $.ajax, etc $.post('teste.php', queryString); }); }); Name: Comment:
[jQuery] Re: jQuery Child Toggle Problems
Hi, Shaun It's hard to know what you're getting at without an example? The toggle event targets an element, hopefully the one you specified when you called it ;) You can call it by class (thus, a set of elements) and/or by the variety of selector options described in the api docs http://docs.jquery.com/Selectors - and more. >From what you've said, it seems you should be able to specify your selections by identifying them & their position - and probably satisfy your requirement by using something like $( this ).child(identify).do stuff or "each". It would be easier if you posted an example ;) On Apr 24, 5:29 pm, shaun_haage <[EMAIL PROTECTED]> wrote: > I have a subset of links that I am trying to manipulate to create a > breadcrumb with in an application. The trouble being that typically it > seems the toggle event targets a particular element. I effectively > need to only be able to add a class attrbute to only one element out > of the subset of anchor links. > > does anyone have any quick ideas or examples? > > thanks
[jQuery] Append option to section list
I would like to know how to append a new option to a select list. I would also need to retreive the option value and value between the tags, and create a new option: ghhfh test test I would like to be able to insert something like test2 Both 19371 and test2 would be pulled from variables that have been set. Is this possible? I looked at the prepend and append option, but I was unsure how to achieve this. Thanks!
[jQuery] Re: Append option to section list
Nevermind, I actually figured it out. I used: ("#non_academic").append("" + folderName + ""); Where formItemId and folderName were my variables. Worked perfectly! On Apr 24, 9:29 pm, hubbs <[EMAIL PROTECTED]> wrote: > I would like to know how to append a new option to a select list. I > would also need to retreive the option value and value between the > tags, and create a new option: > > > > ghhfh > test > test > > > I would like to be able to insert something like value="19371">test2 Both 19371 and test2 would be pulled from > variables that have been set. Is this possible? > > I looked at the prepend and append option, but I was unsure how to > achieve this. > > Thanks!
[jQuery] Re: jQuery selectors with reference to object
You're obviously way more clued up about Javascript than me, so I'm not even going to try & understand your code! But your question reminds me of one I had a few days ago, so I thought I'd offer it you in case it helps: http://groups.google.com/group/jquery-en/browse_frm/thread/1e5bcd25972c8153# If it doesn't, you're no worse off ;) Cherry On Apr 24, 5:16 pm, tronen <[EMAIL PROTECTED]> wrote: > Hi, I am new to jQuery and is curious if this code can be shortened > down? It feels like it can, but I couldn't find any way to use jQuery > selectors if I have a specific reference to a object. > > What I want to do is to find the element to the parent of "el" that > the id starts with linecolorbox. I know how to do it if I want to find > ALL the ones that id start with linecolorbox, but not if I want to > start with a specific element as reference (el.parentNode). > > jQ('.linecolor').each( > function() { > try { > var el = this; > if(el.value.match(/^f{6}$/i)) { > el.value = ''; > } > var nodes = el.parentNode.childNodes; > for(var i=0; i for(var j=0; > j > if(nodes[i].childNodes[j].id) { > > if(nodes[i].childNodes[j].id.match(/^linecolorbox/)) { > var > colorbox = nodes[i].childNodes[j]; > > if(el.value.match(/^[0-9a-f]{6}$/i)) { > > colorbox.innerHTML = ''; > } > else { > > colorbox.innerHTML = ' X '; > } > } > } > } > } > } catch(e) { > alert(e.message); > } > } > );
[jQuery] Re: bug in jquery ? css('border') returns undefined
hi Giuliano and thanks for holding on :-) I understand your point but the infos published on the W3C website seem to mean that border as a shorthand is retrievable: http://www.w3schools.com/htmldom/prop_style_border.asp On Thu, Apr 24, 2008 at 11:58 PM, Giuliano Marcangelo < [EMAIL PROTECTED]> wrote: > Dear Alexandre, > > if we take #id{ border: 1px solid #FF;} , border is shorthand > (convenience method) for border-top,border-right,border-bottom,border-left / > width - style - color, all in all twelve combinations.if it would > make sense for $('#id').css('border-color'); return #FF > > what would be the expected returned result for the following, > > #id{ border: 1px solid #FF;} > #id{ border-bottom-color:#00} > > ? > > > > 2008/4/24 Alexandre Plennevaux <[EMAIL PROTECTED]>: > >> i know all this Guiliano, and according to what i've googled about >> javascript style.border, it can retrieve the value if that value has been >> set before, which is the case here. >> >> in any case, if in the css, you 've set #id{ border: 1px solid #FF;} >> then it would only make sense that $('#id').css('border-color'); return >> #FF yet it does not. If it is not a bug, it's definitely a place for >> improvement. >> >> >> >> >> On Thu, Apr 24, 2008 at 5:41 PM, Giuliano Marcangelo < >> [EMAIL PROTECTED]> wrote: >> >>> Alexandre, >>> >>> to access the border properties, you have to be more specific.. >>> >>> border has four sides, top - right- bottom - left >>> . >>> and also style, color and width properties >>> >>> so to get your required cssyou need to access (as an example) >>> >>> border-bottom-style . or >>> border-bottom-color . or >>> border-bottom-width >>> >>> jQuery is good , but does not possess a crystal ball... >>> >>> if you think about the border ( and also padding / margin) properties, >>> each border can be a different color/width and style to each of its >>> neighbours, so you have to be explicit in your request >>> >>> hope this helps :-) >>> >>> 2008/4/24 Alexandre Plennevaux <[EMAIL PROTECTED]>: >>> >>> I wonder why this doesn't work, either it's a but or a flaw in the documentation: consider this code: >>> http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> h1 { background-color: #FF00FF; color: white; border: 1px solid red; } >>> src="../jquery.latest.js"> $(document).ready(function(){ var mycss = $('h1').css('border'); alert("hi : " + mycss ); }); hello world ... mycss returns undefined instead of '1px solid red' Unless there is a good reason that i'm unaware of, this seems like a bug to me, no ? Thanks Alexandre >>> >>> >> >> >> -- >> Alexandre Plennevaux >> LAb[au] >> >> http://www.lab-au.com > > > -- Alexandre Plennevaux LAb[au] http://www.lab-au.com