[jQuery] Re: bubbling of triggered events... ?
I was trying to catch an event on body tag, for example this doesn't work as expected: head script type=text/javascript src=js/jquery-1.3.2.min.js/script /head body onclick=alert('body!') div id=one onclick=alert('div!') style=width:100px;height: 100px;border:1px solid gray; !-- blank -- /div script $('#one').trigger('click'); /script /body although this one works: head script type=text/javascript src=js/jquery-1.3.2.min.js/script /head body div onclick=alert('body!') div id=one onclick=alert('div!') style=width: 100px;height:100px;border:1px solid gray; !-- blank -- /div /div script $('#one').trigger('click'); /script /body it took me sometime to figure this out, ' cause it was not stated anywhere. Why - body tag is not considered as parent? On May 17, 2:49 am, Mike Nichols nichols.mik...@gmail.com wrote: can you show some code that isn't working On May 16, 6:21 am, jayarjo jaya...@gmail.com wrote: New in jQuery 1.3: All triggered events now bubble up the DOM tree. For example if you trigger an event on a paragraph then it will trigger on that element first, then on the parent element, and its parent, and so on up to the document. The event object will have a .target property equal to the original triggered element. You can prevent the bubbling by calling stopPropagation() or by returning false from your callback.http://docs.jquery.com/Events/trigger#eventdata In other words triggered event should bubble up to it's parent container, should it? If yes, then I want to catch it on parents level and trigger it on another child of choice, and so on. But it doesn't seem to bubble... :( Any help appreciated.
[jQuery] Re: routing event to html map
Thanks. I've figured it out.The problem is, that the image getting manually triggered click event doesn't route it further to the associated html map (but it should, right? logically thinking). So my solution was to catch the event on image and route it further manually. On May 16, 9:51 pm, infoaddicted jack.lapla...@gmail.com wrote: It would be helpful if you posted snippets of your HTML along with the JQuery code. On May 16, 12:26 pm, jayarjo jaya...@gmail.com wrote: I've got several map tags with custom areas defined and corresponding images with usemap attributes. The problem is that those images are covered with transparent div. I manually intercept events on that div and route them to the images underneath it. But maps do not seem to react to routed events anymore. Is it correctable somehow? Or maybe I'm doing something wrong? The structure cannot be altered, transparent div must be on top and images and their corresponding maps must get the click event somehow :( Any suggestions?
[jQuery] jQuery Pagination Plugin ( Need to increase the number rows per page )
Hello All , I am using jQuery Pagination , the demo one is pagination with static data , Now i changed that static pagination into dynamic(retrieve data from db) , But the problem is , I cant display more then one row per page , Please find the attachment ,, Thanks -- உங்கள் நண்பன் பரணி குமார் Regards B.S.Bharanikumar POST YOUR OPINION http://bharanikumariyerphp.site88.net/bharanikumar/ pagination.rar Description: Binary data
[jQuery] Re: New inserted tag won't work with selector
Thanks. You guys are great! On May 14, 2:42 am, Richard D. Worth rdwo...@gmail.com wrote: See FAQ (Frequently Asked Questions): Why doesn't an event work on a new element I've created?http://docs.jquery.com/Frequently_Asked_Questions#Why_doesn.27t_an_ev... - Richard On Thu, May 14, 2009 at 2:14 AM, cohq82 quang...@gmail.com wrote: Is anyone aware of this problem? For example, the code below simply just inserts new P tag below the existing P's. When I move mouse over each of the P, I should see color change. Or when I click on new P, I should be able to trigger the P click event. That did not happen. Anyone knows how to fix this? This is just an example since I tried to do something similar. Thanks [code]!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html head script src=http://code.jquery.com/jquery-latest.js;/script script $(document).ready(function(){ $(p).click(function() { $(p).after(pHello/p); }); $(p).hover(function() { $(this).css('color','red'); }, function() { $(this).css('color','black'); }); }); /script stylep { background:yellow; }/style /head body pI would like to say: /p /body /html [/code]
[jQuery] Re: routing event to html map
I've found out (that gave me another hard hour), that in IE click event gets routed from image to associated map - automatically. I guess this issue should be handled by jQuery guys somehow. On May 17, 10:38 am, jayarjo jaya...@gmail.com wrote: Thanks. I've figured it out.The problem is, that the image getting manually triggered click event doesn't route it further to the associated html map (but it should, right? logically thinking). So my solution was to catch the event on image and route it further manually. On May 16, 9:51 pm, infoaddicted jack.lapla...@gmail.com wrote: It would be helpful if you posted snippets of your HTML along with the JQuery code. On May 16, 12:26 pm, jayarjo jaya...@gmail.com wrote: I've got several map tags with custom areas defined and corresponding images with usemap attributes. The problem is that those images are covered with transparent div. I manually intercept events on that div and route them to the images underneath it. But maps do not seem to react to routed events anymore. Is it correctable somehow? Or maybe I'm doing something wrong? The structure cannot be altered, transparent div must be on top and images and their corresponding maps must get the click event somehow :( Any suggestions?
[jQuery] Re: Cascade plugin help
sorry for the late reply, but you need to fire cascade manually at the end of the delegate and you can simplify your options, though I'd consider using $.data for this kind of thing: var defaultOpts = { ajax: {url: ‘otherData.js' }, template: commonTemplate, match: commonMatch, event: state.changed }; var OR = $.extend({},defaultOpts,{ ajax: {url: ‘orData.js' } }); var WA = $.extend({},defaultOpts,{ ajax: {url: ‘wasData.js' } }); //THen in your delegate: jQuery(.container-2 select).each(function() { var child = jQuery(this); child.parents (.container-2:first).siblings(.container-1).find (select).each(function() { //below I want to compare the verable to the different options I have above if(currentState == 'OR'){ child.cascade(jQuery (this),OR); } if(currentState == 'WA'){ child.cascade(jQuery (this),WA); } else{ child.cascade(jQuery (this),opts); } }); child.trigger(state.changed); }); On Apr 17, 12:04 pm, Chrisw chris.p.wel...@gmail.com wrote: I forgot to say what my issue is. It dose load anything if I remove the if statments it works fine. On Apr 17, 11:50 am, Chrisw chris.p.wel...@gmail.com wrote: I am new to jquery and I need to make a form that allows a user to select a state and a city that they go to school in. I am using thecascadejuqery plug-in (http://plugins.jquery.com/project/cascade. Which I think is a greatplugin) The problem is there is a lot of data and it takes a long time for it all to load (some 28,000 records). What I want to do is split it up into different files and then load only the file that contains the data for that start/region. A sample of my code is blow: My html: div class=container-1 label for=rsvp_stateState/label select id=rsvp_state option value=Pick a State/option option value=OROregon/option option value=WAWashington/option option value=CACalifornia/option /select /div div class=container-2 label for=rsvp_cityPick a City/label select id=rsvp_city /select /div //below are the different loads that contain different data based on the state var OR = { ajax: {url: ‘orData.js' }, template: commonTemplate, match: commonMatch }; var WA = { ajax: {url: ‘waData.js' }, template: commonTemplate, match: commonMatch }; var opts = { ajax: {url: ‘otherData.js' }, template: commonTemplate, match: commonMatch }; $(document).ready(function() { var currentState; // #rsvp_state refers to a dropdown menu that contains all the states //what I want to do with this is determine what state is currently // selected and store that in a variable $('#rsvp_state').change(function(){currentState = $ ('#rsvp_state').val();}); jQuery(.container-2 select).each(function() { var child = jQuery(this); child.parents(.container-2:first).siblings(.container-1).find (select).each(function() { //below I want to compare the verable to the different options I have above if(currentState == 'OR'){
[jQuery] Re: Dynamically setting tab index and .focus() problems
I finally get it working by specifiying custom focus and open events in the dialog settings. Here they are : // Setting new tabindex to input elements focus: function(e, ui) { $(e.target).find(':input:visible').each(function(i) { $(this).attr('tabindex', 3+i); }); } // Focusing first element of the form ,open: function() { $(this).find(':input[tabindex=3]').focus(); } What it does is reassigning new tabindex values to input fields in the modal box (starting with 3000 -big enough to be sure it will not mess with allready defined tabindex), and then focusing the first one (tabindex = 3). Tabbing through fields now works On 15 mai, 02:31, gearb0x beer...@gmail.com wrote: I've got the same problem with FF3, seems to work fine in IE7 Any luck? On May 10, 11:59 pm, Pixelastic timcc.pe...@gmail.com wrote: Hello, I'm opening a dialog box using the jQuery UI dialog methods, this box will display a form, and I would like to autofocus the first element. I'm also modifying tabindex of the different form fields of this new form in order to make them a lot higher than those of the original page, and thus navigate through the form using only the tab key. The issue is that I can correctly change tabindex values, and correctly focus the first element but pressing tab will not focus the next element in my newly added form but seems to act as I was focusing the first tabindexable element of my original page. I also note that manually focusing (ie. clicking) the element cause no problem, new tab index order is respected. Does anyone have a clue where it can came from ? Something seems to be messed up in the tabindex order. Tested on FF3, maybe the browser only update tabindex order on manual focus and not when modifying attributes ?
[jQuery] Re: .ajax GET not working correctly at webhost
Upon adding return false; to my submit function a most troublesome error has appeared. When you add data, the first time 1 post is inserted to the db like it should, second click though will generete 2 posts, third 3 posts and so on. Also my adding and removal of the attribute disabled to the button has stopped working correctly. On May 15, 2:17 pm, Mike Alsup mal...@gmail.com wrote: You need to add return false to your submit handler. $('form').submit(function() { // do ajaxy stuff return false; }); On May 15, 2:25 am, Nahaz pierre.christoffer...@gmail.com wrote: I can check that, but as I said before, it works perfectly fine on my local webserver, it's when the script is run on my webhost the issue occurs. The database seems to be very slow there at the moment. Ill check with firebug and post the results here. On May 14, 9:00 pm, James james.gp@gmail.com wrote: Sorry, I mean all HTTP header data. On May 14, 9:00 am, James james.gp@gmail.com wrote: Have you tried using the Firebug add-on for Firefox to debug whether theAJAXrequest was actually sent in the first place? It's very helpful because it'll show you the exact URL that it requests, theGET/POST data it sends, all HTTP data, and the response you receive. On May 13, 8:21 pm, Nahaz pierre.christoffer...@gmail.com wrote: Ah sorry about that. It doesn't cause an error, it looks like it sends data because ? nick=nick appears in your url but it does notgetinto the database somehow. If you call /data.php?nick=nick it will work, it's when it's called via $.ajax(); that the issue occurs. I havn't confirmed but it seems to occasionally work in IE7 but not FF or Chrome. I also tried to add cache: false and my own random generator to the url but it won'tgetposted to the url, only the ?nick=nick comes up. I will fix public access after work so you can see the problem in action. On May 13, 8:01 pm, James james.gp@gmail.com wrote: Define what not working correctly means. Does it cause an error? Does the requestgetsent but nothing happens? Does the requestgetsent without theGETdata? ... etc. On May 12, 12:00 pm, Nahaz pierre.christoffer...@gmail.com wrote: I have this snippet: function ajaxAdd() { $('form').submit(function() { var nick = document.register.nick.value; $(':submit', this).attr('value', 'Adding...'); $(':submit', this).attr('disabled', 'disabled'); $.ajax({ type: 'GET', url: 'data.php', data: 'nick=' + nick, success: function() { $(':submit', this).removeAttr('disabled'); $('#status').load('output.php'); } }); }); } that is sent when a very simple form (one value and button) is sent. The thing is, it works on my local webserver, but when I upload it to my webhost, it wont work. It works if add data.php?nick=Test, then the data will be added into my database but not when called from .ajax.- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] Re: .ajax GET not working correctly at webhost
I have resolved the multiplying of data error, there was some code in there that I thought I removed. I have uploaded the script so you can test it at http://dev.nahaz.se On May 17, 12:13 pm, Nahaz pierre.christoffer...@gmail.com wrote: Upon adding return false; to my submit function a most troublesome error has appeared. When you add data, the first time 1 post is inserted to the db like it should, second click though will generete 2 posts, third 3 posts and so on. Also my adding and removal of the attribute disabled to the button has stopped working correctly. On May 15, 2:17 pm, Mike Alsup mal...@gmail.com wrote: You need to add return false to your submit handler. $('form').submit(function() { // do ajaxy stuff return false; }); On May 15, 2:25 am, Nahaz pierre.christoffer...@gmail.com wrote: I can check that, but as I said before, it works perfectly fine on my local webserver, it's when the script is run on my webhost the issue occurs. The database seems to be very slow there at the moment. Ill check with firebug and post the results here. On May 14, 9:00 pm, James james.gp@gmail.com wrote: Sorry, I mean all HTTP header data. On May 14, 9:00 am, James james.gp@gmail.com wrote: Have you tried using the Firebug add-on for Firefox to debug whether theAJAXrequest was actually sent in the first place? It's very helpful because it'll show you the exact URL that it requests, theGET/POST data it sends, all HTTP data, and the response you receive. On May 13, 8:21 pm, Nahaz pierre.christoffer...@gmail.com wrote: Ah sorry about that. It doesn't cause an error, it looks like it sends data because ? nick=nick appears in your url but it does notgetinto the database somehow. If you call /data.php?nick=nick it will work, it's when it's called via $.ajax(); that the issue occurs. I havn't confirmed but it seems to occasionally work in IE7 but not FF or Chrome. I also tried to add cache: false and my own random generator to the url but it won'tgetposted to the url, only the ?nick=nick comes up. I will fix public access after work so you can see the problem in action. On May 13, 8:01 pm, James james.gp@gmail.com wrote: Define what not working correctly means. Does it cause an error? Does the requestgetsent but nothing happens? Does the requestgetsent without theGETdata? ... etc. On May 12, 12:00 pm, Nahaz pierre.christoffer...@gmail.com wrote: I have this snippet: function ajaxAdd() { $('form').submit(function() { var nick = document.register.nick.value; $(':submit', this).attr('value', 'Adding...'); $(':submit', this).attr('disabled', 'disabled'); $.ajax({ type: 'GET', url: 'data.php', data: 'nick=' + nick, success: function() { $(':submit', this).removeAttr('disabled'); $('#status').load('output.php'); } }); }); } that is sent when a very simple form (one value and button) is sent. The thing is, it works on my local webserver, but when I upload it to my webhost, it wont work. It works if add data.php?nick=Test, then the data will be added into my database but not when called from .ajax.- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] Re: problem with wrapper arrays.......
On May 6, 12:18 am, Karl Swedberg k...@englishrules.com wrote: On May 6, 2009, at 12:05 AM, kali wrote: On May 5, 10:05 pm, mkmanning michaell...@gmail.com wrote: Accessing the elements by index returns the element itself. To call jQuery methods you'd need to do this: divs = $('div'); div2 = divs[2]; THIS is what I did div2 = divs[2] -- is IGNORED It's NOT ignored. It returns a DOM node ( div id=test3 ) Please re-read what mkmanning wrote, because he's absolutely correct. pls runhttp://www.mayacove.com/dev/jquery/arrays.htmlon Firefox with JS console open, you will see it says: div2.addClass' is not a function... this is b/c the line div2 = divs [2] is IGNORED... No again. It's because you can't attach a jQuery method to a DOM node. so this divs = $('div'); is a query object but not this: div2 = divs[2]; i.e., var 'divs' is a query object (an array, supposedly, which all jQuery wrappers return, right?) but AN ELEMENT in that array (a jQuery object) is not a jQuery object? sorry, this IS a bit confusing
[jQuery] Re: problem with wrapper arrays.......
On May 17, 7:14 am, kali maya778...@yahoo.com wrote: On May 6, 12:18 am, Karl Swedberg k...@englishrules.com wrote: On May 6, 2009, at 12:05 AM,kaliwrote: On May 5, 10:05 pm, mkmanning michaell...@gmail.com wrote: Accessing the elements by index returns the element itself. To call jQuery methods you'd need to do this: divs = $('div'); div2 = divs[2]; THIS is what I did div2 = divs[2] -- is IGNORED It's NOT ignored. It returns a DOM node ( div id=test3 ) Please re-read what mkmanning wrote, because he's absolutely correct. pls runhttp://www.mayacove.com/dev/jquery/arrays.htmlonFirefox with JS console open, you will see it says: div2.addClass' is not a function... this is b/c the line div2 = divs [2] is IGNORED... No again. It's because you can't attach a jQuery method to a DOM node. so this divs = $('div'); is a query object but not this: div2 = divs[2]; i.e., var 'divs' is a query object (an array, supposedly, which all jQuery wrappers return, right?) but AN ELEMENT in that array (a jQuery object) is not a jQuery object? sorry, this IS a bit confusing actually, if you look here, http://www.manning-sandbox.com/thread.jspa?threadID=32220tstart=0 it looks like here the reference to an array element is NECESSARY for statement to work.. this is because the stmt is plain JavaScript and not jQuery, right??? and I thought it was so cool you could combine 'plain' JS with jQuery, but now I see it's a bit tricky... so, again: a wrapped set is a jQuery object, but an ELEMENT in the array returned by the wrapper is a plain JS object?? oh brother thank you
[jQuery] Re: problem with wrapper arrays.......
On May 17, 7:14 am, kali maya778...@yahoo.com wrote: On May 6, 12:18 am, Karl Swedberg k...@englishrules.com wrote: On May 6, 2009, at 12:05 AM,kaliwrote: On May 5, 10:05 pm, mkmanning michaell...@gmail.com wrote: Accessing the elements by index returns the element itself. To call jQuery methods you'd need to do this: divs = $('div'); div2 = divs[2]; THIS is what I did div2 = divs[2] -- is IGNORED It's NOT ignored. It returns a DOM node ( div id=test3 ) Please re-read what mkmanning wrote, because he's absolutely correct. pls runhttp://www.mayacove.com/dev/jquery/arrays.htmlonFirefox with JS console open, you will see it says: div2.addClass' is not a function... this is b/c the line div2 = divs [2] is IGNORED... No again. It's because you can't attach a jQuery method to a DOM node. so this divs = $('div'); is a query object but not this: div2 = divs[2]; i.e., var 'divs' is a query object (an array, supposedly, which all jQuery wrappers return, right?) but AN ELEMENT in that array (a jQuery object) is not a jQuery object? sorry, this IS a bit confusing actually, if you look here, http://www.manning-sandbox.com/thread.jspa?threadID=32220tstart=0 it looks like here the reference to an array element is NECESSARY for statement to work.. this is because the stmt is plain JavaScript and not jQuery, right??? and I thought it was so cool you could combine 'plain' JS with jQuery, but now I see it's a bit tricky... so, again: a wrapped set is a jQuery object, but an ELEMENT in the array returned by the wrapper is a plain JS object?? oh brother thank you
[jQuery] cluetip - highly recommended
Now that I have learned to use cluetip relatively well, 1. I want to congratulate the author for a job really well done. I am going to look up his book in the local book-store. 2. I have automated my entire online help system using his Ajax calls technique and it is working great! From a Ruby on Rails programmer's point of view, a few things that I found useful: You may want to consider putting in a default call to jQuery cluetip plugin (along with other plugins) in the application.html.erb as I show below: script type=text/javascript $(document).ready(function() { $(#accordion).accordion({ autoHeight: false, event: 'mouseover' }); $(.tip).cluetip( {width: 650, sticky: true, closePosition: 'title', arrows: true} ); }); /script This will apply to ALL views until you override it (or have to override it). The next tip is more subtle: I had sidebar help which was working perfect EXCEPT under certain conditions and through some detective work, I found that it had to do with my Rails Routing which was affecting the cluetip's rel attribute value. Specifically, the level of depth that you are at will affect cluetip's ability to locate the help file correctly. Here is a code snippet from the sidebar partial: % rel_path = (controller.action_name == 'index' ? '' : '../../') + 'images/xxx.jpg' % % image_str = link_to(Some Image, {}, {:class = tip, :title = Some Image, :rel = rel_path}) % See the rel_path variable above? If we are at a point where the default action index is used for any controller then a value such as images/xxx.jpg will cause Rails to look into the images directory off its document root which is the public directory. However, if you are deep within a specific action of a controller such as http://localhost:3000/client/edit/3 which means edit action of clients_controller for specific client number 3, then you have to give it a prefix to start two levels below as I show above. This was driving me crazy until I looked at the logs more closely and found that cluetip could not locate the correct file because of the Rails Route specifics. Again, these tips are Rails specific, but I suspect that a number of Rails programmers like me are using jQuery/cluetip and they may find it useful. Bharat
[jQuery] [clueTip] Issue with hoverIntent
Hi, I have been using clueTip, and decided to use the hoverIntent feature. Unfortunately, in some cases, the tooltip does not hide when I move away from the element, and stays displayed forever. It happens when I move quickly the mouse out of the element after a very short delay (the tooltip is almost ending to fade in). Changing the fade-in time does not correct the issue. For now, I have been forced to use a max display time for the tooltip in order to quick-and-dirty fix that issue, but : 1) it does not fix it entirely, because intead of displaying forever, the tooltip stays displayed for a few seconds 2) I can't let the tooltip displayed forever while the mouve is over the element, which is sad for long tooltips Thanks for the help, Kind regards
[jQuery] Re: Slide to fade, can you help me quick? Noob alert!
Try this: $(document).ready(function(){ $(.loginToggle).click(function(){ $(#loginForm).toggle(slow); }); }); Is not only fading, but more or less i think is what you need.
[jQuery] Re: Style Switcher
(Custom animation) exit then (Dissolve out) and slow speed down do the same for the next one only for entrance On Fri, May 15, 2009 at 7:35 PM, Amar amardeeps...@gmail.com wrote: Hi, I am just wondering if anyone knows if it is possible to fade the transition between switching one CSS to another? I am currently using jquery style switcher to get the transition. I am also using prototype/ scriptaculous to make div fields appear and fade in a duration of 0.5, and would like to time the CSS transition to be in sync with the div transition. Please see link below to see the website that I am building, and current CSS and div transition timings: http://amardeeprai.com/test/
[jQuery] How can I make diferent things depending on the 'msg' variable?
Hi, The fact is, I want to have diferent functions depending on the 'msg' variable. For example, if the msg variable is error i want son events to hapen a some other events not. My code is this: $('#login').ajaxForm({ url: 'revisar.php', beforeSubmit: function() { $('#loginCaja').html('Por favor espere...'); }, success: function(msg) { $('#loginCaja') .fadeIn('slow',function(){ }); if(msg=='error'){ $('#loginCaja').html('Usuario incorrecto'); } else { $('#loginCaja').html(msg); } $('#registroBox').fadeOut('slow'); } , error: function() { $('#loginCaja') .fadeIn('slow',function(){ }) .html('Error'); }} ); }); I wrote an if clause in the msg variable, but this doesnt works, it alwals like if the if is false. How can i make this work? I have jQuery library and jQuery.form library. Sorry for my english, i am from argentina. Thanks in advance
[jQuery] JQuery doesn't send X-Requested-With: XMLHttpRequest
I'm using JQuery 1.3.2 in my site. My requirement is to send some information to server side and retrieve xml back. Unfortunately when I send my parameters to server I always get the message: This XML file does not appear to have any style information associated with it. The document tree is shown below. in firefox 3.0.10 and then show the xml directly. I'm sure that the server get my parameters and execute my function successfully. My codes you can find as following. $.ajax({ url: xxx, data: xxx, cache: false, dataType: xml, error: function(xml) { alert('Error loading XML doc' + xml); }, success: function(xml) { x } }) NOTE: not cross domain request. All the requests are sent to the same server. Cheers.
[jQuery] Animating the specific div youre hovering over, from a selection of divs with the same name
Hi All, I have 3 divs with the same name wrapped in a container. Each div includes a span. At the moment, when you hover over a div, its displays all spans. What i want is if you hover over a specific div, i would like to display it's span only. Is this possible ? html head script type=text/javascript src=jquery.js/script script type=text/javascript $(document).ready(function(){ $('.alert').hide(); $(this).hover( function () { $(.alert).show('slow'); }, function () { $(.alert).hide('slow'); } ); }); /script style type=text/css #container{ width: 600px; height: 300px; } .item{ float: left; width:200px; height:300px; } /style /head body div id=container div class=item pthis is an item/p span class=alertHere is a warning/span /div div class=item pthis is an item/p span class=alertHere is a warning/span /div div class=item pthis is an item/p span class=alertHere is a warning/span /div /div /body /html Thanks in advance
[jQuery] superfish menu issue with wp_list_categories include
I understand this may be a generic issue with wp 2.7, but I can't get sub categories listed when using include=1,2,3,4 etc.. with wp_list_categories. Does anyone have a fix for this...I need to show only specific categories and their children in each menu and would like to use superfish or other jquery menu system to do so.
[jQuery] keyboardLayout
conflict mootools and jQuery script type=text/javascript src=js/jquery.js/script script type=text/javascript src=js/jquery.keyboardLayout.js/ script script type=text/javascript $(function(){ $(':password').keyboardLayout(); }); /script try such but dont work script type=text/javascript jQuery.noConflict(); jQuery(function(){ jQuery(':password').keyboardLayout(); }); /script = jquery.keyboardLayout.js == (function() { jQuery.keyboardLayout = {}; jQuery.keyboardLayout.indicator = $('span class=keyboardLayout / '); jQuery.keyboardLayout.target; jQuery.keyboardLayout.layout; jQuery.keyboardLayout.show = function(layout){ this.layout = layout; this.indicator.text(layout); this.target.after(this.indicator); }; jQuery.keyboardLayout.hide = function(){ this.target = null; this.layout = null; this.indicator.remove(); }; jQuery.fn.keyboardLayout = function() { this.each(function(){ $(this).focus(function(){ jQuery.keyboardLayout.target = $(this); }); $(this).blur(function(){ jQuery.keyboardLayout.hide(); }); $(this).keypress(function(e){ var c = (e.charCode == undefined ? e.keyCode : e.charCode); var layout = jQuery.keyboardLayout.layout; if (c = 97/*a*/ c = 122/*z*/ !e.shiftKey || c = 65/*A*/ c = 90/*Z*/e.shiftKey || (c == 91/*[*/ !e.shiftKey || c == 93/*]*/ !e.shiftKey || c == 123/*{*/ e.shiftKey || c == 125/*}*/ e.shiftKey || c == 96/*`*/ !e.shiftKey || c == 126/*~*/ e.shiftKey || c == 64/*...@*/e.shiftKey || c == 35/*#*/e.shiftKey || c == 36/*$*/e.shiftKey || c == 94/*^*/e.shiftKey || c == 38/**/e.shiftKey || c == 59/*;*/ !e.shiftKey || c == 39/*'*/ !e.shiftKey || c == 44/*,*/ !e.shiftKey || c == 60/**/e.shiftKey || c == 62/**/e.shiftKey) layout != 'EN') { layout = 'en'; } else if (c = 65/*A*/ c = 90/*Z*/ !e.shiftKey || c = 97/*a*/ c = 122/*z*/ e.shiftKey) { layout = 'EN'; } else if (c = 1072/*а*/ c = 1103/*я*/ !e.shiftKey || c = 1040/*А*/ c = 1071/*Я*/ e.shiftKey || (c == 1105/*ё*/ !e.shiftKey || c == 1025/*Ё*/ e.shiftKey || c == 8470/*No.*/ e.shiftKey || c == 59/*;*/ e.shiftKey || c == 44/*,*/ e.shiftKey) layout != 'RU') { layout = 'ru'; } else if (c = 1040/*А*/ c = 1071/*Я*/ !e.shiftKey || c = 1072/*а*/ c = 1103/*я*/ e.shiftKey) { layout = 'RU'; } if (layout) { jQuery.keyboardLayout.show(layout); } }); }); }; })(); ==
[jQuery] Re: jQuery in Firefox extension is broken in v1.3.2
try a new tool bar i heard it was the tool bar link . On Sat, May 16, 2009 at 12:06 AM, Simon Chiang simon.a.chi...@gmail.comwrote: Hi, I've run into this issue as well. I made an example extension to illustrate what happens: http://gist.github.com/112562 The gist has instructions for how to set everything up... basically you download the extension and add a file to your firefox profile with the path to the extension directory. In my experience jquery 1.2.6 is ok and doesn't cause the toolbar issue, while 1.3 and greater cause toolbar extensions to disappear. As mentioned this occurs without actually doing anything with jquery beyond loading it as a script. Any ideas? On Apr 5, 11:52 am, Jeff Jones pixelst...@gmail.com wrote: What add-ons do you have installed inFirefox? And do you have a public page we can test with ourFirefoxclients? On Apr 4, 9:07 am, bjorn.frant...@gmail.com bjorn.frant...@gmail.com wrote: I've seen this post now, but I can's see my problem mentioned there. Myextensionbreaks the toolbar inFirefoxif I have remove all other scripts in the XUL and only leaves jQuery there, no other code at all: ?xml version=1.0? overlay id=NBU-overlay xmlns=http://www.mozilla.org/keymaster/ gatekeeper/there.is.only.xul script src=chrome://myextension/content/code/jquery.js type=application/x-javascript/script /overlay So this is not caused by any code written bye me, but the inclusion of jQuery. Bjørn On Apr 3, 4:38 pm, MorningZ morni...@gmail.com wrote: I would suggest to take a look at this great blog post http://www.learningjquery.com/2009/03/3-quick-steps-for-a-painless-up... see if any of those breaking changes applies to your code.. the :visible change really is a big one... the @ in the selector is more an annoyance but anyways, maybe one of those 3 tips will help you fix your issue On Apr 3, 7:59 am, bjorn.frant...@gmail.com bjorn.frant...@gmail.com wrote: I am developing aFirefoxextensionand after upgrading from jQuery v1.2.6 to v1.3.2 I found that including jQuery in the XUL-file will break other extensions that displays buttons on the toolbar, among those is Adblock Plus. I have not tried any versions between those mentioned so I do not know in what version this happened. If i revert to v1.2.6 everything is OK.
[jQuery] problem with submitting a form with ajaxSubmit
I have a problem with submitting a form with ajaxSubmit - I am very confused because on a other page it is working the same way? here some code: $(#myForm1).validate({ submitHandler: function(form) { $(form).ajaxSubmit({ target: result, success: getData, clearForm: true });; }, rules: { name: required, time: required, tax: {required: true, number: true} } }); form id=myForm1 name=myForm1 method=post enctype=multipart/ form-data action=ajax.php when I press the submit button the form is submitted but the browser go to the ajax.php page?! could I check something?
[jQuery] How to replace hardcode_value in jquery library
Hi all, How to replace hardcode_value in jquery library with something more flexible value (for example something value from html document)? For example I'd like to substitute the hardcode_value (in jquery file) with the value input1 (in html document). thanks Antonio html document div id='contactForm' a href='#' class='contact' value='input1'Demo/a /div jquery documetn $(document).ready(function () { $('#contactForm input.contact, #contactForm a.contact').click (function (e) { e.preventDefault(); // load the contact form using ajax $.get(hardcode_value, function(data){ }
[jQuery] Asynchronous page loading + slide!
Hey guys! Im trying to use jquery to try to do what the image shows: Its for a website made for iphone so im trying to add the slide effect. It all seems a little complicated, but ill explain: 1-The user clicks a link 2-A loading message (or image) appears --- Meanwhile, the new page loads on a hidden side (its a FULL page, not just a div!!!) 3) The page ends loading Old page slides out to the left 4) It slides to the left its now hidden I want to do this without a page refresh or div...etc Everytime the link is clicked, its a whole new page that loads with html head /head body /body /html If anybody could help me, i would be VERY VERY VERY VERY VERY VERY GRATEFUL!!!
[jQuery] Re: Asynchronous page loading + slide!
i forgot to add the image: http://www.casimages.com/img.php?i=090517055258648972.png
[jQuery] Re: Slide to fade, can you help me quick? Noob alert!
$(document).ready(function(){ $(.loginToggle).click( function(){ $(#loginForm).*slideToggle*(slow); }); }); On Sun, May 17, 2009 at 5:21 AM, Jere jg13...@gmail.com wrote: Try this: $(document).ready(function(){ $(.loginToggle).click(function(){ $(#loginForm).toggle(slow); }); }); Is not only fading, but more or less i think is what you need.
[jQuery] Re: Animating the specific div youre hovering over, from a selection of divs with the same name
script type=text/javascript $(function(){ var obj = $(.item); var alert = $(.alert, obj); obj.hover(function() { alert.hide(500); }, function() { alert.show(500); }); }); /script On Sun, May 17, 2009 at 12:16 PM, napalm butt...@gmail.com wrote: Hi All, I have 3 divs with the same name wrapped in a container. Each div includes a span. At the moment, when you hover over a div, its displays all spans. What i want is if you hover over a specific div, i would like to display it's span only. Is this possible ? html head script type=text/javascript src=jquery.js/script script type=text/javascript $(document).ready(function(){ $('.alert').hide(); $(this).hover( function () { $(.alert).show('slow'); }, function () { $(.alert).hide('slow'); } ); }); /script style type=text/css #container{ width: 600px; height: 300px; } .item{ float: left; width:200px; height:300px; } /style /head body div id=container div class=item pthis is an item/p span class=alertHere is a warning/span /div div class=item pthis is an item/p span class=alertHere is a warning/span /div div class=item pthis is an item/p span class=alertHere is a warning/span /div /div /body /html Thanks in advance
[jQuery] Re: Animating the specific div youre hovering over, from a selection of divs with the same name
sorry error here this works script type=text/javascript $(function(){ var obj = $(.item); var alert = $(.alert, obj); obj.hover(function() { var current = obj.index($(this)); alert.eq(current).hide(500); }, function() { alert.eq(curent).show(500); }); }); /script On Sun, May 17, 2009 at 6:24 PM, waseem sabjee waseemsab...@gmail.comwrote: script type=text/javascript $(function(){ var obj = $(.item); var alert = $(.alert, obj); obj.hover(function() { alert.hide(500); }, function() { alert.show(500); }); }); /script On Sun, May 17, 2009 at 12:16 PM, napalm butt...@gmail.com wrote: Hi All, I have 3 divs with the same name wrapped in a container. Each div includes a span. At the moment, when you hover over a div, its displays all spans. What i want is if you hover over a specific div, i would like to display it's span only. Is this possible ? html head script type=text/javascript src=jquery.js/script script type=text/javascript $(document).ready(function(){ $('.alert').hide(); $(this).hover( function () { $(.alert).show('slow'); }, function () { $(.alert).hide('slow'); } ); }); /script style type=text/css #container{ width: 600px; height: 300px; } .item{ float: left; width:200px; height:300px; } /style /head body div id=container div class=item pthis is an item/p span class=alertHere is a warning/span /div div class=item pthis is an item/p span class=alertHere is a warning/span /div div class=item pthis is an item/p span class=alertHere is a warning/span /div /div /body /html Thanks in advance
[jQuery] Re: Background color is being applied when using Cycle plugin
First: I love this plugin. I am using it for news headlines and for a image gallery! Secondly: cleartypeNoBg: true worked for me for IE6 DIV background color but it was hard to find cause it wasn't on the website at ... http://www.malsup.com/jquery/cycle/options.html Maybe this should be added. On Apr 23, 8:32 am, Shane Riley shanerileydoti...@gmail.com wrote: In case anyone was wondering why, here's the solution from Mike Alsup. Hope it helps anyone else with the issue. Hi Shane, There are two cleartype options inCycle, and unfortunately one of them is not documented (yet). The general purpose of the cleartype logic inCycleis to workaround a rendering issue in IE when cleartype is enabled on the system. When a Windows machine has cleartype enabled, IE6/7 render text aliased when there is an opacity filter applied to an element. In IE6, the effects of this can be greatly minimized if the element in question has an explicit background color. WhenCycle's'cleartype' option is true thepluginwill attempt to set a background color on all of the slides to provided better antialiasing support on IE6. To determine the best bg color, thepluginwalks up the parent hierarchy until it finds a parent with a non-transparent background color. If it doesn't find one then it uses white. In addition, when the cleartype option is true thepluginwill always try to remove the opacity filter after the transition completes, this fixes the aliased text on IE7. SinceCycleis used in many, many different environments I realized that there are some cases in which setting a specific background color is not desirable. A long time ago I added an option called 'cleartypeNoBg'. When this option is trueCyclewill *not* set a background color on the slide elements (but it will still remove the opacity filter after each slide transition). In Internet Explorer the default value ofCycle's'cleartype' option is true in recent versions of theplugin. So to use the undocumented option you would do this: $('#slideshow').cycle({ cleartypeNoBg: true }); Hope this helps with the problem you're having. Mike On Apr 22, 6:00 pm, Shane Riley shanerileydoti...@gmail.com wrote: I've been using Mike Alsup'sCyclepluginon a large number of projects, and one of the most recent ones is giving me trouble in IE. In this example, the slide container seems to have a background color applied to it, and there is neither a background property added to it nor is there any background property in the CSS for the slide element or its children. I finally decided to recreate the effect from scratch to make sure it wasn't some strange IE bug or the markup, and the from- scratch version works no problem. Here are the two examples, both are in the past lectures module: http://shaneriley.info/fldc/(withCycleplugin)http://shaneriley.info/fldc/index_custom.html Anyone have any idea why this is happening? I haven't seen this happen before, however I may be using a more recent version than usual.
[jQuery] forms plugin: problem with $.get
Hello, i have no clue why it is like this, but in the following code, the errors variable doesnt count +1: $.get(functions/checkforms.php,{doesuserexist: loginusername, doespasswordexist: loginpassword}, function(data){ if (data) { $(#loginpassword_error).show().append(data); errors++; } }); Do you know how i can check if data exist, to set errors +1? Regards, Shade
[jQuery] Problem with Ajax Request and Escape
Hello. First of all, I'm German, so be warned ;) I've got a problem and my very hope are you guys (and girls). Here is my code I use to make a ajax request: $.ajax( $.extend(ajax, { data: { cmd:'ping', username:session.username, timestamp:ping.last }, error: function() { that.notifyPingingFailed(); }, success: function(data) { if(data.error) { that.notifyPingingFailed(); } else { that.notifyPingingFinished(loadResponse(data)); } } }) ); Don't wonder about the $.extend cause I make this kind of request more than one time and so I've exclude some basic options. You can see I make a request called 'ping' and exatly this request tries 30s seconds to get new data from server (PHP). If there are no changes, the request will return an empty array otherwise the new data as json. After that, the request will be called again. Now my problem: If I press the escape-button, the request will be canceled. That's pretty uncool because there's no new request. Can anyone of you help me? I've tried to catch the escape-press event this way: $(document).keyup(function(e) { if(e.keyCode == 27) { return false; } } But this isn't helpful cause the request will be still canceled. Need your help, really ;)
[jQuery] Re: Background color is being applied when using Cycle plugin
Secondly: cleartypeNoBg: true worked for me for IE6 DIV background color but it was hard to find cause it wasn't on the website at ... http://www.malsup.com/jquery/cycle/options.html Maybe this should be added. Good point - just added it.
[jQuery] I'll Donate $20USD to Jquery if you can teach me how to do this
Hey Guys/Gals, I have been able to use JQuery in the past, for simple things, and after much hacking around, i have been able to get it to work. I want to embrace this technology, but I can't get past the examples. They're very basic, and I can't wrap my head around how to move them into real world scenarios. I'm a dev, but not a javascript dev. I mean, i know how to do this in Javascript, using xpath and filters, but i really want to use JQuery as the engine, to keep it consistant with the rest of the project. using Javascript, I would just do a var tDay = Document.DOM.selectSinglenode(/schedule/day [...@name=Monday]) and then loop thru there and list out everything into my table, and display the html But i want to do this using JQuery. Here is the sample xml: schedule day name=Monday show time0800-1000/time djnonstop rock/dj shownamenonstop music/showname /show show time1000-1200/time djnonstop rock/dj shownamenonstop music/showname /show /day day name=Tuesday show time0800-1000/time djnonstop rock/dj shownamenonstop music/showname /show show time1000-1200/time djnonstop rock/dj shownamenonstop music/showname /show show time1200-1400/time djnonstop rock/dj shownamenonstop music/showname /show /day /schedule So, here's what i want to see... I can understand the code when i see it, but i'd like to see the specific code. So, the first part would be to isolate the attribute of name for the day element, Then how it loops thru each 'show' element, and find the 'time', the 'dj' and the 'showname'. once i get that, i can add them together with the html and post it to the .append code. I just don't understand how the daisy chain would work from here. Thanks for you help. The application on this, will be end up being an ajax app, where i pass it the day of the week (monday/tuesday/ wednesday) and it will display the shows for that day in order of time. ~Doc
[jQuery] Re: jQuery iPhone Flick Action (for mouse)
No ideas anyone? On May 16, 12:55 am, Chris J. Lee chri...@gmail.com wrote: I've been looking for a plugin to be able to use the mouse and eventually theiphoneto flick and navigate through a page. Does anyone know if there are examples that exist currently. I think i'd probably have to implement it using the scrollTo plugin to do the scrolling. With luck i was able to find that there is aniPhoneonly flick type plugin already written but nothing yet for the mouse. Anyone have ideas?
[jQuery] Re: Asynchronous page loading + slide!
I saw a tutorial like this: http://srobbin.com/blog/jquery-pageslide/ It might be something you can modify or add functionality. - Chris On May 17, 12:08 pm, blackjak231 thibault...@gmail.com wrote: i forgot to add the image:http://www.casimages.com/img.php?i=090517055258648972.png
[jQuery] jQuery Media - won't autostart an mp3
I need to play an audio file in response to a user action. The player must be completely cross-browser compatible, and hopefully use an available plug-in. jQuery.media seems to be the ticket, but while I can get it to work in manual mode, it doesn't autoplay for me. This may be a problem with player.swf, not jQuery.media(), but this test page: www elearningcorner com / products/media/index.htm shows the problem. The rendered html (viewed by Firebug) looks good to me: embed height=400 width=400 flashvars=file=elements%2Faudio %2Fhallelujah.mp3 autoplay=true wmode=transparent bgcolor=#ff pluginspage=http://www.adobe.com/go/getflashplayer; type=application/x-shockwave-flash src=player.swf?file=elements %2Faudio%2Fhallelujah.mp3 style=display: block;/ I don't see anything wrong there. In fact, if you load the src=player.swf?... in your browser URL, it plays. I am guessing that the autoplay=true isn't passed properly, or maybe should be passed in flashvars. I modified the code to pass it in flashvars and IE begins to autoplay, not so in Firefox or Safari. If this is a player.swf revision issue, if you can, please respond with a URL to a working player.swf. ktnxbye.
[jQuery] Odd overlap issue with cycle plugin
I have a slideshow set up here, for reference: http://www.littlerobothead.com/secret.php You'll be able to see the slides as they overlap when using the next or previous buttons. The CSS that controls the slides themselves is: #top-feature { /* this is the parent container */ height: 300px; padding: 20px 0 0 0; border-bottom: 2px solid #452219; background: url('/images/1.jpg') top left repeat; overflow: hidden; } .slide { /* this is the child class for slides */ width: 700px; margin: 30px; padding: 20px; background: url('/images/darkbrown-80.png') top left repeat; height: 220px; float: left; border-bottom: 1px solid #320104; } I believe I've satisfied the requirements of the plugin (i.e. fixed height and width for slides, overflow hidden on parent container). To be clear, it works just fine with any fx method other than scrollHorz or scrollVert; in both, the slides overlap at the top or bottom as they transition. I'm sure I'm missing something simple. I've tried a bit of tweaking on the CSS itself, but nothing changes. Any ideas? Thanks all.
[jQuery] Odd overlap issue with cycle plugin
I have a slideshow set up here, for reference: http://www.littlerobothead.com/secret.php You'll be able to see the slides as they overlap when using the next or previous buttons. The CSS that controls the slides themselves is: #top-feature { /* this is the parent container */ height: 300px; padding: 20px 0 0 0; border-bottom: 2px solid #452219; background: url('/images/1.jpg') top left repeat; overflow: hidden; } .slide { /* this is the child class for slides */ width: 700px; margin: 30px; padding: 20px; background: url('/images/darkbrown-80.png') top left repeat; height: 220px; float: left; border-bottom: 1px solid #320104; } I believe I've satisfied the requirements of the plugin (i.e. fixed height and width for slides, overflow hidden on parent container). To be clear, it works just fine with any fx method other than scrollHorz or scrollVert; in both, the slides overlap at the top or bottom as they transition. I'm sure I'm missing something simple. I've tried a bit of tweaking on the CSS itself, but nothing changes. Any ideas? Thanks all.
[jQuery] Re: Background color is being applied when using Cycle plugin
Sweet.. !! :) On May 17, 2:43 pm, Mike Alsup mal...@gmail.com wrote: Secondly: cleartypeNoBg: true worked for me for IE6 DIV background color but it was hard to find cause it wasn't on the website at ... http://www.malsup.com/jquery/cycle/options.html Maybe this should be added. Good point - just added it.
[jQuery] Re: problem with horizontal menu style
Could you explain me how to do that? Is it inside superfish module? Or do i have to edit a specific file? Rui. On May 16, 5:13 pm, Charlie charlie...@gmail.com wrote: fix your overflow: hidden in parent div rui wrote:Sorry! Here it is:www.freequizzes.info/codigoOn 15 maio, 18:21, Ethan Matejaethan.mat...@gmail.comwrote:Link? On Fri, May 15, 2009 at 12:00 PM, ruimourato@gmail.comwrote:I've just installed this extension, but i'm having some problems.Need to implement a horizontal menu style in user4, or user 3 positions on rhuk_milkyway template.When the menu drops down, it's not visible.what can i do?Thanks and regardsRui-- Respectfully, Ethan Mateja +++ Packetforwardwww.packetforward.com
[jQuery] Re: .ajax GET not working correctly at webhost
I have resolved all issues now and it's working, thanks for all the help! This is the code I have right now: function ajaxAdd() { $('form').submit(function() { var nick = document.register.nick.value; $(':submit', this).attr('value', 'Adding...'); $(':submit', this).attr('disabled', 'disabled'); $.ajax({ type: 'GET', url: 'data.php', data: nick= + nick, cache: false, success: function() { $(':submit').removeAttr('disabled'); $(':submit').attr('value', 'Add'); $(':text').removeAttr('value'); $('#status').load('output.php'); } }); return false; }); } It posts an url like: data.php?_=124819246nick=nick Once again, thanks for all the help! On May 17, 12:29 pm, Nahaz pierre.christoffer...@gmail.com wrote: I have resolved the multiplying of data error, there was some code in there that I thought I removed. I have uploaded the script so you can test it athttp://dev.nahaz.se On May 17, 12:13 pm, Nahaz pierre.christoffer...@gmail.com wrote: Upon adding return false; to my submit function a most troublesome error has appeared. When you add data, the first time 1 post is inserted to the db like it should, second click though will generete 2 posts, third 3 posts and so on. Also my adding and removal of the attribute disabled to the button has stopped working correctly. On May 15, 2:17 pm, Mike Alsup mal...@gmail.com wrote: You need to add return false to your submit handler. $('form').submit(function() { // do ajaxy stuff return false; }); On May 15, 2:25 am, Nahaz pierre.christoffer...@gmail.com wrote: I can check that, but as I said before, it works perfectly fine on my local webserver, it's when the script is run on my webhost the issue occurs. The database seems to be very slow there at the moment. Ill check with firebug and post the results here. On May 14, 9:00 pm, James james.gp@gmail.com wrote: Sorry, I mean all HTTP header data. On May 14, 9:00 am, James james.gp@gmail.com wrote: Have you tried using the Firebug add-on for Firefox to debug whether theAJAXrequest was actually sent in the first place? It's very helpful because it'll show you the exact URL that it requests, theGET/POST data it sends, all HTTP data, and the response you receive. On May 13, 8:21 pm, Nahaz pierre.christoffer...@gmail.com wrote: Ah sorry about that. It doesn't cause an error, it looks like it sends data because ? nick=nick appears in your url but it does notgetinto the database somehow. If you call /data.php?nick=nick it will work, it's when it's called via $.ajax(); that the issue occurs. I havn't confirmed but it seems to occasionally work in IE7 but not FF or Chrome. I also tried to add cache: false and my own random generator to the url but it won'tgetposted to the url, only the ?nick=nick comes up. I will fix public access after work so you can see the problem in action. On May 13, 8:01 pm, James james.gp@gmail.com wrote: Define what not working correctly means. Does it cause an error? Does the requestgetsent but nothing happens? Does the requestgetsent without theGETdata? ... etc. On May 12, 12:00 pm, Nahaz pierre.christoffer...@gmail.com wrote: I have this snippet: function ajaxAdd() { $('form').submit(function() { var nick = document.register.nick.value; $(':submit', this).attr('value', 'Adding...'); $(':submit', this).attr('disabled', 'disabled'); $.ajax({ type: 'GET', url: 'data.php', data: 'nick=' + nick, success:
[jQuery] [validate] editing the error messages
I want to make my error messages position absolutely so they do not resize my form when they appear. The problem is the parent of all the label.error is the form so when I do label.error { position:absolute; background:url(images/ validArrow.png); width:300px; color: red; left:300px; top:10px padding: 0px 0px 20px 50px; } they all stack up on top of each other is there a way to make them children of the label or the input? labelCompany Name/label input name=companyName id=companyName class=required value= / Failing than can I just set individual class ids for the error and set some css of the individual error labels? Thanks, R.
[jQuery] Re: I'll Donate $20USD to Jquery if you can teach me how to do this
I can't figure out why you want to pass data in a non-usable format so you have to whack away at it with lots of code to turn it into what you need. Why not generate what you need to start with, so the task is reduced to simply requesting a chunk of html and inserting it into the DOM. On May 17, 3:09 pm, KrushRadio - Doc drega...@gmail.com wrote: Hey Guys/Gals, I have been able to use JQuery in the past, for simple things, and after much hacking around, i have been able to get it to work. I want to embrace this technology, but I can't get past the examples. They're very basic, and I can't wrap my head around how to move them into real world scenarios. I'm a dev, but not a javascript dev. I mean, i know how to do this in Javascript, using xpath and filters, but i really want to use JQuery as the engine, to keep it consistant with the rest of the project. using Javascript, I would just do a var tDay = Document.DOM.selectSinglenode(/schedule/day [...@name=Monday]) and then loop thru there and list out everything into my table, and display the html But i want to do this using JQuery. Here is the sample xml: schedule day name=Monday show time0800-1000/time djnonstop rock/dj shownamenonstop music/showname /show show time1000-1200/time djnonstop rock/dj shownamenonstop music/showname /show /day day name=Tuesday show time0800-1000/time djnonstop rock/dj shownamenonstop music/showname /show show time1000-1200/time djnonstop rock/dj shownamenonstop music/showname /show show time1200-1400/time djnonstop rock/dj shownamenonstop music/showname /show /day /schedule So, here's what i want to see... I can understand the code when i see it, but i'd like to see the specific code. So, the first part would be to isolate the attribute of name for the day element, Then how it loops thru each 'show' element, and find the 'time', the 'dj' and the 'showname'. once i get that, i can add them together with the html and post it to the .append code. I just don't understand how the daisy chain would work from here. Thanks for you help. The application on this, will be end up being an ajax app, where i pass it the day of the week (monday/tuesday/ wednesday) and it will display the shows for that day in order of time. ~Doc
[jQuery] Re: Repeating userCollapseText
Hi Jorge, Can you show me a page that has that problem so I can troubleshoot? --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On May 16, 2009, at 6:13 PM, jorgevima74 wrote: Hi! I'm using jquery.expander and I'm getting twice the userCollapseText value ( [collapse all][collapse all]). You know why??? Jorge.
[jQuery] Re: I'll Donate $20USD to Jquery if you can teach me how to do this
$(function(){ $.ajax({ type: GET, url: test.xml, dataType: xml, success: function(data){ $('day[name=Monday]show', data).each(function(){ $(this).each(function(){ time = $(this).find('time').text(); dj = $(this).find('dj').text(); showname =$(this).find('showname').text(); $('body').append(time + 'br /' + dj + 'br /' + showname + 'br /br /'); }); }); } }); });
[jQuery] Re: I'll Donate $20USD to Jquery if you can teach me how to do this
$(function(){ $.ajax({ type: GET, url: test.xml, dataType: xml, success: function(data){ $('day[name=Monday]show', data).each(function(){ time = $(this).find('time').text(); dj = $(this).find('dj').text(); showname =$(this).find('showname').text(); $('body').append(time + 'br /' + dj + 'br /' + showname + 'br /br /'); }); } }); });
[jQuery] Re: I'll Donate $20USD to Jquery if you can teach me how to do this
donb because passing xml can be much smaller then passing the data with html wrapped around it. On May 17, 6:41 pm, donb falconwatc...@comcast.net wrote: I can't figure out why you want to pass data in a non-usable format so you have to whack away at it with lots of code to turn it into what you need. Why not generate what you need to start with, so the task is reduced to simply requesting a chunk of html and inserting it into the DOM. On May 17, 3:09 pm, KrushRadio - Doc drega...@gmail.com wrote: Hey Guys/Gals, I have been able to use JQuery in the past, for simple things, and after much hacking around, i have been able to get it to work. I want to embrace this technology, but I can't get past the examples. They're very basic, and I can't wrap my head around how to move them into real world scenarios. I'm a dev, but not a javascript dev. I mean, i know how to do this in Javascript, using xpath and filters, but i really want to use JQuery as the engine, to keep it consistant with the rest of the project. using Javascript, I would just do a var tDay = Document.DOM.selectSinglenode(/schedule/day [...@name=Monday]) and then loop thru there and list out everything into my table, and display the html But i want to do this using JQuery. Here is the sample xml: schedule day name=Monday show time0800-1000/time djnonstop rock/dj shownamenonstop music/showname /show show time1000-1200/time djnonstop rock/dj shownamenonstop music/showname /show /day day name=Tuesday show time0800-1000/time djnonstop rock/dj shownamenonstop music/showname /show show time1000-1200/time djnonstop rock/dj shownamenonstop music/showname /show show time1200-1400/time djnonstop rock/dj shownamenonstop music/showname /show /day /schedule So, here's what i want to see... I can understand the code when i see it, but i'd like to see the specific code. So, the first part would be to isolate the attribute of name for the day element, Then how it loops thru each 'show' element, and find the 'time', the 'dj' and the 'showname'. once i get that, i can add them together with the html and post it to the .append code. I just don't understand how the daisy chain would work from here. Thanks for you help. The application on this, will be end up being an ajax app, where i pass it the day of the week (monday/tuesday/ wednesday) and it will display the shows for that day in order of time. ~Doc
[jQuery] Re: problem with horizontal menu style
It's in the css for the template. The parent container #search has overlflow: hidden, so your menu isn't showing outside the size of the search tag, works fine when turned off in firebug rui wrote: Could you explain me how to do that? Is it inside superfish module? Or do i have to edit a specific file? Rui. On May 16, 5:13pm, Charlie charlie...@gmail.com wrote: fix your overflow: hidden in parent div rui wrote:Sorry! Here it is:www.freequizzes.info/codigoOn 15 maio, 18:21, Ethan Matejaethan.mat...@gmail.comwrote:Link? On Fri, May 15, 2009 at 12:00 PM, ruimourato@gmail.comwrote:I've just installed this extension, but i'm having some problems.Need to implement a horizontal menu style in user4, or user 3 positions on rhuk_milkyway template.When the menu drops down, it's not visible.what can i do?Thanks and regardsRui-- Respectfully, Ethan Mateja +++ Packetforwardwww.packetforward.com
[jQuery] Re: I'll Donate $20USD to Jquery if you can teach me how to do this
And now for the teaching part of the request... KrushRadio, the crucial part that I believe you wanted to be taught about is: $('day[name=Monday]show', data) If you're familiar with CSS selector syntax, that's a great head- start.The full details can be found at http://docs.jquery.com/Selectors To break it down for you, the selector includes show elements that are children of day elements with name attributes equal to 'Monday'. All of the matched results are put into an array of elements which are iterated with .each(). Hope we've helped earn jQuery that donation! - jb On May 17, 8:43 pm, comslash.com comsl...@gmail.com wrote: $(function(){ $.ajax({ type: GET, url: test.xml, dataType: xml, success: function(data){ $('day[name=Monday]show', data).each(function(){ time = $(this).find('time').text(); dj = $(this).find('dj').text(); showname =$(this).find('showname').text(); $('body').append(time + 'br /' + dj + 'br /' + showname + 'br /br /'); }); } }); });
[jQuery] [Validation] by Remote: Passing in Data Alongside elementName
Can anyone help me get this data passed into my url alongside the element name? On May 15, 11:54 am, Field fields...@gmail.com wrote: $(#Form).validate({ rules: { storename_name: { required: true, remote: { url: /intranet/trunk/app/index.php/storeform/ findValidstorename, type: post, data: { foo: bar } } }, Will this send the variable foo containing the value bar into the POST alongside the #storename_name value? If I take out the 'data:{}' piece of the code, it all works fine. The way I have it coded above it does not work at all. I need to get an additional value sent into the url listed.
[jQuery] Re: Problem getting selected value from drop-down
Can I just thank you guys!! I've wasted hours trying to fiddle around with selectedIndex and stuff; the best I achieved was to get the html object returned :( It wasn't clear from the docs. Confusingly, I did get the option text with $( 'select#myselect option:selected' ).text(). But I couldn't get the value as well; I needed both. To clarify for anyone else struggling with it, here's what I did:- $( 'select#myselect' ).change( function () { var itemValue; var itemText; $( 'select#myselect option:selected' ).each( function () { itemValue = $( this ).val(); itemText = $( 'select#myselect option:selected').text(); }); $( '#answer' ).text( itemText + ' is number ' + itemValue ); // do some work with the answer }); I don't know why you have to name the select option twice, nor why it wouldn't work with $( this ) but there you go ... Thanks :D Of course, if any of you geniuses can improve my code, I'm listening! Cherry
[jQuery] jQuery.Scrollable Navigation IE6 IDisplay Issues
Hi, I am trying to implement the visual example within IE6, i.e: http://flowplayer.org/tools/demos/scrollable/visual.html but unfortunately the navigation bar along the top does not display as a single row but as two rows of small circles. As mentioned, works great in FF but there seems to be an issues with the CSS when it comes to using it within IE6. Any help on correcting this would be much appreciated. Thanks.
[jQuery] Re: Issue with setting click event functions in a for loop
what i decided to do is unroll the loop, for example: if you have this loop: for(var i = 0; i = 9; ++i) alert(i); then you could unroll it to this: alert(0); alert(1); alert(2); ... alert(9); since i only had a total of 9 iterations of the loop, then it would only add a little bit to filesize but even then I will end up packing the js file when all is fully functional later, so that then becomes not really and issue either thanks though, mikfig On Sat, May 16, 2009 at 9:22 PM, mkmanning michaell...@gmail.com wrote: You might want to doublecheck that when you click the elements you took out of the loop, you really get what you say. Given your example, if you click #page2 it should alert 'page3' also. You don't really need the loop to attach the click and get at the number if it's part of the id: $('div[id^=page]').click(function(){ console.log('page ' + this.id.replace(/page/,'') + ' clicked.'); }); Try Googling global variables, scope, and closures in JavaScript. On May 16, 2:16 pm, mikfig mikfi...@gmail.com wrote: I have a webpage that searches a database using a php script to search the database and a jQuery app on the page to retrieve the results and show them. So it works fine, but then I want to add page number buttons to allow the user to go to different pages of the results. So I have a DIV with the id of page_buttons and I use the following code:http://pastebin.com/m3dffbf99 I use the offset and the results per page like this in a MySQL query in the php script: SELECT LIMIT offset, resultsPerPage by the way. So anyways, the problem I am having is that if I have a loop like this: var pageNum = 6; ... for(var i = 0; i = pageNum; ++i) { $(#page + i).click(function() { alert('page ' + i + ' clicked.'); }); } The elements with IDs of page1, page2,... are buttons, and I tested the above loop. What happens is if I click any of the buttons with IDs of page1, page2,.. then they all alert with the string page 7 clicked. All the page buttons 1-6 display the string page 7 clicked. To try to greater understand this problem I took the functionality out of the loop like this: var i = 2; $(#page + i).click(function() { alert('page ' + i + ' clicked.'); }); i = 3; $(#page + i).click(function() { alert('page ' + i + ' clicked.'); }); and it worked just fine with page2 alerting page 2 clicked and page3 alerting with page 3 clicked. So I was hoping someone could help me in explaining why this issue occurs and if there was a better way to do what I'm trying to do. Thanks, mikfig -- DX for life
[jQuery] Re: how to get a row of a table sorted with quicksearch plugin in a text box
Hi, To get data of a row you need to use id of that row. var row_data = $('#row_id').html(); To insert into your your form textarea Again you need to use id of that textarea. like : $('#textarea_Id').html('Some string value you can pass here '+row_data); Hope you will solve your problem hope I am on same scenario. Cheers :) On Sat, May 16, 2009 at 7:09 AM, Chass devilcha...@gmail.com wrote: Hi, first sorry for my english, but I'm speak spanish. my problem is that I don't know how get a data of a row and passing the result to a textbox located in my form for example : textbox.Text=(result); If somebody can help me.. thanks p.d: I use this jquery plug-in http://rikrikrik.com/jquery/quicksearch/#download -- ---| Regard |--- Mohd.Tareque
[jQuery] cycle plugin not working
I am trying to use the cycle plugin but all I get is a static list. I have checked to make sure all my code is matching with the demos online and still I dont get anywhere. I have loaded this code inside the .ready function $('#s1').cycle({ fx: 'fade', speed: 'fast', timeout: 0, next: '#next2', prev: '#prev2' }); This part has been loaded into the body tag obviously. div id=s1 class=pics img src=/photo_site/pictures/bee.png alt=1a height=400 width=600/ img src=/photo_site/pictures/Bridge.jpg alt=1b height=400 width=600/ img src=/photo_site/pictures/Cat.jpg alt=1c height=400 width=600/ img src=/photo_site/pictures/desert.jpg alt=1d height=400 width=600/ img src=/photo_site/pictures/France.jpg alt=1e height=400 width=600/ img src=/photo_site/pictures/House.jpg alt=1f height=400 width=600/ /div This part has been loaded into the body tag obviously. The page containing the code is: http://royalvillicus.com/photo_site/...e/photo_1.html The images are shown at the bottom Thanks a lot for all your help
[jQuery] Superfish with supersubs - won't auto adjust width
http://demo.ashwebthemes.com In the main navigation at the very top and the categories in the second level navigation. Can't get either of them to adjust to a proper width.
[jQuery] jquery not showing an iframe
I have been able to show iframes with jquery easily, but for some reason I cant this one to work. I am using the same exact setup in the same page to show this one, but it is not working like the other three. I need the iframe to fadeIn once an image is clicked. I have narrowed it down to class=artists which in the css is set to {display: none;} without it there the iframe shows the entire time. With it there the iframe wont show at all. For the setup that does work I have: (I have two others with this exact setup (different id though) that work just fine) iframe src=/photo_site/photographers.html id=photo_list class=artists width=599 height=399/iframe The jquery uses the id to show and hide the element. The one that doesnt work: iframe src=/photo_site/contact.html width=610 height=399 id=contact_form class=artists/iframe just like before jquery uses the id to show and hide the element The jquery I am using to show the element is: $(img#contact).click(function(){ $(#photo_list).fadeOut(250); $(#illus_list).fadeOut(250); $(#graphic_list).fadeOut(250); $(img#photo).fadeOut(250); $(img#illus).fadeOut(250); $(img#grphc).fadeOut(250); $(span#options).fadeOut(250); $(#about_us).fadeOut(250); $(img#site).fadeOut(250, function() { $(#contact_form).fadeIn(1000); }); }); For more deatils on this dilema I have provided the link: http://royalvillicus.com/photo_site/photo.php Thanks a lot for your help