Re: [jQuery] ajax form plugin submit button
All of your forms must have an event handler associated with their onSubmit event. These event handlers need to do their AJAX stuff, and then stop the browser from doing the default action by returning false. Since you are creating these forms AFTER the page has already loaded, you need to either create this event handler as part of creating the form, or use $().live() in order to capture the event for ALL forms, present or future. However, I don't know that .live will work for that, I haven't tried, you will have to experiment. On Wed, Jan 6, 2010 at 11:06 PM, Alex wrote: > Hello everyone, > > I have a problem submitting a form tag with submit buttons. many of > the scripts used in that page require the name of these submit buttons > to work correctly. I already read about the serialize function and > submit buttons so tried the form plugin as suggested on the jQuery > page but i can't get this to work. > > On a single site there is no problem using the plugin but the site is > only loaded at the beginning, after that everything works with ajax > requests and the page is never reloaded. The response of nearly all > ajax requests is a new page which is loaded into a draggable div so > that the site works like an OS. My problem is that the form tags that > are contained in these responses aren't submitted by the plugin, they > have their normal function and reload the webpage which is > catastrophical for that layout. > > If you need more information please let me know. > Sorry for my english ;-) > -- John Arrowwood John (at) Irie (dash) Inc (dot) com John (at) Arrowwood Photography (dot) com John (at) Hanlons Razor (dot) com -- http://www.irie-inc.com/ http://arrowwood.blogspot.com/
Re: [jQuery] ajax form plugin submit button
Please give us a demo page or code which can help us debug the problem. Thanks & Regards, Dhruva Sagar. On Thu, Jan 7, 2010 at 12:36 PM, Alex wrote: > Hello everyone, > > I have a problem submitting a form tag with submit buttons. many of > the scripts used in that page require the name of these submit buttons > to work correctly. I already read about the serialize function and > submit buttons so tried the form plugin as suggested on the jQuery > page but i can't get this to work. > > On a single site there is no problem using the plugin but the site is > only loaded at the beginning, after that everything works with ajax > requests and the page is never reloaded. The response of nearly all > ajax requests is a new page which is loaded into a draggable div so > that the site works like an OS. My problem is that the form tags that > are contained in these responses aren't submitted by the plugin, they > have their normal function and reload the webpage which is > catastrophical for that layout. > > If you need more information please let me know. > Sorry for my english ;-) >
[jQuery] ajax form plugin submit button
Hello everyone, I have a problem submitting a form tag with submit buttons. many of the scripts used in that page require the name of these submit buttons to work correctly. I already read about the serialize function and submit buttons so tried the form plugin as suggested on the jQuery page but i can't get this to work. On a single site there is no problem using the plugin but the site is only loaded at the beginning, after that everything works with ajax requests and the page is never reloaded. The response of nearly all ajax requests is a new page which is loaded into a draggable div so that the site works like an OS. My problem is that the form tags that are contained in these responses aren't submitted by the plugin, they have their normal function and reload the webpage which is catastrophical for that layout. If you need more information please let me know. Sorry for my english ;-)
[jQuery] Re: Firebug gives a "$ is not defined" error
FireBug (http://www.getfirebug.com) would be a huge help for you to find out "why" On Jan 6, 11:31 pm, elvis_wu wrote: > The same pages could be run correctly on both IE and Firefox untill > yesterday. Now on IE they can still run normally, but on Firefox I got a "$ > is not defined" error. I didn't change the reference to the jquery library > in these pages and neither move the jquery library. I'm really confused. > Could any one tell me why? > -- > View this message in > context:http://old.nabble.com/Firebug-gives-a-%22%24-is-not-defined%22-error-... > Sent from the jQuery General Discussion mailing list archive at Nabble.com.
Re: [jQuery] How to gain reference to hyperlink that is clicked
Ah, (this), I'm a newbie to that in jQuery. Thanks. Charlie Griefer wrote: > > > > > > $(document).ready(function() { > $('.myButton').click(function() { >alert($(this).attr('id')); >// alert(this.id) <-- should also work > } > }); > > > Notice that I added a class="myButton" to each button element, and set the > listener for $('.myButton').click(), which listens for a click event on > any > element that matches that selector. > > Within the function triggered by the click event, $(this) or this are both > references to the element that triggered the click. > > On Tue, Jan 5, 2010 at 12:35 PM, CoffeeAddict wrote: > >> >> I understand that I can use the .click() method on a hyperlink element. >> But >> how do I know which element was clicked? First I have to gain reference >> to >> the hyperlink's ID. >> >> So lets say I have a page of hyperlinks like this in view source: >> >> ...someurl somebutton >> ...someurl somebutton >> ...someurl somebutton >> ...someurl somebutton >> >> when a user clicks addButton1, how do I know it's addButton1 that was >> referenced so that I can now apply a .click() event on it? >> -- >> View this message in context: >> http://old.nabble.com/How-to-gain-reference-to-hyperlink-that-is-clicked-tp27026713s27240p27026713.html >> Sent from the jQuery General Discussion mailing list archive at >> Nabble.com. >> >> > > > -- > Charlie Griefer > http://charlie.griefer.com/ > > I have failed as much as I have succeeded. But I love my life. I love my > wife. And I wish you my kind of success. > > -- View this message in context: http://old.nabble.com/How-to-gain-reference-to-hyperlink-that-is-clicked-tp27026713s27240p27046016.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Firebug gives a "$ is not defined" error
The same pages could be run correctly on both IE and Firefox untill yesterday. Now on IE they can still run normally, but on Firefox I got a "$ is not defined" error. I didn't change the reference to the jquery library in these pages and neither move the jquery library. I'm really confused. Could any one tell me why? -- View this message in context: http://old.nabble.com/Firebug-gives-a-%22%24-is-not-defined%22-error-tp27044083s27240p27044083.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: (autocoplete) problem with fast typers:)
Hi Richard, I'm not sure if this fits your bill, but maybe the reason people type really fast is because they already know what they're searching for? I mean I might sound a little simple minded but yes, I don't use the autocomplete suggestions anymore when I know what I'm going to type. (If you work with an autocomplete/intellisense IDE you'd know what I mean) Cheers, OJ On Jan 6, 10:10 am, Richard KLINDA wrote: > Hello All! > > I have a problem with the autocomplete plugin, if one types fast enough > to hit enter before the autocomplete suggestions show up (which is not > hard at all), then autocomplete doesn't run the result handler (and it > definitely should), so nothing happens. > > So when user types "foo" into the search input field, he has to wait for > the suggestions to show up, only after this he can press enter to get > the results. Is there a workaround for that? > > Thanks, > Richard
[jQuery] Re: Go through XML nodes only 1 level deep
Ahah, too much stale eggnog. var option = { error: function(request, status, error) { alert(error); }, success: function(data, status) { var xml = $(data); alert(xml.find('City').text()); }, dataType: "xml", type: "GET", url: "your url here" }; $.ajax(option); This code works for me. On Jan 7, 2:50 pm, Steven Yang wrote: > just making sure > > you are not able to parse the xml at all right? > i believe for IE you have to make sure you server returns the correct > content type like text/xml to client inorder for you to parse > > hope this help > > On Thu, Jan 7, 2010 at 9:30 AM, Jules wrote: > > For some reason, it works on firefox (3.5.6) and doesn't work in ie > > 6.0 and 8.0 > > > On Jan 7, 6:39 am, Frank Peterson wrote: > > > I'm grabbing an XML file with jQuery like this: > > > > $(document).ready(function(){ > > > $.ajax({ > > > type: "GET", > > > url: "http://ipinfodb.com/ip_query.php?ip=74.125.45.100";, > > > dataType: "xml", > > > success: function(xml) { > > > //$(xml).find().each(function(){ > > > var city = $(xml).find("City").text(); > > > /* > > > $('').html > > > (''+title+'').appendTo('#page-wrap'); > > > $(this).find('desc').each(function(){ > > > var brief = $(this).find('brief').text(); > > > var long = $(this).find('long').text(); > > > $('').html(brief).appendTo > > > ('#link_'+id); > > > $('').html(long).appendTo > > > ('#link_'+id); > > > }); > > > */ > > > alert(city) > > > //}); > > > } > > > }); > > > > }); > > > > The XML file looks like this > > > > > > > > > 74.125.45.100 > > > OK > > > US > > > United States > > > 06 > > > California > > > Mountain View > > > 94043 > > > 37.4192 > > > -122.057 > > > -8 > > > -8 > > > -7 > > > > > > > But I can't get it to pull the data out.
Re: [jQuery] How to unsubscribe from this group?
On Jan 5, 2010, at 7:47 PM, Chikkis Corner wrote: Please unsubscribe me from this group. Hi, The following instructions are paraphrased from: http://groups.google.com/support/bin/answer.py?hl=en&answer=46608 You can unsubscribe from a group through the web interface or via email. To unsubscribe through the web interface, just click the "Edit my membership" link on the right-hand side of the group's homepage at http://groups.google.com/group/jquery-en/ . Then click the "Unsubscribe" button on the page that appears. To unsubscribe via email, send an email to jquery-en+unsubscr...@googlegroups.com --Karl Karl Swedberg www.englishrules.com www.learningjquery.com
Re: [jQuery] Re: Go through XML nodes only 1 level deep
just making sure you are not able to parse the xml at all right? i believe for IE you have to make sure you server returns the correct content type like text/xml to client inorder for you to parse hope this help On Thu, Jan 7, 2010 at 9:30 AM, Jules wrote: > For some reason, it works on firefox (3.5.6) and doesn't work in ie > 6.0 and 8.0 > > On Jan 7, 6:39 am, Frank Peterson wrote: > > I'm grabbing an XML file with jQuery like this: > > > > $(document).ready(function(){ > > $.ajax({ > > type: "GET", > > url: "http://ipinfodb.com/ip_query.php?ip=74.125.45.100";, > > dataType: "xml", > > success: function(xml) { > > //$(xml).find().each(function(){ > > var city = $(xml).find("City").text(); > > /* > > $('').html > > (''+title+'').appendTo('#page-wrap'); > > $(this).find('desc').each(function(){ > > var brief = $(this).find('brief').text(); > > var long = $(this).find('long').text(); > > $('').html(brief).appendTo > > ('#link_'+id); > > $('').html(long).appendTo > > ('#link_'+id); > > }); > > */ > > alert(city) > > //}); > > } > > }); > > > > }); > > > > The XML file looks like this > > > > > > 74.125.45.100 > > OK > > US > > United States > > 06 > > California > > Mountain View > > 94043 > > 37.4192 > > -122.057 > > -8 > > -8 > > -7 > > > > > > But I can't get it to pull the data out. >
[jQuery] Need your opinion you ALL!!!
Hello everyone, Someone wants me to use FULL DIRECTORY PATHS for every page and script for a website I just completed. I argued that it would slow down the website for users... I prefer relative paths such as "/src/" and "/img/". Am I wrong to say this? Is there really a difference in performance with speed whether I use absolute or relative paths? Love to hear your opinion... Thanks. Erik BTW - the website was transferred from WINDOWS SERVER to a UNIX... I actually preferred Windows. I'm dealing with a Network Admin that doesn't know web design...
[jQuery] Re: jQuery animations VS Mootools animations
Rey Bango: Ok, i understand you, i not want to resolve that, IS JUST FOR LEARNING, we need to observe and study that in group. Now, answer me a question: Do you know exactly diference features in animation frameworks in both? Is hard to me study code by code, its hard mathematics. You is the developer in framework. In past jquery uses moo.fx for animation is true? I see in jquery code the comment of john resign: 'This is a modification of moo.fx'. Ok. its a modification, but the logic I supose is same. What do you say? And Now, i don't know how is the jquery animation code. Help me if is possible? IS JUST FOR LEARNING. On Jan 6, 6:58 pm, Rey Bango wrote: > They both seem to run equally smooth to me. I saw occasional jumpiness > on both demos. > > Seriously, you've been on this specific topic since early November and > just doing a Google search shows that you've asked a ton of people the > same question. If you feel that jQuery's effects could be smoother, I > urge you to help out the project by investing the time to tackle > whatever concerns you have. Doing that will not only ease your > concerns but helps out everyone in the community. > > Rey... > > > > > > On Wed, Jan 6, 2010 at 3:43 PM, Acaz Souza wrote: > > MooTools:http://www.jsfiddle.net/4vnya/ > > jQuery:http://www.jsfiddle.net/eFbwJ/36/ > > (Compare the code, the effects. You decide.) > > > Why mootools is more smooth than jquery?
[jQuery] Re: Why mootools animations is more smooth than jquery?
I'm using Windows 7 Firefox 3.5, mootools is great, is more smoth, is more sweet than jquery animations, i don't know why. I'm tested in Chrome and the animations was great for both, but in firefox not. And Opera, mootools is more sweet than jquery. Scott Sauyet: I'm trying to get information. Is just for learning this interesting point. What the matematics logic of both in animation framework. They use the same logic? IS JUST FOR LEARNING THIS INTERESTING POINT. On Jan 6, 7:38 pm, "Jeffrey Kretz" wrote: > They seem about the same to me as well, FF3.5.6 on Win7 > > -Original Message- > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On > > Behalf Of Scott Sauyet > Sent: Wednesday, January 06, 2010 1:29 PM > To: jQuery (English) > Subject: [jQuery] Re: Why mootools animations is more smooth than jquery? > > On Jan 6, 3:44 pm, Acaz Souza wrote: > > MooTools:http://www.jsfiddle.net/4vnya/ > > jQuery:http://www.jsfiddle.net/eFbwJ/36/ > > (Compare the code, the effects. You decide.) > > > Why mootools is more smooth than jquery? > > It's not, at least not in my FF3.5.6 on Win XP. > > Haven't you been here asking this question before? Are you trying to > get information or prove some obscure point? > > -- Scott
Re: [jQuery] Re: Need help learning
Thank you, you have help out so much On Jan 6, 2010, at 6:14 PM, Šime Vidas wrote: > If you want to manipulate with the DIV inside the $.get function, you > can declare a local variable and put the reference to DIV in it... > > (function($) { >$.fn.myPlugin = function() { > >this.each(function() { >alert(this.id); > >var that = this; > >$.get("return.php",function(data) { >// now "this" is "that" >alert(that.id); >//do something with "this" & the > "data" >}); >}); >return this; >}; > > })(jQuery); > > > You don't have to call the variable "that", but it's a nice name, > isn't it? :)
[jQuery] jQuery and IE 8
Hello guys, I'm developing a web site for a friend and I'm worried about a problem. The Url is: http://www.futuragames.com.br/radioboy As you will see, it works perfectly on Firefox and Google Chrome, but I get a mysterious when running on IE 8. The error message is: "Invalid argument" on line 53 of the jQuery library file. I don't know what does it mean and how can I figure it out. Can anyone help me, please? Thanks!
[jQuery] jquery google map namespace conflict?
I am toying with this plugin (http://www.mayzes.org/ googlemaps.jquery.html#examples) and have found what I think is a namespace conflict (I am by no means expert and I could be wrong...) Here is how to see it. I am using Google api loader thus: http://www.google.com/jsapi?key=mykey";> google.load("maps", "2"); google.load("jquery", "1"); I have some code that was working previously that used loader and was doing an address lookup using the Geocoder object, like this: function showAddress(address) { geocoder = new google.maps.ClientGeocoder(); if (geocoder) { geocoder.getLatLng( address, function(point) { if (!point) { alert(address + " not found"); } else { alert('point--'+point); } } ); } } This worked great. What I am now trying to do is use the plugin to handle the map update and display. I have a reference to the plugin and can instantiate it. I know this 'cause I have an alert near the top of the plugin like so: jQuery.fn.googleMaps = function(options) { if (!window.GBrowserIsCompatible || !GBrowserIsCompatible()) alert('is compat'); ... The issue seems to be that if I leave "google.load("maps", "2");" the plugin will not load and I will not get my "is compat" alert. If I comment out "// google.load("maps", "2");" then I get the "is compat" message but I cannot perform my reverse lookup. Any insight that anyone can provide on overcoming this conflict would be appreciated. I have spent the last several hours scouring the web to see if this is a common jquery / google maps issue and cannot seem to find any other complaints. TIA.
[jQuery] Re: Go through XML nodes only 1 level deep
For some reason, it works on firefox (3.5.6) and doesn't work in ie 6.0 and 8.0 On Jan 7, 6:39 am, Frank Peterson wrote: > I'm grabbing an XML file with jQuery like this: > > $(document).ready(function(){ > $.ajax({ > type: "GET", > url: "http://ipinfodb.com/ip_query.php?ip=74.125.45.100";, > dataType: "xml", > success: function(xml) { > //$(xml).find().each(function(){ > var city = $(xml).find("City").text(); > /* > $('').html > (''+title+'').appendTo('#page-wrap'); > $(this).find('desc').each(function(){ > var brief = $(this).find('brief').text(); > var long = $(this).find('long').text(); > $('').html(brief).appendTo > ('#link_'+id); > $('').html(long).appendTo > ('#link_'+id); > }); > */ > alert(city) > //}); > } > }); > > }); > > The XML file looks like this > > > 74.125.45.100 > OK > US > United States > 06 > California > Mountain View > 94043 > 37.4192 > -122.057 > -8 > -8 > -7 > > > But I can't get it to pull the data out.
[jQuery] Re: Need help learning
If you want to manipulate with the DIV inside the $.get function, you can declare a local variable and put the reference to DIV in it... (function($) { $.fn.myPlugin = function() { this.each(function() { alert(this.id); var that = this; $.get("return.php",function(data) { // now "this" is "that" alert(that.id); //do something with "this" & the "data" }); }); return this; }; })(jQuery); You don't have to call the variable "that", but it's a nice name, isn't it? :)
[jQuery] Re: Need help learning
this refers to different objects depending on where we are in the code... (function($) { $.fn.myPlugin = function() { // here "this" refers to the jQuery object on which the myPlugin method was called upon this.each(function() { // here "this" refers to the matched elements in the jQuery object... in your example, you matched every DIV element, so "this" refers to each node in the DOM tree that has type = ELEMENT_NODE nodeName = "DIV" alert(this.id) $.get("return.php",function(data) { // here "this" refers to the options object for the AJAX request you may print it out with this code: for (prop in this) { $("div").append(prop + " = " + this[prop] + ""); } alert(this.id); //do something with "this" & the "data" }); }); return this; }; })(jQuery);
[jQuery] Re: jQuery animations VS Mootools animations
I was wondering why jquery was smoother than mootools
[jQuery] Need help learning
I have been reading and playing around with jQuery and can do somethings, but making a plugin is hurting my brain. Here is what I have. (function($) { $.fn.myPlugin = function() { this.each(function() { alert(this.id) $.get("return.php",function(data) { alert(this.id); //do something with "this" & the "data" }); }); return this; }; })(jQuery); $(document).ready(function(){ $("div").myPlugin(); }); Here is what I don't understand. The first alert shows the id, but the second one does not, It alerts "undefined". I want to be able to modify the object ("this) after receiving the data from the ajax.
[jQuery] Re: ie8 and title text value
The, html() method works in all browsers... text() = returns the concatenated innerHTML properties of all matched elements html() = returns the innerHTML property of the first matched element Generally you don't use text() to retreive the contents of an element... BUT, if you want to write to the innerHTML property, then ... html("blablabla") = sets the innerHTML property to the given string on every matched element text("blablabla") = sets the innerHTML property to the given string on every matched element, AND escapes < and >
Re: [jQuery] Position div accounting for screen size/resize
Bind a handler for the resize event like so: $(window).bind('resize', function() { ...}); Have a look at this thread: http://groups.google.com/group/jquery-en/browse_thread/thread/4a00d513c63f5c00?pli=1 On Wed, Jan 6, 2010 at 11:08 AM, kevinkace wrote: > Can you change a position of a div, based on screen size/resize with > jquery? Something like > > if (browser>= sitecontainerwidth) > { > left:50%; > margin-left: 20px; > } > else > { > left: 0%; > margin-left: 600px; > } > > I have a centered layout (div{margin: top auto;}) with a BG image. > There's another div (with a background design) that needs to overlay > on the BG, but off center. > > Figure of what the problem: > http://www.kacevisual.com/files/Div-difficulties.gif >
Re: [jQuery] form validation
Set up the handler when the form is created: $("#the_form_id").validate(); You might also want to have a look at the Jeditable plugin: http://www.appelsiini.net/projects/jeditable On Wed, Jan 6, 2010 at 10:25 AM, John Albright wrote: > Is it possible to use the jquery form validation plugin (http:// > bassistance.de/jquery-plugins/jquery-plugin-validation/) to validate a > form that was inserted into the page via javascript? What I'm trying > to do is display a person's address, which is contained in a span tag, > and give them the option to edit it. If they click the edit button, > I'm changing the span to a form tag with jQuery and turning the parts > of the address into text boxes with the values filled in. The problem > I'm having is that since the form doesn't exist from the very > beginning, the validate function isn't getting assigned to it, and > when the form is created and submitted, it doesn't get validated. Can > I somehow make the plugin assign the validate function to the form > when the edit button is clicked, or is that not possible? >
Re: [jQuery] Re: urgent help
Or, at minimum, an example or two of the errors encountered. On Wed, Jan 6, 2010 at 7:13 AM, MOZ wrote: > link to demo? > > On Jan 6, 3:49 am, Sugi wrote: >> I am using Jquery plugins like flowplayer,fancy plugin for image and >> video stuffs...It creates lot of erros with IE 6. Can any one help to >> fix compatability issue with IE6? Please reply..Very urgent >
Re: [jQuery] highlighting
$target.css('...') Or, better: $target.addClass('SomeClassName'); On Tue, Jan 5, 2010 at 10:35 AM, metalmini wrote: > Hi guys and galls, > > Im not really a jquery programmer but i build lots of sites and i love > the jquery plugins that i can easily copy and paste. So anyway im > building a new site and i am using alot of jquery to emprove > usability. > > So i am using a little script that scrolls easy to the a> html tag. > > [code] > > $(document).ready(function(){ > $('a[href*=#]').click(function() { > if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^ > \//,'') > && location.hostname == this.hostname) { > var $target = $(this.hash); > $target = $target.length && $target > || $('[name=' + this.hash.slice(1) +']'); > if ($target.length) { > var targetOffset = $target.offset().top; > $('html,body') > .animate({scrollTop: targetOffset}, 1000); > return false; > } > } > }); > }); > > [/code] > > This is not my own code, i found it. As i said im not a jquery pro. > > Anyway i was wondering if it is possible to somehow highlight the div > class with a background color to make it stand out more? Something > that i can add to this little piece of code? > > If there are things that i should include please let me know. > > Thank you very much in advance. > > Kind regards, > > Michael >
[jQuery] Re: Help with change event
Hehe :) Look, event methods work like this you pass in a function, and that function will be executed then the event occurs... $("select").change(function() { // code that gets executed when change event the occurs on any SELECT element }); But, if you leave out the argument, then the change method does something completely different... it triggers the event... (as if you changed the selected OPTION(s) yourself) $("select").change(); What the guys at jQuery did in that example is, they first defined the onchange handler, and then triggered it right away... So you got that red "Candy Caramel" text on page load without having to change the SELECT...
[jQuery] Re: How do i get this mega dropdown with jQuery??
Here, use this: http://vidasp.net/jquery-example7.html The HTML code is super-simple - only ULs and two wrapper DIVs Also, the menu streches to the full (available) width automatically (like a table)
[jQuery] Re: Help with change event
Thanks John, "The last .change() fires the event." Looking through the other documentation, it appears that the other event methods do not need a similar trailing method to fire the event, only change. I've even did a test where I didn't include the last change(), and it appeared to work. Could you please elaborate on what by "fires the event". Thanks!
[jQuery] Re: Add a second trigger in this function
I think you just forgot the last brackets on your hover method: $("div.tvbutton").hover(function () { $("div.tv").trigger('hover'); }) <--- Forgotten This could be optimized a little better by using id's, or at last saving a a reference to the "div.tv", so that you don't have to make search for the div every time (unless you're using ajax ofcourse), but this should work now at last :-) / Johan On Jan 6, 9:42 pm, Jordan wrote: > Thanks for the insight Johan! When I implemented that though, it just > added the hover cross fade to the other div as well. I am looking for > a way to make the 2nd div JUST trigger the first. I was looking at the > page you linked to and I am messing around with something like the > following... although I can't get it to work. Any thoughts? > > $(document).ready(function () { > $('div.tv, div.desk, div.phone').hover(function () { > //hover in > var div = $('> div', this); > > if (div.is(':animated')) { > div.stop().fadeTo(500, 1); > } else { > div.fadeIn(250); > } > }, function () { > // hover out > var div = $('> div', this); > if (div.is(':animated')) { > div.stop().fadeTo(1000, 0); > } else { > div.fadeOut(1000); > } > }); > $("div.tvbutton").hover(function () { > $("div.tv").trigger('hover'); > > }); > > On Jan 5, 4:33 pm, Johan Borestad wrote: > > > Hi! > > There are a number of nice implementations you could use for this. > > Example the jQuery trigger.http://docs.jquery.com/Events/trigger > > But for now, the simpliest solution is just to add another selector > > like this > > > $('div.example, div.tv').hover( . > > > / Johan > > > On Jan 5, 8:33 pm, Jordan wrote: > > > > I recently implemented the Image Cross Fade Transition (http:// > > > jqueryfordesigners.com/image-cross-fade-transition/) > > > > It works great, and I'm hoping to add to the code to enhance the > > > functionality. Currently, if I hover over the image, it runs the cross > > > fade transition, which I would like to keep. I have another div on the > > > page that I would like to trigger the first instance when hovered over > > > as well. Is there a good way to add this? > > > > Here's what I'm using for the first instance: > > > > $(document).ready(function () { > > > $('div.tv').hover(function () { > > > //hover in > > > var div = $('> div', this); > > > > if (div.is(':animated')) { > > > div.stop().fadeTo(500, 1); > > > } else { > > > div.fadeIn(250); > > > } > > > }, function () { > > > // hover out > > > var div = $('> div', this); > > > if (div.is(':animated')) { > > > div.stop().fadeTo(1000, 0); > > > } else { > > > div.fadeOut(1000); > > > } > > > });
Re: [jQuery] Help with change event
The last .change() fires the event. On Wed, Jan 6, 2010 at 6:43 AM, NotionCommotion wrote: > > > I am interested in the event change, and am looking at > http://docs.jquery.com/Events/change. > > $("select").change(function () { > var str = ""; > $("select option:selected").each(function () { >str += $(this).text() + " "; > }); > $("div").text(str); >}) >.change(); > > It all makes sense except for the very last change(). Can anyone > explain the purpose of this line? > > Thank you > -- John Arrowwood John (at) Irie (dash) Inc (dot) com John (at) Arrowwood Photography (dot) com John (at) Hanlons Razor (dot) com -- http://www.irie-inc.com/ http://arrowwood.blogspot.com/
Re: [jQuery] Re: ajax image
So, why can't you just create a new node with a src attribute? It will automatically download the image in the background, much like with AJAX. Is the problem that you want to ensure that the image is fully downloaded before you try to display it? Have you tried $(imgTag).ready(...)? (Don't know if that works or not, never tried it) On Wed, Jan 6, 2010 at 8:14 AM, Mean Mike wrote: > > > So you are trying to use jQuery's ".load()" functionality with an > > actual image (i assume that your php sets the content type to > image/ > > jpeg, image/gif, etc and writes out the actual binary image > data) ? > > YES ! that is correct. > > > that's not going to work, as the ".load()" loads the result of the > > Ajax call into the innerHtml of DOM object > > I'm assuming thats why I get Array > > > I don't know though, you're talking "same function" but have > posted > > about three different functions so far, $.ajax, .load, and your > custom > > function > mmm sorry for the confusion > > I wanted to see if i could just get it to work with load that's why I > mentioned it .. > > > but bottom line is, the $.ajax call which ultimately > > gets called wouldn't be a replacement for , > > bummer 8 ^ ( > > > *unless* you wanted to use data url vales as image sources > (like:http://www.websiteoptimization.com/speed/tweak/inline-images/), > but > > the problem with that, like almost all cool ideas like that link > > shows, is it doesn't work with IE > > neat concept but not doable trying to stick with ajax > > Thanks for your help > Mean Mike > -- John Arrowwood John (at) Irie (dash) Inc (dot) com John (at) Arrowwood Photography (dot) com John (at) Hanlons Razor (dot) com -- http://www.irie-inc.com/ http://arrowwood.blogspot.com/
[jQuery] Re: jQuery BlockUI Plugin (v2) add onBlock()
> Hi all, > in this plug-in I need a function like onUnblock but on completed > fadein.. > can Add this function? ok. http://www.malsup.com/jquery/block/#download
[jQuery] Re: ie8 and title text value
I think document.title works on all browsers.
[jQuery] ie8 and title text value
Hi I'm trying to read thevalue from a page head. All browsers I've tried are happy with $('title').text() apart from ie8 which returns nothing. Am I doing something wrong, or is it IE8 that's wrong? Is there a workaround? Thanks Graham
[jQuery] Open Ajax jQuery remote contract-6 weeks
Hello, I hope it's OK to post this here. If not, please let me know as I don't want to disrespect the group in a any way. If so, here is an exciting contract for about 6 weeks that can be done remotely. My client in NYC needs a full time Ajax jQuery resource. They are trying to get ready to release to beta users on Feb 15 (they are currently in alpha testing) and we have many bugs to close before that time. They are looking for someone to start right away. The resource would be working with the main Ajax resource that is out of St. Louis. This position can work remotely of course. Here’s something about the project: My client is creating an online research site, providing case law, news, expert commentary, legal forms and checklists and other legal research material targeted to the NY litigation market. Subscription product designed to be an efficient tool for litigators to easily access core legal content critical to their practice of law. Establish a research alternative to the major legal research database companies Lexis/Nexis and West. Any interested parties will please feel free to submit their resumes to me at laura.hun...@vividresources.com or call me at 424-237-2602. Thank you! Laura
[jQuery] superfish navbar submenu
Hi all, I am brand new to this. I have downloaded the sample files. I added the navbar css to the example.html file. Everything works. My problem is that the submenu is visible when I first load the page before I have hovered over anything. Before I get into this any further, is there a way to fix that? Thanks for your help. Anne.
[jQuery] jQuery BlockUI Plugin (v2) add onBlock()
Hi all, in this plug-in I need a function like onUnblock but on completed fadein.. can Add this function? tks
[jQuery] Re: jQuery animations VS Mootools animations
The two versions have a number of subtle but remarkable differences that makes it difficult to do a side-by-side comparison. One's faster, one rotates the photographs, one bounces them around a bit upon reaching their destination. For what it's worth, running XP Pro SP 3 / FF 3, I prefer the implementation using jQuery. On Jan 6, 3:58 pm, Rey Bango wrote: > They both seem to run equally smooth to me. I saw occasional jumpiness > on both demos. > > Seriously, you've been on this specific topic since early November and > just doing a Google search shows that you've asked a ton of people the > same question. If you feel that jQuery's effects could be smoother, I > urge you to help out the project by investing the time to tackle > whatever concerns you have. Doing that will not only ease your > concerns but helps out everyone in the community. > > Rey... > > On Wed, Jan 6, 2010 at 3:43 PM, Acaz Souza wrote: > > MooTools:http://www.jsfiddle.net/4vnya/ > > jQuery:http://www.jsfiddle.net/eFbwJ/36/ > > (Compare the code, the effects. You decide.) > > > Why mootools is more smooth than jquery?
RE: [jQuery] Re: Why mootools animations is more smooth than jquery?
They seem about the same to me as well, FF3.5.6 on Win7 -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Scott Sauyet Sent: Wednesday, January 06, 2010 1:29 PM To: jQuery (English) Subject: [jQuery] Re: Why mootools animations is more smooth than jquery? On Jan 6, 3:44 pm, Acaz Souza wrote: > MooTools:http://www.jsfiddle.net/4vnya/ > jQuery:http://www.jsfiddle.net/eFbwJ/36/ > (Compare the code, the effects. You decide.) > > Why mootools is more smooth than jquery? It's not, at least not in my FF3.5.6 on Win XP. Haven't you been here asking this question before? Are you trying to get information or prove some obscure point? -- Scott
Re: [jQuery] Re: Why mootools animations is more smooth than jquery?
It is, at least in my FF 3.5.7 on Win 7, but I haven't the slightest clue as to why. Thanks for sharing those demos. On Wed, Jan 6, 2010 at 1:29 PM, Scott Sauyet wrote: > On Jan 6, 3:44 pm, Acaz Souza wrote: > > MooTools:http://www.jsfiddle.net/4vnya/ > > jQuery:http://www.jsfiddle.net/eFbwJ/36/ > > (Compare the code, the effects. You decide.) > > > > Why mootools is more smooth than jquery? > > It's not, at least not in my FF3.5.6 on Win XP. > > Haven't you been here asking this question before? Are you trying to > get information or prove some obscure point? > > -- Scott >
[jQuery] Re: Why mootools animations is more smooth than jquery?
On Jan 6, 3:44 pm, Acaz Souza wrote: > MooTools:http://www.jsfiddle.net/4vnya/ > jQuery:http://www.jsfiddle.net/eFbwJ/36/ > (Compare the code, the effects. You decide.) > > Why mootools is more smooth than jquery? It's not, at least not in my FF3.5.6 on Win XP. Haven't you been here asking this question before? Are you trying to get information or prove some obscure point? -- Scott
Re: [jQuery] jQuery animations VS Mootools animations
They both seem to run equally smooth to me. I saw occasional jumpiness on both demos. Seriously, you've been on this specific topic since early November and just doing a Google search shows that you've asked a ton of people the same question. If you feel that jQuery's effects could be smoother, I urge you to help out the project by investing the time to tackle whatever concerns you have. Doing that will not only ease your concerns but helps out everyone in the community. Rey... On Wed, Jan 6, 2010 at 3:43 PM, Acaz Souza wrote: > MooTools:http://www.jsfiddle.net/4vnya/ > jQuery: http://www.jsfiddle.net/eFbwJ/36/ > (Compare the code, the effects. You decide.) > > Why mootools is more smooth than jquery? >
[jQuery] Re: Why mootools animations is more smooth than jquery?
MooTools:http://www.jsfiddle.net/4vnya/ jQuery: http://www.jsfiddle.net/eFbwJ/36/ (Compare the code, the effects. You decide.) Why mootools is more smooth than jquery?
[jQuery] jQuery animations VS Mootools animations
MooTools:http://www.jsfiddle.net/4vnya/ jQuery: http://www.jsfiddle.net/eFbwJ/36/ (Compare the code, the effects. You decide.) Why mootools is more smooth than jquery?
[jQuery] Re: Add a second trigger in this function
Thanks for the insight Johan! When I implemented that though, it just added the hover cross fade to the other div as well. I am looking for a way to make the 2nd div JUST trigger the first. I was looking at the page you linked to and I am messing around with something like the following... although I can't get it to work. Any thoughts? $(document).ready(function () { $('div.tv, div.desk, div.phone').hover(function () { //hover in var div = $('> div', this); if (div.is(':animated')) { div.stop().fadeTo(500, 1); } else { div.fadeIn(250); } }, function () { // hover out var div = $('> div', this); if (div.is(':animated')) { div.stop().fadeTo(1000, 0); } else { div.fadeOut(1000); } }); $("div.tvbutton").hover(function () { $("div.tv").trigger('hover'); }); On Jan 5, 4:33 pm, Johan Borestad wrote: > Hi! > There are a number of nice implementations you could use for this. > Example the jQuery trigger.http://docs.jquery.com/Events/trigger > But for now, the simpliest solution is just to add another selector > like this > > $('div.example, div.tv').hover( . > > / Johan > > On Jan 5, 8:33 pm, Jordan wrote: > > > I recently implemented the Image Cross Fade Transition (http:// > > jqueryfordesigners.com/image-cross-fade-transition/) > > > It works great, and I'm hoping to add to the code to enhance the > > functionality. Currently, if I hover over the image, it runs the cross > > fade transition, which I would like to keep. I have another div on the > > page that I would like to trigger the first instance when hovered over > > as well. Is there a good way to add this? > > > Here's what I'm using for the first instance: > > > $(document).ready(function () { > > $('div.tv').hover(function () { > > //hover in > > var div = $('> div', this); > > > if (div.is(':animated')) { > > div.stop().fadeTo(500, 1); > > } else { > > div.fadeIn(250); > > } > > }, function () { > > // hover out > > var div = $('> div', this); > > if (div.is(':animated')) { > > div.stop().fadeTo(1000, 0); > > } else { > > div.fadeOut(1000); > > } > > });
[jQuery] Re: Pass object to function
On Jan 6, 2:17 pm, knal wrote: > BTW It also works without the " return this.each() { " part! Yes, but that allows you to continue chaining, i.e. $(this).closest(".project").closeProject().css({color: "blue"}); or whatever. This is the usual technique with jQuery plug-ins. -- Scott
[jQuery] Go through XML nodes only 1 level deep
I'm grabbing an XML file with jQuery like this: $(document).ready(function(){ $.ajax({ type: "GET", url: "http://ipinfodb.com/ip_query.php?ip=74.125.45.100";, dataType: "xml", success: function(xml) { //$(xml).find().each(function(){ var city = $(xml).find("City").text(); /* $('').html (''+title+'').appendTo('#page-wrap'); $(this).find('desc').each(function(){ var brief = $(this).find('brief').text(); var long = $(this).find('long').text(); $('').html(brief).appendTo ('#link_'+id); $('').html(long).appendTo ('#link_'+id); }); */ alert(city) //}); } }); }); The XML file looks like this 74.125.45.100 OK US United States 06 California Mountain View 94043 37.4192 -122.057 -8 -8 -7 But I can't get it to pull the data out.
[jQuery] Selectors Trouble
Hello guys, I'm doing a pagination for my site, and I'm having some problems with my selectors... In my site I have a #box div and inside this div I call by ajax my guestbook, which contains a pagination, it's already working, but I'm having TWO problems: #1 - My #loading div seems that's not appearing when I open the #box div (It should appears while loading the data) #2 - I could not highlight the current page which is displaying the messages (If user is at page 1, the link for the page 1 should have a different color, and other stuff) I'm testing all locally, in my Apache server. Here goes the code for my INDEX.PHP file: Carregando dados... INDEX.PHP also contains this js: $('a.menuGuestbook').click(function() { $('#box').show('slow'); $('#box').load('guestbook/guestbook.php?page=1', Hide_Load()); return false; }); $('#close').live('click', function() { $('#box').hide('slow'); return false; }); // --- show and hide loading - //Display Loading Image function Display_Load() { $('#box #loading').fadeIn('slow'); $('#box #loading').html(""); } //Hide Loading Image function Hide_Load() { $('#box #loading').fadeOut('slow'); } // -- ajax' calls - //Default Starting Page Results $("#paginacao li:first") .css({'color' : '#FF0084'}).css({'border' : 'none'}); Display_Load(); //Pagination Click $('#pagination li').live('click',function() { Display_Load(); //CSS Styles $("#pagination li") .css({'border' : 'solid #DDD 1px'}) .css({'color' : '#0063DC'}); $(this) .css({'color' : '#FF0084'}) .css({'border' : 'none'}); //Loading Data var pageNum = this.id; $("#box").load("guestbook/guestbook.php?page="+pageNum, Hide_Load()); }); Inside my GUESTBOOK.PHP file I have a div called "paginacao", here goes the code: '.$i.''; } ?> Thanks for help!!
[jQuery] Re: Pass object to function
Great!! I got it working! Thanks you very much!!! BTW It also works without the " return this.each() { " part! On 6 jan, 17:32, Šime Vidas wrote: > $("a.less").livequery( 'click', function() { > $(this).closest(".project").closeProject(); > return false; > > }); > > $.fn.extend({ > closeProject: function() { > return this.each() { > $(this).find(".morebody").slideUp('normal'); > } > } > > });
[jQuery] Re: next release?
A post from just 2 days ago :-) http://groups.google.com/group/jquery-en/browse_thread/thread/a9fcfc8e8deb0106?hl=en# On Jan 6, 12:47 pm, johnantoni wrote: > hi, any idea when the next version of jQuery is to be released?
Re: [jQuery] Re: iTunes Style Slider
Z, thanks for the reply. I found that project yesterday after I had posted. I also found a couple of others. The problem is that they either a) only work in Firefox (like the one you found) or b) are not full-featured like the MooTools one. The closest I have found - which seems to be the only one that has good cross-browser support - is this one: http://paulbakaus.com/lab/js/coverflow/ Anyways, thanks again for your reply. It is much appreciated. :-)
[jQuery] next release?
hi, any idea when the next version of jQuery is to be released?
Re: [jQuery] Re: How do i get this mega dropdown with jQuery??
This guy has a "mega-drop-down" how to with CSS and jQuery http://www.sohtanaka.com/web-design/mega-drop-downs-w-css-jquery/ < Corey camwebdesign.com On Wed, Jan 6, 2010 at 11:54 AM, 123gotoandplay wrote: > is this a good solution: > bldd.nl/prototypes/megamenu/test9.html > > On Jan 6, 5:41 pm, 123gotoandplay wrote: > > tx, for answering > > > > Any example how to do this?? > > > > I am stuck with the hover and the dropdown div > > > > Highly appreciated > > > > On Jan 6, 4:24 pm, Chris wrote: > > > > > I wouldn't really call that a "mega" dropdown. All it is is 2 divs, > > > the second one hidden and sliding into view when you mouseover the > > > first. The menu items themselves appear to be completely irrelevant as > > > far as the dropdown effect is concerned. > > > > > On Jan 6, 8:37 am, 123gotoandplay wrote: > > > > > > Hi all, > > > > > > I am trying to get this mega dropdown menu: > > > > see textielmuseum.nl/ > > > > > > So far i have: > > > > bldd.nl/prototypes/megamenu/test2.html > > > > > > But i can´t get the hoverIntent to work? > > > > here´s my try W.I.P > > > > bldd.nl/prototypes/megamenu/test4.html > > > > > > Any tips, ideas how i to get my mega dropdown to work on hover and > > > > hide it??? > > > > > > Regards, >
Re: [jQuery] Re: Form submit success method not being called
Thanks! I'll try that. I have an idea what it might be, but that code is at home. I think I might not be getting rid of the prefix ColdFusion adds to json responses -- I'll have to see if there's a preprocessing directive like jquery's built in ajax calls have. Scott On Wed, Jan 6, 2010 at 9:08 AM, Mike Alsup wrote: > What you have there should be working. Perhaps the json response is > not properly formatting. Try adding an error callback, or using the > global ajaxError hook, and see if that's the problem. > > Mike > > On Jan 5, 8:20 pm, Scott Brady wrote: >> I'm having an issue using the jquery form plug-in. The form gets >> submitted just fine (I can see the response in Firebug). However, it >> looks like my success callback method isn't being called. >> >> Here's the basic JS code for the form submit in the "document.ready" >> section.: >> // Add form binding >> var addOptions = >> { >> dataType: 'json', >> resetForm: true, >> success: processAdd >> }; >> >> $("#addForm").ajaxForm(addOptions); >> >> And, here's the callback function: >> function processAdd(responseData, statusText) >> { >> alert(responseData); >> >> } >> >> I've tried changing the success be an inline function declaration >> (success: function(responseText){ ... etc) but that didn't change it. >> >> Would using ajaxSubmit() rather than ajaxForm() work better? Or, is >> there something I'm actually doing wrong that you can see? >> >> -- >> - >> Scott Brady > -- - Scott Brady http://www.scottbrady.net/
[jQuery] AJAX Gallery w/ Accordion Effect Possible?
Hello all! I have what I think is a complicated gallery to build. Being new to JS I was told that jQuery is the place to start. I'm hoping this is possible... Well, I realize that most things are possible with enough time and effort. But, what I really need to know is if I can build something like this myself. Here's what I need to do: There is a main gallery page with a grid of projects - each row will have four thumbnails to represent the gallery. Well, what I need to have happen is when someone clicks on a project thumbnail the projects will slide down to reveal that project's gallery pulled in via AJAX. Also, I need a "Next" and "Previous" button so users can move through the project galleries without having to go back to the main projects page. Along with that I need to have "Return to Projects Page" link on each gallery page that will cause the projects page to slide up and cover the gallery. Does this make sense? I realize I may be asking a broad question and it may be a lot to ask, but I was hoping somebody could help me map out how I need to do this. Thank you.
[jQuery] superfish
is it possible to link superfish menu with virtuemart? regards
[jQuery] Superfish Nav-bar Joomla issue
I'm using the superfish module for joomla 1.5 all options except Nav- bar seem to work fine i have a fix menu area width 705px the 1st and 3rd levels are fine however the second level does not fill the entire 705px and instead folds into a 3rd line any ideas on how to get it to fill out the width?
Re: [jQuery] jQuery Version
There's no way for us to determine whether updating the jQuery library will affect your site. Too many variables. - Review the Release notes for the version to see if there are any known issues. - Review any plugins that you have to determine if they will work. - Update the library and test your site. Good luck! Joe On Wed, Jan 6, 2010 at 10:04 AM, Cyberdog wrote: > Hi, > I have a website which has jQuery JavaScript Library v1.3.2 installed. > Should i update this to the latest, or would this cause problems to > the site. > > Thanks > Dave. >
[jQuery] Re: Cycle and softedge
On Jan 6, 10:17 am, exlibris wrote: > Does anybody know how to either better integrate the softedge.js > library, I don't think it will work when the cycle plug-in is used directly on the images, as the softedge technique replaces an image with a stack of images in the same location with increasing opacities and decreasing clip size. But I think if you put your images in some containers and use the cycle plug-in on those containers, it might work. Good luck, -- Scott
[jQuery] Re: How do i get this mega dropdown with jQuery??
is this a good solution: bldd.nl/prototypes/megamenu/test9.html On Jan 6, 5:41 pm, 123gotoandplay wrote: > tx, for answering > > Any example how to do this?? > > I am stuck with the hover and the dropdown div > > Highly appreciated > > On Jan 6, 4:24 pm, Chris wrote: > > > I wouldn't really call that a "mega" dropdown. All it is is 2 divs, > > the second one hidden and sliding into view when you mouseover the > > first. The menu items themselves appear to be completely irrelevant as > > far as the dropdown effect is concerned. > > > On Jan 6, 8:37 am, 123gotoandplay wrote: > > > > Hi all, > > > > I am trying to get this mega dropdown menu: > > > see textielmuseum.nl/ > > > > So far i have: > > > bldd.nl/prototypes/megamenu/test2.html > > > > But i can´t get the hoverIntent to work? > > > here´s my try W.I.P > > > bldd.nl/prototypes/megamenu/test4.html > > > > Any tips, ideas how i to get my mega dropdown to work on hover and > > > hide it??? > > > > Regards,
[jQuery] Re: jQuery parent remove
On Jan 6, 4:42 am, Lone Wolf wrote: > $(document).ready(function(){ > $('table.small td img.delete').click(function(){ > $.get('ajax/update-callback.php', {doaction: 'remove', callbackid: $ > (this).attr('id')}, > function(data){ > alert($(this).attr('id')); > $(this).remove(); > }); > }); > > }); > > update-callback.php is called and the function is performed by php. > However, in the callback function of the jQuery, $(this) is not > available as alerting its attr('id') gives undefined which it happily > added in the GET of the update-callback.php. Can you tell me what I > could be doing wrong. The "this" reference in your callback function does not refer back to the "this" in your outer function. [1] You need to save a reference to it to use in the callback. This is untested, but might do it: $(document).ready(function(){ $('table.small td img.delete').click(function(){ var deleteImg = $(this); $.get('ajax/update-callback.php', {/* ... */}, function(data){ alert(deleteImg.attr('id')); deleteImg.remove(); } ); }); }); Cheers, -- Scott [1] According to the docs, "this" refers to the options for your ajax request
[jQuery] Re: How do i get this mega dropdown with jQuery??
tx, for answering Any example how to do this?? I am stuck with the hover and the dropdown div Highly appreciated On Jan 6, 4:24 pm, Chris wrote: > I wouldn't really call that a "mega" dropdown. All it is is 2 divs, > the second one hidden and sliding into view when you mouseover the > first. The menu items themselves appear to be completely irrelevant as > far as the dropdown effect is concerned. > > On Jan 6, 8:37 am, 123gotoandplay wrote: > > > Hi all, > > > I am trying to get this mega dropdown menu: > > see textielmuseum.nl/ > > > So far i have: > > bldd.nl/prototypes/megamenu/test2.html > > > But i can´t get the hoverIntent to work? > > here´s my try W.I.P > > bldd.nl/prototypes/megamenu/test4.html > > > Any tips, ideas how i to get my mega dropdown to work on hover and > > hide it??? > > > Regards,
Re: [jQuery] XPath for Attribute Selection Criteria
On Jan 6, 2010, at 10:13 AM, Richard Collette wrote: The jQuery documentation states that it uses a combination of both CSS and XPath selectors. Does that mean that I should be able to select attributes using the syntax: [attName=Val1 or attName=val2] since XPath criteria allow OR's like this? If not, exactly what parts of XPath are supported? Earlier versions of jQuery supported a mix of CSS 1-3 and a subset of XPath, but the XPath selector syntax support has been removed for quite some time. Can you please point me to the URL in the documentation where it says that both are supported so I can correct it? To answer your question, this should work: $('[attName=Val1], [attName=val2]') I'd put something (like a tag name) before each of those attribute selectors, though. For example: $('input[attName=Val1], input[attName=val2]') --Karl Karl Swedberg www.englishrules.com www.learningjquery.com
[jQuery] Re: Pass object to function
$("a.less").livequery( 'click', function() { $(this).closest(".project").closeProject(); return false; }); $.fn.extend({ closeProject: function() { return this.each() { $(this).find(".morebody").slideUp('normal'); } } });
[jQuery] Re: ajax image
> So you are trying to use jQuery's ".load()" functionality with an > actual image (i assume that your php sets the content type to image/ > jpeg, image/gif, etc and writes out the actual binary image data) ? YES ! that is correct. > that's not going to work, as the ".load()" loads the result of the > Ajax call into the innerHtml of DOM object I'm assuming thats why I get Array > I don't know though, you're talking "same function" but have posted > about three different functions so far, $.ajax, .load, and your custom > function mmm sorry for the confusion I wanted to see if i could just get it to work with load that's why I mentioned it .. > but bottom line is, the $.ajax call which ultimately > gets called wouldn't be a replacement for , bummer 8 ^ ( > *unless* you wanted to use data url vales as image sources (like:http://www.websiteoptimization.com/speed/tweak/inline-images/), but > the problem with that, like almost all cool ideas like that link > shows, is it doesn't work with IE neat concept but not doable trying to stick with ajax Thanks for your help Mean Mike
[jQuery] (treeview) add html instead of text, async notify on load
In the async extension the the jquery treeview plugin, I would like to request that an event trigger be sent each time a new branch of the tree is loaded. It could be as simple as adding "$(container).trigger ('treeviewLoaded');" to the async extension. Additionally, I would like to request that HTML may be async'ly added to the tree instead of just simple text strings. The JSON response for async'ly updating the tree currently has a "text: ''" tag that sets the tree text inside of a tag. I would like to also see a "html: " type JSON tag that could be used alternatively, where are not placed inside of a . The reason for doing these two enhancements is that I would like to add checkboxes to certain elements of my tree. Then when the tree loads, an external event handler would be added to the checkboxes after each new "treeviewLoaded" trigger is externally received. I would be willing to help develop the code, or gladly use anything that is developed.
[jQuery] Position div accounting for screen size/resize
Can you change a position of a div, based on screen size/resize with jquery? Something like if (browser>= sitecontainerwidth) { left:50%; margin-left: 20px; } else { left: 0%; margin-left: 600px; } I have a centered layout (div{margin: top auto;}) with a BG image. There's another div (with a background design) that needs to overlay on the BG, but off center. Figure of what the problem: http://www.kacevisual.com/files/Div-difficulties.gif
[jQuery] Re: Form submit success method not being called
What you have there should be working. Perhaps the json response is not properly formatting. Try adding an error callback, or using the global ajaxError hook, and see if that's the problem. Mike On Jan 5, 8:20 pm, Scott Brady wrote: > I'm having an issue using the jquery form plug-in. The form gets > submitted just fine (I can see the response in Firebug). However, it > looks like my success callback method isn't being called. > > Here's the basic JS code for the form submit in the "document.ready" section.: > // Add form binding > var addOptions = > { > dataType: 'json', > resetForm: true, > success: processAdd > }; > > $("#addForm").ajaxForm(addOptions); > > And, here's the callback function: > function processAdd(responseData, statusText) > { > alert(responseData); > > } > > I've tried changing the success be an inline function declaration > (success: function(responseText){ ... etc) but that didn't change it. > > Would using ajaxSubmit() rather than ajaxForm() work better? Or, is > there something I'm actually doing wrong that you can see? > > -- > - > Scott Brady
[jQuery] Re: ajax image
So you are trying to use jQuery's ".load()" functionality with an actual image (i assume that your php sets the content type to image/ jpeg, image/gif, etc and writes out the actual binary image data) ? that's not going to work, as the ".load()" loads the result of the Ajax call into the innerHtml of DOM object I don't know though, you're talking "same function" but have posted about three different functions so far, $.ajax, .load, and your custom function but bottom line is, the $.ajax call which ultimately gets called wouldn't be a replacement for , *unless* you wanted to use data url vales as image sources (like: http://www.websiteoptimization.com/speed/tweak/inline-images/), but the problem with that, like almost all cool ideas like that link shows, is it doesn't work with IE On Jan 6, 10:48 am, Mean Mike wrote: > basically all ajax calls go through > > $.ajax({.}); > > I made a function that gets passed all the parameters that I want in > the ajax call > > oddly enough i can't get load to work right either i just get Array > returned > > On Jan 6, 10:33 am, MorningZ wrote: > > > > I want all my ajax calls to run through the same ajax function > > > What "same" ajax function? > > > On Jan 6, 10:29 am, Mean Mike wrote: > > > > ok so I figured out that you can put in image in your page using .load > > > (imageloader.php) but is there a way to load an image using regular > > > ajax call . > > > > alittle more explanation of what I'm trying to do > > > > in my php I use imagejpeg function which outputs the image using gd > > > great! > > > > and in my html i use to just go and that worked except now I don't > > > want to pass that info in the query string I want to post the info AND > > > I want all my ajax calls to run through the same ajax function which > > > is why I don't want to use .load > > > > any thoughts or suggestions > > > > mean mike
[jQuery] Re: ajax image
basically all ajax calls go through $.ajax({.}); I made a function that gets passed all the parameters that I want in the ajax call oddly enough i can't get load to work right either i just get Array returned On Jan 6, 10:33 am, MorningZ wrote: > > I want all my ajax calls to run through the same ajax function > > What "same" ajax function? > > On Jan 6, 10:29 am, Mean Mike wrote: > > > ok so I figured out that you can put in image in your page using .load > > (imageloader.php) but is there a way to load an image using regular > > ajax call . > > > alittle more explanation of what I'm trying to do > > > in my php I use imagejpeg function which outputs the image using gd > > great! > > > and in my html i use to just go and that worked except now I don't > > want to pass that info in the query string I want to post the info AND > > I want all my ajax calls to run through the same ajax function which > > is why I don't want to use .load > > > any thoughts or suggestions > > > mean mike
[jQuery] Cycle and softedge
Howdy, I have jquery.cycle.min.2.72.js up and running, but am having trouble integrating it with another javascript image manipulation package: softedge.js (http://cssglobe.com/post/1344/soft-edge-technique-soft- edges-and-opacity-gradients-for). Basically, I would like images to fade in and out while rotating. But when displayed, I would like them to have their edges faded to transparency. What happens instead, is that only the initial image has the faded edge, and only that faded area rotates. Does anybody know how to either better integrate the softedge.js library, or achieve a fade / feathered edge within the jquery / cycle framework? Many thanks, Andrew
[jQuery] Help with change event
I am interested in the event change, and am looking at http://docs.jquery.com/Events/change. $("select").change(function () { var str = ""; $("select option:selected").each(function () { str += $(this).text() + " "; }); $("div").text(str); }) .change(); It all makes sense except for the very last change(). Can anyone explain the purpose of this line? Thank you
[jQuery] jQuery Version
Hi, I have a website which has jQuery JavaScript Library v1.3.2 installed. Should i update this to the latest, or would this cause problems to the site. Thanks Dave.
[jQuery] form validation
Is it possible to use the jquery form validation plugin (http:// bassistance.de/jquery-plugins/jquery-plugin-validation/) to validate a form that was inserted into the page via javascript? What I'm trying to do is display a person's address, which is contained in a span tag, and give them the option to edit it. If they click the edit button, I'm changing the span to a form tag with jQuery and turning the parts of the address into text boxes with the values filled in. The problem I'm having is that since the form doesn't exist from the very beginning, the validate function isn't getting assigned to it, and when the form is created and submitted, it doesn't get validated. Can I somehow make the plugin assign the validate function to the form when the edit button is clicked, or is that not possible?
[jQuery] XPath for Attribute Selection Criteria
The jQuery documentation states that it uses a combination of both CSS and XPath selectors. Does that mean that I should be able to select attributes using the syntax: [attName=Val1 or attName=val2] since XPath criteria allow OR's like this? If not, exactly what parts of XPath are supported?
[jQuery] Re: ajax image
> I want all my ajax calls to run through the same ajax function What "same" ajax function? On Jan 6, 10:29 am, Mean Mike wrote: > ok so I figured out that you can put in image in your page using .load > (imageloader.php) but is there a way to load an image using regular > ajax call . > > alittle more explanation of what I'm trying to do > > in my php I use imagejpeg function which outputs the image using gd > great! > > and in my html i use to just go and that worked except now I don't > want to pass that info in the query string I want to post the info AND > I want all my ajax calls to run through the same ajax function which > is why I don't want to use .load > > any thoughts or suggestions > > mean mike
[jQuery] ajax image
ok so I figured out that you can put in image in your page using .load (imageloader.php) but is there a way to load an image using regular ajax call . alittle more explanation of what I'm trying to do in my php I use imagejpeg function which outputs the image using gd great! and in my html i use to just go and that worked except now I don't want to pass that info in the query string I want to post the info AND I want all my ajax calls to run through the same ajax function which is why I don't want to use .load any thoughts or suggestions mean mike
[jQuery] Re: How do i get this mega dropdown with jQuery??
I wouldn't really call that a "mega" dropdown. All it is is 2 divs, the second one hidden and sliding into view when you mouseover the first. The menu items themselves appear to be completely irrelevant as far as the dropdown effect is concerned. On Jan 6, 8:37 am, 123gotoandplay wrote: > Hi all, > > I am trying to get this mega dropdown menu: > see textielmuseum.nl/ > > So far i have: > bldd.nl/prototypes/megamenu/test2.html > > But i can´t get the hoverIntent to work? > here´s my try W.I.P > bldd.nl/prototypes/megamenu/test4.html > > Any tips, ideas how i to get my mega dropdown to work on hover and > hide it??? > > Regards,
[jQuery] Re: New to JS and jQuery
Ahhh! Sorry, my bad, works now! Thanks. On Jan 6, 1:56 am, MorningZ wrote: > > I have $('.baritem').. > > No, no you don't right now on the URL > > http://ferok.com/labs/test.html > > and the included js file > > http://ferok.com/labs/global.js > > you have > > $('baritem').click(function() > > i just copied and pasted that right from the JavaScript include file > just like i did on my last post :-) > > fix the selector and then go from there > > As > > > > > said, Im new to jQuery so I don't know.. All I wanna do is having this > > script being able to "pop up" (like on facebook) more than just 1 box > > (Depending on which button you click, like: IF you click on a button > > with ID of "menu" it opens "menu_menu" if you click "stuff" if opens > > "menu_stuff" etc.. and I cant set it to just 1 ID cause then this wont > > work "dynamicly" eg. I wont be able to run more than just 1 box with > > this script as I cant set all the buttons to the same ID? > > > Brian got the idea, just that the script doesn't work. > > > On Jan 5, 9:14 pm, MorningZ wrote: > > > > You should pay attention to your selectors :) > > > > you have > > > > $('baritem').click(function() > > > > that looks for DOM objects > > > > but > > > > $('#baritem').click(function() > > > > will find > > > > On Jan 5, 2:41 pm, Valerij wrote: > > > > > This still wont work.. I've even tried copy your example character by > > > > character and it still gives nothing.. > > > > I'm using this code onhttp://ferok.com/labs/test.htmlatthebottom > > > > bar, try clicking the "My Account" and the menu wont "pop up". I had > > > > this working before, but I didn't have this dynamic code which I can > > > > use to open more than just 1 "tab". > > > > > The CSS: > > > > #stuff_menu {background-color:#E8E8E8;border: 1px solid #66;bottom: > > > > 22px;display:none;left:0px;padding:5px 5px 1px 5px;position: > > > > absolute;width:200px;} > > > > > On Jan 5, 5:03 pm, brian wrote: > > > > > > That works for me but I do see how this can be refactored: > > > > > > My Account > > > > > > > > > > > My Account > > > > > More stuff > > > > > Here is a menu item > > > > > Here is a menu item > > > > > Here is a menu item > > > > > Here is a menu item > > > > > > > > > > > Notice that I've changed the IDs so that the DIV has the link ID plus > > > > > some other string, rather than the other way around. > > > > > > Also, I've added a class to the DIV to make it easier to set styles. > > > > > This isn't strictly necessary. > > > > > > $(function() > > > > > { > > > > > /* set up the onclick handler for all links on page load > > > > > */ > > > > > $('.baritem').click(function() > > > > > { > > > > > $('#' + this.id + '_menu').toggle(); > > > > > return false; > > > > > }); > > > > > > }); > > > > > On Mon, Jan 4, 2010 at 4:01 PM, Valerij wrote: > > > > > > Hey guys, I'm trying to create 1 really simple function but it just > > > > > > doesn't work! > > > > > > > function showMenu(menu) { > > > > > > var menuid = $( "#"+menu ); > > > > > > var menuRoot = $( "#"+menu+"-root" ); > > > > > > > menuid.toggle(); > > > > > > menuRoot.blur(); > > > > > > } > > > > > > > What this suppose to do is when you click a link, it will change > > > > > > settings of a specific div to "visible" > > > > > > The HTML: > > > > > > > > > > > > onclick="showMenu('stuff');">My Account > > > > > > > > > > > > My Account > > > > > > More stuff > > > > > > Here is a menu item > > > > > > Here is a menu item > > > > > > Here is a menu item > > > > > > Here is a menu item > > > > > > > > > > > > > Why doesn't this work? What am I doing wrong.. When I alert this, I > > > > > > get the correct div ids?
[jQuery] (autocomplete) Half of page disappears in IE7 when autocomplete list shows
Hi I use autocomplete newest version on http://www.kle-online.dk/stage Things work great in FF and IE8 but in IE7 half of the page disappears when the autocomplete list shows. Try to type "benz" in the search field and problem should be easy to see. Cheers, Rune
[jQuery] Re: Expectetd identifier, string on number
"Wonder why that is? " https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Reserved_Words it's just that browsers other than IE handle it (much) more gracefully :-) Also just a quick tip on your code in general... if you know the ID of something, then use *just* the ID for the selector... so in your code jQuery("select#article_is_in_1"); should be jQuery("#article_is_in_1") the first is slower because it is like "find all select objects on the page, then find the one with this ID" the second is faster because it'll use document.getElementById, which is very fast :-) if you want to read more: http://www.componenthouse.com/article-19 All the multiple .hide() calls could be cleaned up too... even if it's just a loop if it has to be 2 through 14 for (var j=2; j <= 14) { jQuery('#article' + j).hide(); } On Jan 6, 6:47 am, youradds wrote: > Ah never mind - found it: > > do: "wiki_ajax", > > For some reason it doesn't like do: , so I renamed to wiki_do, and its > fine now > > Wonder why that is? > > TIA > > Andy > > On Jan 6, 11:46 am, youradds wrote: > > > Hi, > > > Got a bit of a weird issue in IE 8 with this code: > > > jQuery.getJSON("/v.f", { do: "wiki_ajax", id: jQuery > > (this).val(), field: "1" }, function(j){ > > > The whole function is: > > > jQuery.noConflict(); > > > jQuery(function(){ > > jQuery("select#article_is_in_1").change(function(){ > > jQuery.getJSON("/v.f", { do: "wiki_ajax", id: jQuery > > (this).val(), field: "1" }, function(j){ > > > clear_further_up(2); > > > jQuery('#article2').hide(); > > jQuery('#article3').hide(); > > jQuery('#article4').hide(); > > jQuery('#article5').hide(); > > jQuery('#article6').hide(); > > jQuery('#article7').hide(); > > jQuery('#article8').hide(); > > jQuery('#article9').hide(); > > jQuery('#article10').hide(); > > jQuery('#article11').hide(); > > jQuery('#article12').hide(); > > jQuery('#article13').hide(); > > jQuery('#article14').hide(); ; > > > var options = ''; > > for (var i = 0; i > options += '' + j[i].optionDisplay + ''; > > } > > jQuery("#article_is_in_2").html(options); > > jQuery('#article_is_in_2 option:first').attr > > ('selected', 'selected'); > > > if (j.length > 1) { > > jQuery('#article2').show(); > > } > > > }) > > }); > > > }); > > > Can anyone suggest what is wrong with it? Works perfectly fine in FF > > and Chrome :/ > > > TIA > > > Andy
[jQuery] jQuery parent remove
Hi, I am having problem with this function. $(document).ready(function(){ $('table.small td img.delete').click(function(){ $.get('ajax/update-callback.php', {doaction: 'remove', callbackid: $ (this).attr('id')}, function(data){ alert($(this).attr('id')); $(this).remove(); }); }); }); update-callback.php is called and the function is performed by php. However, in the callback function of the jQuery, $(this) is not available as alerting its attr('id') gives undefined which it happily added in the GET of the update-callback.php. Can you tell me what I could be doing wrong. Kind Regards,
[jQuery] Re: Pass object to function
Because i'm using the slide effect on multiple places so i would like to create a function for it. I just seem to be unable to get the object passed into the function the way it 'should'... Thanks for your reply though! On Jan 6, 2:54 pm, Šime Vidas wrote: > why not just > > $("a.less").live('click', function() { > $(this).closest(".project").find(".morebody").slideUp > ("normal"); > return false; > }); > > ??
[jQuery] Re: jQuery Equivalent of Prototype Function.bind
On Jan 5, 9:43 am, Bruce wrote: > Is there a jQuery way of doing this Prototype bind? I don't know about built-in means, but here is one that Google provides: http://groups.google.com/group/jquery-en/msg/0980e113f097720a -- Scott
[jQuery] Re: iTunes Style Slider
it's been coded in jQuery before, like http://www.blarnee.com/projects/coverflow/ i recall that one of the people on the jQuery UI team was messing around with that effect as well On Jan 5, 10:22 pm, Matt Quackenbush wrote: > Hello, > > I found an iTunes style slider/rotator that has been done in > MooTools, demoed > here:http://www.outcut.de/MooFlow/example-ajax.html. I was wondering if > either > a) such a thing already existed in a jQuery plugin, or b) if there was a > jQuery master who could port it in quick fashion? If b), please contact me > off-list and let me know how much you would charge and what the turnaround > time would be. :-) > > Thanks in advance!
[jQuery] Re: Pass object to function
why not just $("a.less").live('click', function() { $(this).closest(".project").find(".morebody").slideUp ("normal"); return false; }); ??
[jQuery] How do i get this mega dropdown with jQuery??
Hi all, I am trying to get this mega dropdown menu: see textielmuseum.nl/ So far i have: bldd.nl/prototypes/megamenu/test2.html But i can´t get the hoverIntent to work? here´s my try W.I.P bldd.nl/prototypes/megamenu/test4.html Any tips, ideas how i to get my mega dropdown to work on hover and hide it??? Regards,
Re: [jQuery] Re: Change opacity of item with class of selected
That works Johan, thanks very much. Doesn't validate, but I guess that's not the end of the world... Thanks again. Paul 2010/1/6 Johan Borestad > Hi Paul! > This is a case where you really don't even should use Javascript, > unless you're trying to do some fancy animations. Rely entirely on CSS > with a simple css-rule > > #thumbs li.selected { > filter:alpha(opacity=50); > opacity:0.50; > } > > This will also be much much faster than any other solutions. > / Johan > > > On Jan 5, 7:50 pm, Paul Collins wrote: > > Sorry, the test page:http://paulcollinslondon.com/test/test.html > > > > 2010/1/5 Paul Collins > > > > > Thanks very much for your help Brian. That works, but I think the > problem > > > may go deeper than I thought! I've put up a test page. > > > > > I'm using the "JQuery Opacity Rollover" Script as a part of the > Gallerific > > > plugin http://www.twospy.com/galleriffic/#1 > > > > > To try and keep this simple, when you hover over a thumbnail, it > originally > > > went from dark to light. I've reversed the order of this in > > > "mouseOutOpacity" & "mouseOverOpacity" on the scripts.js & > > > jquery.opacityrollover.js, so now they are full opacity by default and > half > > > when you hover over. There is a selected class applied when you click > on a > > > thumbnail and I want to make the opacity stay at half when you click on > it. > > > > > There seems to be a default on all list items of the thumbs of > > > opacity: 1; I want to change it to 0.5 when an item has a class of > selected, > > > but can't get it to work. > > > > > I've tried removing the inline style first using > > > > > $("#portfolio #thumbs li.selected").removeAttr("style"); > > > > > But this doesn't work. > > > > > Sorry for the long windedness of this post, but if anyone could even > give > > > me a hint of where to start looking, I would be really grateful. > > > > > Thanks > > > > > 2010/1/5 brian > > > > > Just put the class in the selector instead of testing for it first: > > > > >> $("#portfolio #thumbs li.selected").css('opacity','0.5'); > > > > >> If the class doesn't exist, jQuery will do nothing (instead of > > >> throwing an "undefined" error or similar). > > > > >> On Tue, Jan 5, 2010 at 12:45 PM, Paul Collins > > > >> wrote: > > >> > Hi all > > > > >> > I've been stuck on this for four hours, and I still can't solve it! > > > > >> > I am trying to check if a list item has a class of selected, then is > so > > >> > change the opacity to 0.5. Here is my code: > > > > >> > if ($("#portfolio #thumbs ul li").hasClass(".selected")) { > > >> > $(this).css('opacity','0.5'); > > >> > } > > > > >> > It seems that the "this" part isn't working, is it to do with > putting it > > >> in > > >> > an event? > > > > >> > Would appreciate any help >
[jQuery] Re: urgent help
link to demo? On Jan 6, 3:49 am, Sugi wrote: > I am using Jquery plugins like flowplayer,fancy plugin for image and > video stuffs...It creates lot of erros with IE 6. Can any one help to > fix compatability issue with IE6? Please reply..Very urgent
[jQuery] Re: Expectetd identifier, string on number
Ah never mind - found it: do: "wiki_ajax", For some reason it doesn't like do: , so I renamed to wiki_do, and its fine now Wonder why that is? TIA Andy On Jan 6, 11:46 am, youradds wrote: > Hi, > > Got a bit of a weird issue in IE 8 with this code: > > jQuery.getJSON("/v.f", { do: "wiki_ajax", id: jQuery > (this).val(), field: "1" }, function(j){ > > The whole function is: > > jQuery.noConflict(); > > jQuery(function(){ > jQuery("select#article_is_in_1").change(function(){ > jQuery.getJSON("/v.f", { do: "wiki_ajax", id: jQuery > (this).val(), field: "1" }, function(j){ > > clear_further_up(2); > > jQuery('#article2').hide(); > jQuery('#article3').hide(); > jQuery('#article4').hide(); > jQuery('#article5').hide(); > jQuery('#article6').hide(); > jQuery('#article7').hide(); > jQuery('#article8').hide(); > jQuery('#article9').hide(); > jQuery('#article10').hide(); > jQuery('#article11').hide(); > jQuery('#article12').hide(); > jQuery('#article13').hide(); > jQuery('#article14').hide(); ; > > var options = ''; > for (var i = 0; i options += '' + j[i].optionDisplay + ''; > } > jQuery("#article_is_in_2").html(options); > jQuery('#article_is_in_2 option:first').attr > ('selected', 'selected'); > > if (j.length > 1) { > jQuery('#article2').show(); > } > > }) > }); > > }); > > Can anyone suggest what is wrong with it? Works perfectly fine in FF > and Chrome :/ > > TIA > > Andy
[jQuery] Expectetd identifier, string on number
Hi, Got a bit of a weird issue in IE 8 with this code: jQuery.getJSON("/v.f", { do: "wiki_ajax", id: jQuery (this).val(), field: "1" }, function(j){ The whole function is: jQuery.noConflict(); jQuery(function(){ jQuery("select#article_is_in_1").change(function(){ jQuery.getJSON("/v.f", { do: "wiki_ajax", id: jQuery (this).val(), field: "1" }, function(j){ clear_further_up(2); jQuery('#article2').hide(); jQuery('#article3').hide(); jQuery('#article4').hide(); jQuery('#article5').hide(); jQuery('#article6').hide(); jQuery('#article7').hide(); jQuery('#article8').hide(); jQuery('#article9').hide(); jQuery('#article10').hide(); jQuery('#article11').hide(); jQuery('#article12').hide(); jQuery('#article13').hide(); jQuery('#article14').hide(); ; var options = ''; for (var i = 0; i ' + j[i].optionDisplay + ''; } jQuery("#article_is_in_2").html(options); jQuery('#article_is_in_2 option:first').attr ('selected', 'selected'); if (j.length > 1) { jQuery('#article2').show(); } }) }); }); Can anyone suggest what is wrong with it? Works perfectly fine in FF and Chrome :/ TIA Andy
[jQuery] Pass object to function
Hi there, I have a function which controls my interface. If people click on a link with the class 'less' i would like a dive to slide up. My code roughly looks like this: $("a.less").livequery( 'click', function() { var cur_project_id = ( $(this).closest( "div.project" ).attr ( "id" ) ); $( "#"+cur_project_id ).closeProject( cur_project_id ); return false; }); $.fn.extend({ closeProject: function( projectID ) { $( "#"+projectID+" .morebody" ).slideUp('normal') } }); It works, but as you can see i pass the object twice to the function, but i know i shouldn't have to and be able to only write something like: $( "#"+$(this).closest( "div.project" ).attr( "id" ) ).closeProject (); // <-- nothing between last brackets! I hope this is clear and makes sense! Thanks in advance, Knal
[jQuery] Basic custom Plugin not working
Hi guys i have tried to create my first plugin but its giving me some odd behaviour. what im trying to achieve is to put default text in an empty input field and hide it when the field has focus and then show it again if nothing was entered into the field on blur. This i have done pretty easy but the problem start when i use the plugin on more than one input filed per page and it treats all field like the last one in the sequence. so if i focus the first field the text in the last filed in the sequence will disappear ?!?! This is my code for this simple plugin Can anyone see the glaring mistake that i must have made function($){ jQuery.fn.showhideinput = function(options) { var defaults = { text: "dd/mm/" }; var options = $.extend(defaults, options); return this.each(function(index) { obj = $(this); objid = '#'+obj.attr('id'); var inputtext = obj.val(); if (inputtext == ''){ obj.val(options.text); inputtext = options.text; } obj.focus(function () { //alert(objid + ' focus'); if (obj.val() == inputtext){ $(objid).val(''); } }); obj.blur(function () { //alert(objid + ' blur'); if (obj.val() == ''){ $(objid).val(inputtext); } }); }); }; })(jQuery);