[jQuery] Re: Powerfull WYSIWYG editor with upload image capability
You don't need to use ckfinker. Ckeditor 3 just needs an upload and a browse url. You can make them in your prefered language. David Op 18 sep 2009 5:53 PM schreef Rama Vadakattu rama.vadaka...@gmail.com: you can't run CKFinder without a backend server. http://ckfinder.com/download Where do you store uploaded photos? You need to store those photos at the server via back end language. On Sep 18, 8:19 pm, Donny Kurnia donnykur...@gmail.com wrote: Rama Vadakattu wrote: Can any... Donny Kurniahttp://blog.abifathir.comhttp://hantulab.blogspot.comhttp:// www.plurk.com/user/donnykurnia
[jQuery] Re: Paste an image into a tag...
Hi Dan, In order to paste an image from the clipboard, you'll need something that can also upload the image to the server on the paste operation. Absolutly. Cheers for suggestion - I'll have a look at XStandard; sounds like it'l fit the bill. This is for an app, not a web site, so the users would be happy to use Firefox if it gave them this fucitonality (plus I can't get it to work in IE yet anyway :-) ) Cheers, Steve On Sep 18, 3:03 pm, G. Switzer, II dswit...@pengoworks.com wrote: It's been a while since I've looked at either TinyMCE or FCKEditor (now CKEditor) but non of the WYSIWYG editors based on the browser can do what Hogsmill wants. In order to paste an image from the clipboard, you'll need something that can also upload the image to the server on the paste operation. The product I've used in the past to accomplish this is XStandard--which comes as either a Firefox add-on and an ActiveX control for IE. It does require an client installation, but it's a very powerful XHTML-based editor and works really well for us. The images are uploaded to the server via a web service on the paste operation--it even handles multiple images in the clipboard. We choose XStandard, because users could copy an entire Word document into the clipboard with multiple images and simply paste it into the XStandard editor and the content would get pasted complete with all the images in the Word document. There are some Java-based rich text editor controls I found too, but they were all much more expensive. Also, if you *only* care about pasting a single image (and don't really need the whole rich text portion) you could write a signed Java applet to do this. For our help desk application, I wrote a signed Java applet that would either take the screenshot for the user or allow pasting an image from the clipboard to add as an attachment. I can't share the code, but it's relatively straightforward (the biggest issue is handling clipboard operations on the Mac.) -Dan On Fri, Sep 18, 2009 at 9:22 AM, Peter Edwards p...@bjorsq.net wrote: Have you thought of using a rich text editor to do this such as TinyMCE and FCKEditor - they both have paste from clipboard functionality On Fri, Sep 18, 2009 at 11:12 AM, Hogsmill i...@hogsmill.com wrote: This may or may not be possible, but if anyone knows a way to do it, I'd love to hear from you. Basically, I simply (?) want to copy an image (e.g. from ALT-Print Screen or 'Copy Image'), and paste/drop it into an img tag on a page so it appears on the page. I can then resize, drag-drop, etc. as required. I've had a rummage around the net, but can't find anything. Maybe it's impossible? Cheers, Steve- Hide quoted text - - Show quoted text -
[jQuery] Re: getJSON returning undefined instead of XMLHttpRequest
Ah, I did misread the problem. Now I follow you, thanks for the clarification. There is indeed a better and simpler way to do this, which works with *any*kind of asynchronous callback. You don't need to rely on having a specific object returned that you can stuff data into. Simply use a closure. For example: function jsonRequest( url, myVariable ) { $.getJSON( url, function( data ) { // here you have access to data and myVariable }); } jsonRequest( 'test1.php', 'hello world' ); jsonRequest( 'test2.php', 'goodbye cruel world' ); jsonRequest( 'test3.php', 'off to join the circus' ); Each of those jsonRequest() calls has its own private 'myVariable' - no globals needed. Even for ordinary XHR, I think this is a much cleaner way to pass data into the callback than messing with the XHR object, and the nice thing is you can always use the same technique. It's no different from how you might use a closure with setTimeout or any other async function: function delayedAlert( time, message ) { setTimeout( function() { alert( message ); }, time ); } delayedAlert( 1000, 'one second' ); delayedAlert( 1, 'ten seconds' ); -Mike On Sat, Sep 19, 2009 at 5:12 PM, Blixa shulgisnotmyem...@gmail.com wrote: Hi Mike, I think you might have misread my post and the code attached. I am quite aware of the fact that the callback function only runs upon a successful completion of the request and is run asynchronously. If you look at the code i've written you'll see that i am in fact _counting_ on that since i am declaring variable_from_caller in the line after the callback code as i know this code will be run before the callback code (which contains a reference to variable_from_caller). My question, again, was in regards to passing data TO the callback function and not FROM the callback function. In my scenario i have to consider the possibility of multiple getJSONs called and so multiple callbacks running side by side so that i cannot use global variables to store this data, which is specific to each of the callback. The way i described here uses the actual XMLHttpRequest object (by assigning $.getJSON to the variable new_json) and only works if i modify the jQuery code (like i mentioned in my original post). Is there another way of passing data TO the callback function that is not global, other than the way i've done it? Shouldn't getJSON _ALWAYS_ return an XMLHttpRequest object, as the documentation states? On Sep 20, 12:17 am, Michael Geary m...@mg.to wrote: getJSON, like all Ajax and Ajax-style calls, is *asynchronous*. That's what the A in Ajax stands for. Instead of trying to use a return value, you need to use the getJSONcallback function (which you're already providing) to do whatever you want with the data. So your code might look something like: $.getJSON( url, function( data ) { // do stuff with data here, such as: callSomeOtherFunction( data ); }); In that callback function, you can store the data anywhere you want. You can call other functions. You can do anything you need to. What you *can't* do is try to use the data immediately after getJSONreturns. At that point, the data has not yet been downloaded. You have to use the callback function and call any other functions you need from there. -Mike On Sat, Sep 19, 2009 at 1:16 PM, Blixa shulgisnotmyem...@gmail.com wrote: I am using getJSON to get results from a different domain and i wanted to get _some_ object back when calling getJSON so that i can insert some variables into the callback scope. Basically, what i wanted to do was this: var new_json = $.getJSON(url, function(data) { alert (this.variable_from_caller); }); new_json.variable_from_caller = 'value'; The problem is that since url is on a different domain, the call to getJSON (which end up calling ajax) returns undefined and not an object that can be referenced (this is on line 3504 of the uncompressed jquery-1.3.2.js). I've noticed that if i change undefined to s i can reference the object from outside and have the variable exist within 'this' inside the anonymous callback, although s is not an XMLHttpRequest. Is this a bug? am i doing something wrong or twisted and there's a much easier way of accomplishing this in a way i am not aware of?
[jQuery] Some problems with rounded corners
For pages with a lot of text (and other content) I would like to have the possibility to hide and show parts of the page with 'buttons'. I have come a long way, but have some problems. I made a page to show them: http://www.decebal.nl/testing.html I have come a long way and for the most part it works. I use div's with class switch to define the blocks I want to show/hide. I then use jQuery to make those div's switchable and start with them not displayed. Look at the source to see how I have done this. I wanted buttons with rounded courners. Because this is not possible (as far as I know) without images, I use div's with class button and use jquery.corner.js to make round corners. For the biggest part this works. There is a problem with the displaying of the buttons. In Firefox and MIE it goes allright. But in Opera and Konqueror (and possible Safari, because this uses the same engine as Konqueror) the border is not displayed. That is not nice, but not a very big problem. But at the moment I click on a 'button' the rounded corners disappear. Is there something I can do about this? I am now Using $(this).parent().find('.switchButton, .hideButton').corner(); in the click function, but that does not work, because that makes a mess of hideButton. Also this work is also done in browser where it is not necessary. This is one of my first tries with jQuery. So if I do things inefficient I would not mind corrections or improvements. -- Cecil Westerhof
[jQuery] Re: help to simplify code
i wasn't being snarky mate, just that you phrased your question like a homework assignment! besides, i thought i /was/ answering your question tbh :S On Sep 20, 3:14 am, alienfactory alienfacto...@gmail.com wrote: wow really! not sure what to say about that. Here is a development link to the actual projecthttp://alienfactory.com/vision1/ if any one would like to help out on the javascript jquery question above Thanks in advance for any help
[jQuery] Re: help to simplify code
for fear of offending you further, i apologise in advance for posting code. personally i'd be tempted to call 'test1(this)' on the mouseover and mouseout events and have it do something like... function test1(t) { var c = $(t).css('background-color') var o = '1' if ( !$(t).hasClass('nav-active') ) o = '.2' $('.nav-active').removeClass('nav-active') $(t).addClass('nav-active') .siblings() .stop() .fadeTo('slow', o); $('#navigation').stop() .animate({ backgroundColor: c }, 500); } this is literally back-of-fagpacket code, so clearly it could be improved and/or tested. assigning a class just to track the opacity state probably isn't the greatest idea ever but it does mean you have easy access to the currently selected menu item. On Sep 20, 11:25 am, ryan.j ryan.joyce...@googlemail.com wrote: i wasn't being snarky mate, just that you phrased your question like a homework assignment! besides, i thought i /was/ answering your question tbh :S On Sep 20, 3:14 am, alienfactory alienfacto...@gmail.com wrote: wow really! not sure what to say about that. Here is a development link to the actual projecthttp://alienfactory.com/vision1/ if any one would like to help out on the javascript jquery question above Thanks in advance for any help
[jQuery] [Attrib external not working...]
Hi, Why this code not working? a rel=external href=www.google.comgoogle/a url www.google.com open in same windows. Thank´s
[jQuery] Re: [Attrib external not working...]
trya href=http://www.google.com;google/a On Sun, Sep 20, 2009 at 7:25 PM, Lord Gustavo Miguel Angel goosfanc...@gmail.com wrote: Hi, Why this code not working? a rel=external href=www.google.comgoogle/a url www.google.com open in same windows. Thank´s
[jQuery] Clear (cancel) Option
Hello, I'm trying to enable or disable the clear (cancel) from a button click. I also want to remove/add the star-rating-hover css class of this clear/cancel option. Is it possible? My code is based on Test 3-B example. Thanks in advance.
[jQuery] Re: [Attrib external not working...]
add this and it will work. if you want it to work it needs the following js code. function externalLinks() { if (!document.getElementsByTagName) return; var anchors = document.getElementsByTagName(a); for (var i=0; ianchors.length; i++) { var anchor = anchors[i]; if (anchor.getAttribute(href) anchor.getAttribute(rel) == external) anchor.target = _blank; } } window.onload = externalLinks; 2009/9/20 Lord Gustavo Miguel Angel goosfanc...@gmail.com Hi, Why this code not working? a rel=external href=www.google.comgoogle/a url www.google.com open in same windows. Thank´s -- Regards, Sergios Singeridis
[jQuery] Re: Some problems with rounded corners
For pages with a lot of text (and other content) I would like to have the possibility to hide and show parts of the page with 'buttons'. I have come a long way, but have some problems. I made a page to show them: http://www.decebal.nl/testing.html I have come a long way and for the most part it works. I use div's with class switch to define the blocks I want to show/hide. I then use jQuery to make those div's switchable and start with them not displayed. Look at the source to see how I have done this. I wanted buttons with rounded courners. Because this is not possible (as far as I know) without images, I use div's with class button and use jquery.corner.js to make round corners. For the biggest part this works. There is a problem with the displaying of the buttons. In Firefox and MIE it goes allright. But in Opera and Konqueror (and possible Safari, because this uses the same engine as Konqueror) the border is not displayed. That is not nice, but not a very big problem. But at the moment I click on a 'button' the rounded corners disappear. Is there something I can do about this? I am now Using $(this).parent().find('.switchButton, .hideButton').corner(); in the click function, but that does not work, because that makes a mess of hideButton. Also this work is also done in browser where it is not necessary. I changed your code a bit and posted the same page here: http://jquery.malsup.com/test/sep20.html Notice that I added a span tag to the switchButton and update the text of the span instead of the button. This will prevent the loss of the button corners and will allow you to call corner just one time instead of on ever click. Mike
[jQuery] Re: data function
Yes, and it returns true. On Sep 19, 6:47 pm, Mike McNally emmecin...@gmail.com wrote: Have you put a console.log() call in your mouseover handler? On Sat, Sep 19, 2009 at 10:03 AM, cafaro tvdbu...@gmail.com wrote: Hi, I'm trying to get the data() function working, but no success so far. Here's the code I've come up with: //$(a[href*='user.php?nick=']).data(test, true); $(a[href*='user.php?nick=']).mouseover(function() { $(this).data(test, true); }); $(a[href*='user.php?nick=']).mouseout(function() { console.log($(this).data(test)); }); After moving my cursor out of one of the selected anchor elements, i get undefined, instead of true, in my Firebug console. Any ideas? -- Turtle, turtle, on the ground, Pink and shiny, turn around.
[jQuery] Re: help to simplify code
i was asking about javascript/jquery not html 101 but that is cool though and yes that was snarky. LOL No worries at least you are trying to help thanks I dont see where you are fading the addtional div see link above for sample you focused on the navigavtion but i have 4 divs when mousing over one of them the other divs should fadeout How do you select additional div. Many Thanks On Sep 20, 4:17 am, ryan.j ryan.joyce...@googlemail.com wrote: for fear of offending you further, i apologise in advance for posting code. personally i'd be tempted to call 'test1(this)' on the mouseover and mouseout events and have it do something like... function test1(t) { var c = $(t).css('background-color') var o = '1' if ( !$(t).hasClass('nav-active') ) o = '.2' $('.nav-active').removeClass('nav-active') $(t).addClass('nav-active') .siblings() .stop() .fadeTo('slow', o); $('#navigation').stop() .animate({ backgroundColor: c }, 500); } this is literally back-of-fagpacket code, so clearly it could be improved and/or tested. assigning a class just to track the opacity state probably isn't the greatest idea ever but it does mean you have easy access to the currently selected menu item. On Sep 20, 11:25 am, ryan.j ryan.joyce...@googlemail.com wrote: i wasn't being snarky mate, just that you phrased your question like a homework assignment! besides, i thought i /was/ answering your question tbh :S On Sep 20, 3:14 am, alienfactory alienfacto...@gmail.com wrote: wow really! not sure what to say about that. Here is a development link to the actual projecthttp://alienfactory.com/vision1/ if any one would like to help out on the javascript jquery question above Thanks in advance for any help
[jQuery] Re: help to simplify code
http://docs.jquery.com/Traversing/siblings On Sep 20, 3:51 pm, alienfactory alienfacto...@gmail.com wrote: i was asking about javascript/jquery not html 101 but that is cool though and yes that was snarky. LOL No worries at least you are trying to help thanks I dont see where you are fading the addtional div see link above for sample you focused on the navigavtion but i have 4 divs when mousing over one of them the other divs should fadeout How do you select additional div. Many Thanks On Sep 20, 4:17 am, ryan.j ryan.joyce...@googlemail.com wrote: for fear of offending you further, i apologise in advance for posting code. personally i'd be tempted to call 'test1(this)' on the mouseover and mouseout events and have it do something like... function test1(t) { var c = $(t).css('background-color') var o = '1' if ( !$(t).hasClass('nav-active') ) o = '.2' $('.nav-active').removeClass('nav-active') $(t).addClass('nav-active') .siblings() .stop() .fadeTo('slow', o); $('#navigation').stop() .animate({ backgroundColor: c }, 500); } this is literally back-of-fagpacket code, so clearly it could be improved and/or tested. assigning a class just to track the opacity state probably isn't the greatest idea ever but it does mean you have easy access to the currently selected menu item. On Sep 20, 11:25 am, ryan.j ryan.joyce...@googlemail.com wrote: i wasn't being snarky mate, just that you phrased your question like a homework assignment! besides, i thought i /was/ answering your question tbh :S On Sep 20, 3:14 am, alienfactory alienfacto...@gmail.com wrote: wow really! not sure what to say about that. Here is a development link to the actual projecthttp://alienfactory.com/vision1/ if any one would like to help out on the javascript jquery question above Thanks in advance for any help
[jQuery] Re: Some problems with rounded corners
2009/9/20 Mike Alsup mal...@gmail.com: For the biggest part this works. There is a problem with the displaying of the buttons. In Firefox and MIE it goes allright. But in Opera and Konqueror (and possible Safari, because this uses the same engine as Konqueror) the border is not displayed. That is not nice, but not a very big problem. But at the moment I click on a 'button' the rounded corners disappear. Is there something I can do about this? I am now Using $(this).parent().find('.switchButton, .hideButton').corner(); in the click function, but that does not work, because that makes a mess of hideButton. Also this work is also done in browser where it is not necessary. I changed your code a bit and posted the same page here: http://jquery.malsup.com/test/sep20.html Notice that I added a span tag to the switchButton and update the text of the span instead of the button. This will prevent the loss of the button corners and will allow you to call corner just one time instead of on ever click. I use now also a span. This works. I also changed the variable names. Your names where better. It looks like it works now. (Not completly. When you look carefully, you see that the round corners disappear for a short period. But I can live with that.) Thanks. The only remaining problem is that Opera and Konqueror lose the border. If someone knows what is happening ... -- Cecil Westerhof
[jQuery] Re: help to simplify code
Here is another way you could do it: var bgColors = { services: '#8ac2b7', vision: '#9e97ca', approach: '#e5b120', team: '#cf1858' }; var $navigation = $('#navigation'); $('#bodycopy').children() .bind('mouseenter', function() { $(this).siblings().stop().fadeTo('slow', .2); $navigation.stop().animate({backgroundColor: bgColors[this.id]}, 500); }) .bind('mouseleave', function() { $(this).siblings().stop().fadeTo('slow', 1); $navigation.stop().animate({backgroundColor: '#404040'}, 500); }); $navigation.find('a') .bind('mouseenter mouseleave', function(event) { if (this.id.indexOf('nav') === 0) { var id = '#' + this.id.replace(/^nav/,''); $(id).trigger(event.type); } }); --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Sep 20, 2009, at 10:51 AM, alienfactory wrote: i was asking about javascript/jquery not html 101 but that is cool though and yes that was snarky. LOL No worries at least you are trying to help thanks I dont see where you are fading the addtional div see link above for sample you focused on the navigavtion but i have 4 divs when mousing over one of them the other divs should fadeout How do you select additional div. Many Thanks On Sep 20, 4:17 am, ryan.j ryan.joyce...@googlemail.com wrote: for fear of offending you further, i apologise in advance for posting code. personally i'd be tempted to call 'test1(this)' on the mouseover and mouseout events and have it do something like... function test1(t) { var c = $(t).css('background-color') var o = '1' if ( !$(t).hasClass('nav-active') ) o = '.2' $('.nav-active').removeClass('nav-active') $(t).addClass('nav-active') .siblings() .stop() .fadeTo('slow', o); $('#navigation').stop() .animate({ backgroundColor: c }, 500); } this is literally back-of-fagpacket code, so clearly it could be improved and/or tested. assigning a class just to track the opacity state probably isn't the greatest idea ever but it does mean you have easy access to the currently selected menu item. On Sep 20, 11:25 am, ryan.j ryan.joyce...@googlemail.com wrote: i wasn't being snarky mate, just that you phrased your question like a homework assignment! besides, i thought i /was/ answering your question tbh :S On Sep 20, 3:14 am, alienfactory alienfacto...@gmail.com wrote: wow really! not sure what to say about that. Here is a development link to the actual projecthttp://alienfactory.com/vision1/ if any one would like to help out on the javascript jquery question above Thanks in advance for any help
[jQuery] jqModal problem
I'm trying to use the jqModal plugin on my page: http://dev.iceburg.net/jquery/jqModal/ Here is a sample showing my problem: http://dennismadsen.com/uploads/modalTest/ If you see this example in a IE6 or IE7 or IE8 in compatibility mode, you will see, that the the modal box is not 100% opacity. It works great in FF, IE8, Chrome and so on. The problem is because of a position:relative; in the containerTop div - the parent div of the dialog. I hope somebody can figure out what the problem is and how to fix it?
[jQuery] Re: help to simplify code
Thanks Karl That was more then i expected. However the $navigation.find('a') section is a little over my head could add a few comments to that one to help me understand it Terry On Sep 20, 8:49 am, Karl Swedberg k...@englishrules.com wrote: Here is another way you could do it: var bgColors = { services: '#8ac2b7', vision: '#9e97ca', approach: '#e5b120', team: '#cf1858' }; var $navigation = $('#navigation'); $('#bodycopy').children() .bind('mouseenter', function() { $(this).siblings().stop().fadeTo('slow', .2); $navigation.stop().animate({backgroundColor: bgColors[this.id]}, 500); }) .bind('mouseleave', function() { $(this).siblings().stop().fadeTo('slow', 1); $navigation.stop().animate({backgroundColor: '#404040'}, 500); }); $navigation.find('a') .bind('mouseenter mouseleave', function(event) { if (this.id.indexOf('nav') === 0) { var id = '#' + this.id.replace(/^nav/,''); $(id).trigger(event.type); } }); --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Sep 20, 2009, at 10:51 AM, alienfactory wrote: i was asking about javascript/jquery not html 101 but that is cool though and yes that was snarky. LOL No worries at least you are trying to help thanks I dont see where you are fading the addtional div see link above for sample you focused on the navigavtion but i have 4 divs when mousing over one of them the other divs should fadeout How do you select additional div. Many Thanks On Sep 20, 4:17 am, ryan.j ryan.joyce...@googlemail.com wrote: for fear of offending you further, i apologise in advance for posting code. personally i'd be tempted to call 'test1(this)' on the mouseover and mouseout events and have it do something like... function test1(t) { var c = $(t).css('background-color') var o = '1' if ( !$(t).hasClass('nav-active') ) o = '.2' $('.nav-active').removeClass('nav-active') $(t).addClass('nav-active') .siblings() .stop() .fadeTo('slow', o); $('#navigation').stop() .animate({ backgroundColor: c }, 500); } this is literally back-of-fagpacket code, so clearly it could be improved and/or tested. assigning a class just to track the opacity state probably isn't the greatest idea ever but it does mean you have easy access to the currently selected menu item. On Sep 20, 11:25 am, ryan.j ryan.joyce...@googlemail.com wrote: i wasn't being snarky mate, just that you phrased your question like a homework assignment! besides, i thought i /was/ answering your question tbh :S On Sep 20, 3:14 am, alienfactory alienfacto...@gmail.com wrote: wow really! not sure what to say about that. Here is a development link to the actual projecthttp://alienfactory.com/vision1/ if any one would like to help out on the javascript jquery question above Thanks in advance for any help
[jQuery] AJAX search result filtering
Hello I was thinking of having my search result filters affect data automatically without reloading the page. What would be the best approach to this? I was thinking of attaching $.post(); to each filter checkbox or dropdown to submit that elements input then have the page update the results table. Something like this perhaps: - use post to send single filter to a page that stores it in a session ( do this whenever a filter is changed) - retrieve all stored filters in the session, fetch results and update page Would this be the best approach? I'd greatly appreciate some suggestions - thanks in advance
[jQuery] jQuery Star Rating from Fyneworks
I'm trying to adapt the Star Rating method given at: http://www.fyneworks.com/jquery/star-rating/#tab-Testing. I would like to use #3-B, except that when I click on a particular rating I want the tip to permanently change to the corresponding text, instead of reverting back to the original upon the onBlur() event. Tried to hack the code (jQuery.rating.js) but have not been successful. Would appreciate any tips :).
[jQuery] Re: data function
I already thought about adding it to an ID/class values, but the problem is that i need to pass a DOM object. On Sep 20, 4:28 pm, cafaro tvdbu...@gmail.com wrote: Yes, and it returns true. On Sep 19, 6:47 pm, Mike McNally emmecin...@gmail.com wrote: Have you put a console.log() call in your mouseover handler? On Sat, Sep 19, 2009 at 10:03 AM, cafaro tvdbu...@gmail.com wrote: Hi, I'm trying to get the data() function working, but no success so far. Here's the code I've come up with: //$(a[href*='user.php?nick=']).data(test, true); $(a[href*='user.php?nick=']).mouseover(function() { $(this).data(test, true); }); $(a[href*='user.php?nick=']).mouseout(function() { console.log($(this).data(test)); }); After moving my cursor out of one of the selected anchor elements, i get undefined, instead of true, in my Firebug console. Any ideas? -- Turtle, turtle, on the ground, Pink and shiny, turn around.
[jQuery] Queue event after getJSON request
I'm trying to queue to start once a getJSON request has finished but it's not working, I'm getting '...queue is not a function'. I've tried $.getJSON(http://;, function (data){ $.each(data, function(i,item){ ... }); }).queue(function(){ $(#div).fadeIn(); }); and $.getJSON(http://;, function (data){ $.each(data, function(i,item){ ... }).queue(function(){ $(#div).fadeIn(); }); }); but I get the same error. I've tried with 1.3.2 and 1.2.6.
[jQuery] Re: data function
I'll just make an array to store the data for each element. On Sep 20, 8:30 pm, cafaro tvdbu...@gmail.com wrote: I already thought about adding it to an ID/class values, but the problem is that i need to pass a DOM object. On Sep 20, 4:28 pm, cafaro tvdbu...@gmail.com wrote: Yes, and it returns true. On Sep 19, 6:47 pm, Mike McNally emmecin...@gmail.com wrote: Have you put a console.log() call in your mouseover handler? On Sat, Sep 19, 2009 at 10:03 AM, cafaro tvdbu...@gmail.com wrote: Hi, I'm trying to get the data() function working, but no success so far. Here's the code I've come up with: //$(a[href*='user.php?nick=']).data(test, true); $(a[href*='user.php?nick=']).mouseover(function() { $(this).data(test, true); }); $(a[href*='user.php?nick=']).mouseout(function() { console.log($(this).data(test)); }); After moving my cursor out of one of the selected anchor elements, i get undefined, instead of true, in my Firebug console. Any ideas? -- Turtle, turtle, on the ground, Pink and shiny, turn around.
[jQuery] Re: Powerfull WYSIWYG editor with upload image capability
On Sun, Sep 20, 2009 at 11:29 AM, David D dlinc...@gmail.com wrote: You don't need to use ckfinker. Ckeditor 3 just needs an upload and a browse url. You can make them in your prefered language. This one looks good too http://github.com/zilenCe/mootools-filemanager ( works with TinyMCE ) - Anush
[jQuery] Re: Powerfull WYSIWYG editor with upload image capability
What about tinymce? We use it in our app and love it. --- Why Be Red? Project Management Software http://whybered.com On Sun, Sep 20, 2009 at 3:45 PM, Anush Shetty anushshe...@gmail.com wrote: On Sun, Sep 20, 2009 at 11:29 AM, David D dlinc...@gmail.com wrote: You don't need to use ckfinker. Ckeditor 3 just needs an upload and a browse url. You can make them in your prefered language. This one looks good too http://github.com/zilenCe/mootools-filemanager ( works with TinyMCE ) - Anush
[jQuery] Variable Lifetime
Am I correct in thinking that variable in jquery are limited in scope by their parent functions, and if I want to persist data during a particular page's lifetime (thinking of a page that will exist for a while, being updated by AJAX calls, etc) I need to put it in an input control on that page - I am wanting to store data like sort-field for an AJAX updated data grid, so that data will need to be persistent and specific to that page, but I can't find any reference to global/page variables in jquery, so I was assuming I would need to have some hidden fields onthe page in which to store this data. Cheers MH
[jQuery] Re: fadeIn with IE 8 Compatibility Mode forced off
Sorry to bump this, but can anyone shed any light on this please? On Sep 16, 10:51 am, Mad-Halfling mad-halfl...@yahoo.com wrote: Hi, are there problems with the animation with IE8 compatibility mode forced off? I am using meta http-equiv=X-UA-Compatible content=IE=EmulateIE8 to force IE 8 out of compatibility mode for my site, as I need to use the new CSS support that IE 8 finally properly implements (it's an internal site, so I'm not worried about any other browsers), but I notice that in doing that the fadeIn (and Out) no longer seems to work - the content the method is being applied to just sits there for the fade duration and then disappears. This isn't a great hardship, but it would be nice to be able to showcase what jQuery can do and these effects would add a bit more wow-factor to the site. Thx MH
[jQuery] Re: jqModal problem
Have you tried adding modal: true into your jqm statement? On Sep 20, 5:52 pm, Dennis Madsen den...@demaweb.dk wrote: I'm trying to use the jqModal plugin on my page:http://dev.iceburg.net/jquery/jqModal/ Here is a sample showing my problem:http://dennismadsen.com/uploads/modalTest/ If you see this example in a IE6 or IE7 or IE8 in compatibility mode, you will see, that the the modal box is not 100% opacity. It works great in FF, IE8, Chrome and so on. The problem is because of a position:relative; in the containerTop div - the parent div of the dialog. I hope somebody can figure out what the problem is and how to fix it?
[jQuery] Re: jQuery Star Rating from Fyneworks
More specifics: I added the following function to jquery.rating.js. I want to have a variable called permatip which starts out as the tip from the stored value (this is connected to a db), and gets overwritten every time the user clicks on a particular star, via the select method. My problem is that I want the focus and blur methods to be able to read this variable. How do I do that? How/where does one specify global variables in jQuery? $(function(){ $('.hover-star').rating({ focus: function(value, link){ var tip = $('#hover-' + this.name); tip[0].data = tip[0].data || tip.html (); tip.html(link.title || 'value: '+value); }, select: function(value, link){ // The line below gets the value that I want. var permatip = ($('#hover-' + this.name).html(link.title.name)); alert(permatip); }, blur: function(value, link){ var tip = $('#hover-' + this.name); // I want this function to restore the permatip value to the tip element. But it does not recognize the variable. var permatip; alert(permatip); } });
[jQuery] Re: Queue event after getJSON request
In your first example, you're trying to call a .queue() method on the return value from $.getJSON(). $.getJSON() returns either an XMLHttpRequest object or nothing. It doesn't return the $ object. Also, $getJSON() returns *before* the request is completed. In the second example, you're trying to call a .queue() method on the return value from $.each(). $.each() returns the object you passed in as its first argument. So you're calling data.queue() which doesn't exist. Instead of chaining your calls, you can just make them separate statements: $.getJSON( http://;, function(data) { $.each( data, function(i, item) { //... }); $.queue(function() { $(#div).fadeIn(); }); }); I must confess I've never used $.queue(), so I don't know if that code is correct, but at least you wouldn't get the undefined queue method. But are you simply trying to fade in your div after the $.getJSON() request is completed and after you run the $.each() loop? You don't need queue for this: $.getJSON( http://;, function(data) { $.each( data, function(i, item) { //... }); $(#div).fadeIn(); }); -Mike On Sun, Sep 20, 2009 at 11:28 AM, cerberos pe...@whywouldwe.com wrote: I'm trying to queue to start once a getJSON request has finished but it's not working, I'm getting '...queue is not a function'. I've tried $.getJSON(http://;, function (data){ $.each(data, function(i,item){ ... }); }).queue(function(){ $(#div).fadeIn(); }); and $.getJSON(http://;, function (data){ $.each(data, function(i,item){ ... }).queue(function(){ $(#div).fadeIn(); }); }); but I get the same error. I've tried with 1.3.2 and 1.2.6.
[jQuery] Re: jqModal problem
I've done that now - doesn't help me :( I've uploaded a zip-file with the complete sample if it's easier for you: http://dennismadsen.com/uploads/modalTest/modalTest.zip On Sep 20, 9:56 pm, Mad-Halfling mad-halfl...@yahoo.com wrote: Have you tried adding modal: true into your jqm statement? On Sep 20, 5:52 pm, Dennis Madsen den...@demaweb.dk wrote: I'm trying to use the jqModal plugin on my page:http://dev.iceburg.net/jquery/jqModal/ Here is a sample showing my problem:http://dennismadsen.com/uploads/modalTest/ If you see this example in a IE6 or IE7 or IE8 in compatibility mode, you will see, that the the modal box is not 100% opacity. It works great in FF, IE8, Chrome and so on. The problem is because of a position:relative; in the containerTop div - the parent div of the dialog. I hope somebody can figure out what the problem is and how to fix it?
[jQuery] Re: Variable Lifetime
The reason you can't find any information about jQuery variables is that jQuery doesn't have variables! :-) You're talking about JavaScript, not jQuery. jQuery is not a language of its own, it's just a library of JavaScript code that you can use in your own JavaScript code. If you look for information about JavaScript variables you will have much better luck. So about those JavaScript variables... Fortunately for all of us, you don't have to use hidden input fields if you merely want to store data that will persist for the lifetime of your page. An ordinary global variable works fine for that. Also, you don't have to use global variables. Even *local* variables can easily outlive the function invocation that creates them. A trivial example: // When the '#test' button is clicked, // alert a number that increments each time $(document).ready( testSetup ); function testSetup() { var i = 0; $('#test').click( function() { alert( ++i ); }); } Here I made testSetup() a separate named function instead of the anonymous inline function that is more commonly used, just to make it clear that it * is* a separate function. testSetup() runs once and then returns immediately. What happens to the variable i when the function returns? Does it go away? No, JavaScript uses a *closure* to preserve this variable. Later, when you click the button, it calls the click callback function that issues the alert. Note that this inner function can still reference the i variable, and it can increment it too. JavaScript keeps that variable in existence as long as it needs to. Closures are a truly wonderful feature. Read up on them if you want a better understanding of how a lot of jQuery and JavaScript code works. So, is there ever a case where you *would* need to use a hidden input field instead of a global or local variable? Yes! If you want to preserve data even if the user hits the refresh button (or keyboard equivalent) to reload the page. When that happens, all JavaScript code and data is wiped clean and reloaded. If you want to preserve state in this situation, you can use a hidden form field. Or depending on what you are trying to do, you can use the hash fragment in your URL (the part after the #), or perhaps a cookie. But to simply keep data around as long as your page is running and not reloaded, global or local variables are all you need. -Mike On Sun, Sep 20, 2009 at 12:52 PM, Mad-Halfling mad-halfl...@yahoo.comwrote: Am I correct in thinking that variable in jquery are limited in scope by their parent functions, and if I want to persist data during a particular page's lifetime (thinking of a page that will exist for a while, being updated by AJAX calls, etc) I need to put it in an input control on that page - I am wanting to store data like sort-field for an AJAX updated data grid, so that data will need to be persistent and specific to that page, but I can't find any reference to global/page variables in jquery, so I was assuming I would need to have some hidden fields onthe page in which to store this data. Cheers MH
[jQuery] Re: data function
No, that's not what I meant. I mean this: add an id or class value to your a elements **in order to identify them in the console.log() output**. Keep using the data() function for storing values. Again, data() does really work; I use it all over the place and I've never had any problems with it, in Firefox, IE, Safari, Chrome, etc. On Sun, Sep 20, 2009 at 1:30 PM, cafaro tvdbu...@gmail.com wrote: I already thought about adding it to an ID/class values, but the problem is that i need to pass a DOM object. On Sep 20, 4:28 pm, cafaro tvdbu...@gmail.com wrote: Yes, and it returns true. On Sep 19, 6:47 pm, Mike McNally emmecin...@gmail.com wrote: Have you put a console.log() call in your mouseover handler? On Sat, Sep 19, 2009 at 10:03 AM, cafaro tvdbu...@gmail.com wrote: Hi, I'm trying to get the data() function working, but no success so far. Here's the code I've come up with: //$(a[href*='user.php?nick=']).data(test, true); $(a[href*='user.php?nick=']).mouseover(function() { $(this).data(test, true); }); $(a[href*='user.php?nick=']).mouseout(function() { console.log($(this).data(test)); }); After moving my cursor out of one of the selected anchor elements, i get undefined, instead of true, in my Firebug console. Any ideas? -- Turtle, turtle, on the ground, Pink and shiny, turn around. -- Turtle, turtle, on the ground, Pink and shiny, turn around.
[jQuery] Removing an element from Droppable with N elements triggers N times the event.
Hi all. My situation: I've a droppable div that I use for querying a database. Everytime I drag-drop an element to this droppable div, it updates the query. Following the same idea, if I remove an element from this div, it should update the query (deleting the removed element from the query). The droppable code is: $my_droppable.droppable({ accept: '.cloud li', activeClass: 'ui-state-highlight', drop: function(ev, ui) { addTagToMyDroppable(ui.draggable); } }); And the handler for the remove: $('.cloud li').click(function(ev) { var $item = $(this); var $target = $(ev.target); alert(pre-deleting); if ($target.is('a.ui-icon-search')) { addTagToMyDroppable($item); } else if ($target.is('a.ui-icon-trash')) { removeFromMyDroppable($item); } return false; }); Suppose that the droppable div has already 2 elements on it, and that removeFromMyDroppable() has an alert(deleting). When I remove a single element, the alert dialog prints: pre-deleting pre-deleting deleting deleting and then it updates the query twice, duplicating the query results. The same happens with more elements: if there were three elements, then three events will occur. Of course, what I want is to trigger the event only once. Any ideas? Thank you very much in advance.
[jQuery] Re: help to simplify code
Sure. // find all a elements within $navigation (which is a variable for $ ('#navigation') $navigation.find('a') // bind two events to those links: mouseenter and mouseleave. pass the event object as an argument to the anonymous function .bind('mouseenter mouseleave', function(event) { // if the ID of the link starts with nav ... if (this.id.indexOf('nav') === 0) { // store a string in the id variable. the string will be an id selector of the corresponding element within #bodycopy. // the string starts with # and ends with the ID of the link without the opening nav // for example, if the link's ID is navservices, the id variable will be #services var id = '#' + this.id.replace(/^nav/,''); // trigger the event (either mouseenter or mouseleave) for the element that matches the selector represented by id. // So, when the user's mouse enters a href= id=navservices/a, it will trigger mouseenter for div id=services/div. //And we've already bound mouseenter and mouseleave for those divs, so we're all set. $(id).trigger(event.type); } }); --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Sep 20, 2009, at 12:59 PM, alienfactory wrote: Thanks Karl That was more then i expected. However the $navigation.find('a') section is a little over my head could add a few comments to that one to help me understand it Terry On Sep 20, 8:49 am, Karl Swedberg k...@englishrules.com wrote: Here is another way you could do it: var bgColors = { services: '#8ac2b7', vision: '#9e97ca', approach: '#e5b120', team: '#cf1858' }; var $navigation = $('#navigation'); $('#bodycopy').children() .bind('mouseenter', function() { $(this).siblings().stop().fadeTo('slow', .2); $navigation.stop().animate({backgroundColor: bgColors[this.id]}, 500); }) .bind('mouseleave', function() { $(this).siblings().stop().fadeTo('slow', 1); $navigation.stop().animate({backgroundColor: '#404040'}, 500); }); $navigation.find('a') .bind('mouseenter mouseleave', function(event) { if (this.id.indexOf('nav') === 0) { var id = '#' + this.id.replace(/^nav/,''); $(id).trigger(event.type); } }); --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Sep 20, 2009, at 10:51 AM, alienfactory wrote: i was asking about javascript/jquery not html 101 but that is cool though and yes that was snarky. LOL No worries at least you are trying to help thanks I dont see where you are fading the addtional div see link above for sample you focused on the navigavtion but i have 4 divs when mousing over one of them the other divs should fadeout How do you select additional div. Many Thanks On Sep 20, 4:17 am, ryan.j ryan.joyce...@googlemail.com wrote: for fear of offending you further, i apologise in advance for posting code. personally i'd be tempted to call 'test1(this)' on the mouseover and mouseout events and have it do something like... function test1(t) { var c = $(t).css('background-color') var o = '1' if ( !$(t).hasClass('nav-active') ) o = '.2' $('.nav-active').removeClass('nav-active') $(t).addClass('nav-active') .siblings() .stop() .fadeTo('slow', o); $('#navigation').stop() .animate({ backgroundColor: c }, 500); } this is literally back-of-fagpacket code, so clearly it could be improved and/or tested. assigning a class just to track the opacity state probably isn't the greatest idea ever but it does mean you have easy access to the currently selected menu item. On Sep 20, 11:25 am, ryan.j ryan.joyce...@googlemail.com wrote: i wasn't being snarky mate, just that you phrased your question like a homework assignment! besides, i thought i /was/ answering your question tbh :S On Sep 20, 3:14 am, alienfactory alienfacto...@gmail.com wrote: wow really! not sure what to say about that. Here is a development link to the actual projecthttp://alienfactory.com/vision1/ if any one would like to help out on the javascript jquery question above Thanks in advance for any help
[jQuery] [tablesorter] parsers[i] is undefined
Hello guys, I have hard time to use tablesorter 2.0 with a javascript div update. I have tried it in several ways (using default Rails rjs file or all jquery call) but the result is the same: I get parsers[i] is undefined. Here what i would like to achieve: I have a list of states (California, Florida, Texas ...) and when I click one of them I would like to display in a div a table with the projects located in that state. So I fetch the projects in my controller and I update the div content, after that I call tablesorter initializer. Below you may find 2 of the solutions I tried 1 - call within the rjs file page.replace_html :detail, :partial = list, :locals = { :projects = @projects } pagejQuery('.p_table').tablesorter({ sortList: [[0,0]] }); 2- call within the view (complete) link_to_remote state, :url = display_projects_path(:state = state), :method = :get, :complete = jQuery('.p_table').tablesorter({ headers: { 0: { sorter: false }, 1: {sorter: true }, 2: { sorter: true }, 3: { sorter: true }, 4: { sorter: true }, 5: { sorter: true }}}); Any ideas why I get the parsers error? THANKS and have a nice day Sig
[jQuery] Suggestions on form validtion
Hello, I created this: http://dl.getdropbox.com/u/340087/Drops/09.20.09/form-e3ae8599-180653.html The basics are that jQuery will immediately hide a div that is the right most column. $('div.right').hide(); I have three input elements that when focus is given, I take the next() element, which is the right div, and fade that in. On blur, I take the next element, and set it back to hidden. This works well, and accomplishes what I want in as minimal code as I am able to hobble together. Next, I need to validate the fields, so working on user and name in this case, leaving email for later, since it will be more complex. If the string length of user is more than 1, I want to drop a new class to show to the right of the input. It would say OK and change the background color to green. If the string is less than 1, it would say invalid and change the background to red. Similar treatment to name and email of course, just different conditions. Using string length of 1 for simplicity, I will probably do (foo = 5) or something like that. I have not been able to get this to work, and I also do not want to add a lot of code for the validation. Suggestions on the correct process? How is my current approach? -- Scott * If you contact me off list replace talklists@ with scott@ *
[jQuery] [ScrollTo] animation only when mouseover
Hi there, I'm trying to use scrollTo in oder to scroll vertically a div. I want to use 2 anchors, one to go up and the other to go down and I need that the effect works ONLY when the mouse is over the anchor (when I move it out the animation has to stop). How can I achieve so? For instance the code below scrolls correctly down but it doesn't stop until the end even if I move out the mouse. $('#down_button').mouseover(function(){ $('#text').scrollTo('100%', {axis:'y', duration: 5000}); }).mouseout(function(){ }); THANKS Sig
[jQuery] Re: How do you make text selectable when using IE browser?
On Sep 19, 6:53 am, amtames matt.a...@tnmed.org wrote: Hi, We recently had our site redeveloped by a professional firm. We originally requested that users not be able to copy and paste text from our site. This has created an outcry and we would like to have text be selectable. I see that they achieved this by using jquery which I am not familiar. I believe that I have found the snippet of code that turns this ability off/on but I do not know how to write the correct code to allow selection of text. You don't have to do anything to *allow* selection of text, you just have to stop trying to prevent it. The simple solution is to turn off javascript, but likely your users don't know how to do that. This is an IE specific issue, not a problem in Firefox. Look for something like: document.onselectstart = function() {return false;} and remove it. -- Rob
[jQuery] Re: Convert AJAX XML response to HTML
First, make proper use of XML: root statusSuccess/status response div label for=SlotsOffered id=SlotsOfferedLabelNumber of Slots/label input id=SlotsOffered name=SlotsOffered type=text value=1/ /div /response /root Then it's easy: $.get('myserver.xyz', function(data){ var $xml = $(data); var status = $xml.find('status').text(); if ('Success' == status){ $('#myelement').html( $xml.find('response').html() ); } },'XML'); On Sep 18, 9:53 pm, mahen kunwarma...@gmail.com wrote: Hi, Can someone help me with a simple requirement. I want to use AJAX where the response from server side would be an XML with root element has two divs one for status with values success or failure and other child is HTML which needs to replaced if first div is success. eg. root div id=statusSuccess/div div id=response div label for=SlotsOffered id=SlotsOfferedLabelNumber of Slots/label input id=SlotsOffered name=SlotsOffered type=text value=1/ /div .. .. /div /root So if there is status success we need to replace a tag in existing HTML with response. Can some help me with it. Give me direction as to how to do it. Mahen
[jQuery] Re: Browser sniffing - the correct way?
On Sep 18, 1:32 am, ldexterldesign m...@ldexterldesign.co.uk wrote: [...] This still leaves the issue of targeting browsers with JS/jQuery. You still seem to be missing the message: trying to compensate for browser quirks by detecting specific browsers is a flawed strategy. Browser detection is usually based on the user agent string, of which there are over 30,000 registered at TNL.net. A friend of mine just recommend:http://www.quirksmode.org/js/detect.html Don't use it. Don't even consider detecting specific browsers for javascript quirks. For HTML or CSS hacks, go to relevant forums. Often the best solution is to simply avoid troublesome features. -- Rob