[jQuery] Re: How to Do This
Hi.. I don't see what you want to do... please be more specific :) On Sep 1, 1:23 pm, bharathbhooshan ambati bharathbhooshan.amb...@gmail.com wrote: Hi I have seen one site which consists of share/Email in a single tab. Can any body tell me hw to do this FYI.. site:http://www.networkworld.com/news/2009/083109-vmworld-xen-cloud-initia... Please find the attachment -- భరత్ భూషణ్ అంబటి imp.JPG 22KViewDownload
[jQuery] Re: get parent where
I've went with a problem similliar to yours, a guy helped me out $(this).closest('.your-item').attr('id'); Try putting in your div a class named your-item like so, class=your- item and then when you click on your span i think it wold give your div id, just try it :) Example: div class=your-item id=thirdArea span id=subSecond ul liFirst Item/li liSecond Item/li liThird Item/li /ul /span /div On 2 Ago, 20:07, pedalpete p...@hearwhere.com wrote: I've been trying to get a specific parent element traversing up the DOM until I find it, but it is getting to be some very verbose code, and I'm thinking there must be a better way. I have a bunch of events which is fired on a click, and I am trying to figure out which of the parent divs was clicked. Now I have something like this (this is a simplified version) code div id=firstArea ul liFirst Item/li liSecond Item/li liThird Item/li /ul /div div id=secondArea span id=subSecond ul liFirst Item/li liSecond Item/li liThird Item/li /ul /span /div div id=thirdArea span id=subSecond ul liFirst Item/li liSecond Item/li liThird Item/li /ul /span /div /code So, i'm trying to get the id of the div. I was hoping I could do this code $(this).parent('div').attr(id); /code but unfortunately that doesn't work as the first parent is not always a div. So what I end up with is code var getParent=$(this).parent().attr(id); if(getParent=='subSecond'){ getParent=$(this).parent().parent().attr(id);} /code Not the worst code ever, but I think there must be a better way to do this, and it may get more confusing/verbose as I continue to add elements and types. Is there a better way of doing this?
[jQuery] Re: jQuery Modal script needed...
jQuery UI has what you want, i guess lol, http://jqueryui.com/ On 31 Jul, 20:56, oli janoli...@gmail.com wrote: Hey there, I'm looking for a light-weight jQuery modal plugin that supports ajax, some effects and restyling or resizing by a little Api. I didn't find anything that fits my expectations. Thanks, Oli
[jQuery] Re: Slider Experts?
Hi, Don't know if this is what you want but here it goes, http://jqueryfordesigners.com/coda-slider-effect/ Regards On 28 Jul, 01:31, photogeek levin@gmail.com wrote: Anyone know how to create the slider effect, coda slider, so that it opens up with something other than the first panel/div? I know there is an option with serial scroll to do this, but for some reason its not happening for me. Thanks in advance Andy
[jQuery] jQuery - Best way to get this ID from the DIV.
Hi, I have this HTML: div id=1 class=item clearfix div class=image .../div div class=productx .../div /div div id=2 class=item clearfix div class=image .../div div class=productx .../div /div In the product DIV i have an x that x is an image icon, when clicked it is suppossed do delete the product, i have it working very good, but i don't know if the way i do to get the ID via javascript is the best way or is a more simple way to do it. My js to get the ID: var productID = $(this).parent().parent().attr('id'); i have to use parent() twice because i have the image div above, is there any simple way to get the ID? If i use $('.item').attr('id'); it get's the first ID, so don't work... It works very good this way, but i want to change the order of the div's i need to change the JS too :S Thanks in advance for any tips ;)
[jQuery] Re: Calling other functions inside a function
Hi, Can you please post the function that is not working in Firefox please? Regards On 21 Jul, 19:48, evanbu...@gmail.com evanbu...@gmail.com wrote: This is probably more of a basic javascript question than a specific jquery function. I have this jQuery function named validateSubmit() which calls two other regular javascript functions. When using IE, both createCharts() and getDirectorIDs get called but when using FireFox, only createCharts() gets called and never makes it to getDirectorIDs() and I'm not sure why this occurs. Thanks script type=text/javascript // make sure at least one checkbox is checked function validateSubmit() { if( $(input:checkbox:checked).length == 0 ) { alert( Please select at least one section for your PDF profile ); return false; } else { createCharts(); getDirectorIDs(); return true; } } /script
[jQuery] Re: Calling other functions inside a function
And btw... there's any return false in createCharts(); ? On 21 Jul, 19:53, Glazz brunofgas...@live.com.pt wrote: Hi, Can you please post the function that is not working in Firefox please? Regards On 21 Jul, 19:48, evanbu...@gmail.com evanbu...@gmail.com wrote: This is probably more of a basic javascript question than a specific jquery function. I have this jQuery function named validateSubmit() which calls two other regular javascript functions. When using IE, both createCharts() and getDirectorIDs get called but when using FireFox, only createCharts() gets called and never makes it to getDirectorIDs() and I'm not sure why this occurs. Thanks script type=text/javascript // make sure at least one checkbox is checked function validateSubmit() { if( $(input:checkbox:checked).length == 0 ) { alert( Please select at least one section for your PDF profile ); return false; } else { createCharts(); getDirectorIDs(); return true; } } /script
[jQuery] Re: jQuery - Best way to get this ID from the DIV.
Thanks that worked :) Didn't know about that one hehe ;) Thanks again, Regards Bruno On 21 Jul, 20:14, Richard D. Worth rdwo...@gmail.com wrote: var productID = $(this).closest('.item').attr('id'); See http://docs.jquery.com/Traversing/closest - Richard On Tue, Jul 21, 2009 at 2:27 PM, Glazz brunofgas...@live.com.pt wrote: Hi, I have this HTML: div id=1 class=item clearfix div class=image .../div div class=productx .../div /div div id=2 class=item clearfix div class=image .../div div class=productx .../div /div In the product DIV i have an x that x is an image icon, when clicked it is suppossed do delete the product, i have it working very good, but i don't know if the way i do to get the ID via javascript is the best way or is a more simple way to do it. My js to get the ID: var productID = $(this).parent().parent().attr('id'); i have to use parent() twice because i have the image div above, is there any simple way to get the ID? If i use $('.item').attr('id'); it get's the first ID, so don't work... It works very good this way, but i want to change the order of the div's i need to change the JS too :S Thanks in advance for any tips ;)
[jQuery] Re: Calling other functions inside a function
H at first i dont see anything wrong, i see one thing, but if ie doesn't complain lol, close each line with ; maybe that works, but hey i'm just gessing, ie doesn't show any problem because of that lol Try putting alerts to verify if they show up On 21 Jul, 20:07, evanbu...@gmail.com evanbu...@gmail.com wrote: I was hesitant to post this because it's a lot of code but here it is script language=javascript type=text/javascript function GetXmlHttpObject() { var objXMLHttp=null try { objXMLHttp = new ActiveXObject(Msxml2.XMLHTTP); //later IE } catch (e) { try { objXMLHttp = new ActiveXObject(Microsoft.XMLHTTP); //earlier IE } catch (e) { objXMLHttp = null; } } if (objXMLHttp==null) { objXMLHttp=new XMLHttpRequest() //IE7, Firefox, Safari } return objXMLHttp } function stateChangedCharts() { if (xmlHttp.readyState==4 || xmlHttp.readyState==complete) { createInterlocksGraph(%=intid_company%) } } function createCharts() { xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert (Your browser does not support the XMLHttpRequest object.) return } var url=/charts/CMChart_BA_static.php?CompID=%=intid_company %CEOTotSumComp=%=intCEOTotSumComp% xmlHttp.onreadystatechange=stateChangedCharts xmlHttp.open(GET,url,true) xmlHttp.send(null) } function createInterlocksGraph(id_company) { xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert (Your browser does not support the XMLHttpRequest object.) return } var url=/charts/interlocks_BA.php?type=coID=+id_company xmlHttp.onreadystatechange=stateChangedInterlocks xmlHttp.open(GET,url,true) xmlHttp.send(null) } /script On Jul 21, 2:55 pm, Glazz brunofgas...@live.com.pt wrote: And btw... there's any return false in createCharts(); ? On 21 Jul, 19:53, Glazz brunofgas...@live.com.pt wrote: Hi, Can you please post the function that is not working in Firefox please? Regards On 21 Jul, 19:48, evanbu...@gmail.com evanbu...@gmail.com wrote: This is probably more of a basic javascript question than a specific jquery function. I have this jQuery function named validateSubmit() which calls two other regular javascript functions. When using IE, both createCharts() and getDirectorIDs get called but when using FireFox, only createCharts() gets called and never makes it to getDirectorIDs() and I'm not sure why this occurs. Thanks script type=text/javascript // make sure at least one checkbox is checked function validateSubmit() { if( $(input:checkbox:checked).length == 0 ) { alert( Please select at least one section for your PDF profile ); return false; } else { createCharts(); getDirectorIDs(); return true; } } /script- Hide quoted text - - Show quoted text -
[jQuery] Re: jquery, php question (Probably the wrong place to ask)
Hi, What is the code that you now? If you have none we can help you create the code you need But you are going to use $.ajax() to get the numbers that you are talking about from the MySQL table. And then you can update the form as your needs. Btw, im a neewbie too but i can help in what i can :) Regards, Bruno. On 21 Jul, 21:24, raisputin greg.djr...@gmail.com wrote: Hello, newb here ;) This is probably the wrong place to ask, but maybe someone could point me in the right direction if that is the case :) I am pulling data from a mysql database to partially populate a form. This is all done in a 'dialog' which is really slick, so when I open that dialog, i get (please excuse the crude drawings) Dropdown menu [ Chest 1 ] [ Chest 2 ] [ etc... ] That part I have working fine, what I need to do now is make it so that when someone selects Chest_N it will populate the form with say the number of drawers in that chest as each chest may have any number of drawers (within reason of course). The information for each chest, such as mfr, etc. and including the number of drawers is stored in the 'chests' table in mysql like Table: Chests chest_id chest_name chest_color chest_serial chest_num_drawers so when I select a chest in the dropdown, I need to create fields like Drawer 1 - Drawer N as text boxes in the form. The mySQL queries I can do as that is super simple, I am just not sure how to make it do the query once a chest is selected. Any help appreciated, and if I am asking in the wrong place, a direction to the proper place to ask would also be appreciated. :) Thanks in advance
[jQuery] Re: Could REALLY use some help implementing a slider/carousel. I think I am really close!
Hi, I dunno how your plugin works, but here goes my 2 cents #Problem 1: Why don't place a display: none; style? Dunno if this works with your plugin but, you can do this and in inside your plugin just show the content you need to show... #Problem 2: Don't understand what you mean for scrolls way off the page (either left or right) On 19 Jul, 22:19, Alan alanblackf...@gmail.com wrote: Yeah, I know. As part of the re-write we will deal with the image issue. The page load time on the actual site is aweful. On Jul 19, 10:11 am, Charlie charlie...@gmail.com wrote: for starters your images are huge ...sampled a couple .Judy Dench is 1728px × 2304px (scaled to 449px × 600px) and file size is 350kb! that's a huge amount of loading time for the number of images you have Alan wrote:OKgranted I am totally a rookie here...but I am S stuck! Could anyone look at this page:http://www.movieeye.com/index-new.jspandhelp me with either of the two big problems I am having??? Problem #1: When the content is loading (3 content div's worth) it shows ALL of the content before it collapses into the slider. Problem #2: The previous content doesn't disappear when you click the button, but rather scrolls way off the page (either left or right). Both of these problems will be blatantly obvious when you go to the page Any ideas whatsoever that could fix this? If any code is needed, let me know, happy to share it! I'd greatly appreciate any help! Alan
[jQuery] Re: $.ajax How-to?
Hi, Here data : $('#form').serialize() you are serializing the data, so in the php i guess you need to unserialize it, dunno but maybe that is the problem with your script. Here's how i do it, i use json btw: $.ajax({ type: 'POST', url: 'ajax.php', data: 'quantidade=' + $('#quantidade').val() , dataType : 'json', success: function(data){ $('#my-div').html(data.returned_variable_from_php); }, error: function(XMLHttpRequest, textStatus, errorThrown) { alert('Error!'); } }); I get the values individually, maybe its a bad way but i like this way :) Im a newbie at jQuery too but if you need any help you can add me on msn, im portuguese :) Regards Bruno On 18 Jul, 17:36, Pedro Vidal pedrorvi...@gmail.com wrote: Hello guys, my first time writing to group...I'm a beginner in jquery and I'm trying to learn the $.ajax() method. I created a simple form (3 inputs) and the form should send the data (via ajax) to the page ajax.php which will return the data to be written in a div (#mensagem), just it. But I would like to know why *THIS* works: *$('#form').submit(function() {* * ** $.post(* * **'ajax.php', * * **$('#form').serialize(), * * **function(data){* * ** $('#mensagem').html(data);* * **}* * ** );* * ** return false;* * **});* and *THIS* doesn't work: *$('#form').submit(function() {* * ** $.ajax({* * ** dataType: 'html',* * ** url: 'ajax.php',* * ** type: 'post',* * ** data : $('#form').serialize(),* * ** beforeSend: function() { alert('iniciando requisicao ajax'); },* * ** error: function() { alert('ocorreu um erro'); },* * ** success: function(data)* * {* * ** $('#mensagem').html(data)* * ** },* * ** complete: function() { alert('requisicao ajax completa'); }* * ** });* * **});* The PHP code: *?php* * **$nome = $_POST['nome'];* * **$idade = $_POST['idade'];* * **$timetorce = $_POST['timetorce'];* * **echo Nome: $nome - Idade: $idade anos - Time: $timetorce;* *?* * * When I use the second code, the error returned by the PHP is this: *Notice*: Undefined index: nome in * D:\wamp\www\sites\testes\serialize\ajax.php* on line *2* *Notice*: Undefined index: idade in * D:\wamp\www\sites\testes\serialize\ajax.php* on line *3* *Notice*: Undefined index: timetorce in * D:\wamp\www\sites\testes\serialize\ajax.php* on line *4* Nome: - Idade: anos - Time: So, how do I use the $.ajax() method? Thanks for help! Pedro Vidal, Brazil.
[jQuery] Re: Could REALLY use some help implementing a slider/carousel. I think I am really close!
Hmm i tried to replicate that on my server but whithout success... You can try what i've mentioned in my previous post, display: none; like this: HTML: div id=slider align=center style=display: none; JS: Add this $('#slider').css({'display' : 'block'}); After this.each(function() { It will look like this: this.each(function() { $('#slider').css({'display' : 'block'}); Try it please... On 20 Jul, 02:25, Alan alanblackf...@gmail.com wrote: I can show css or slider code if it helps. Slider CSS below -- @charset utf-8; /* CSS Document */ #slidercontent{ position:relative; } #slidercontainer{ margin:0 auto; position:relative; text-align:left; width:896px; background:#fff; margin-bottom:2em; } /* clearfix */ #slidercontent:after, ul:after{ content:.; display:block; height:0; clear:both; visibility:hidden; } #slidercontent, ul{ display:block; } /* \*/ #slidercontent, ul{ min-height:1%; } * html #slidercontent, * html ul{ height:1%; } /* // clearfix */ /* image replacement */ .graphic, #header h1, #prevBtn, #nextBtn{ margin:0; padding:0; display:block; overflow:hidden; text-indent:-8000px; } /* // image replacement */ /* Easy Slider */ #slider{} #slider ul, #slider li{ margin:0; padding:0; list-style:none; } #slider li{ /* define width and height of list item (slide) entire slider area will adjust according to the parameters provided here */ width:896px; height:171px; overflow:hidden; } #prevBtn, #nextBtn{ display:block; width:30px; height:77px; position:absolute; left:-30px; top:41px; } #nextBtn{ left:896px; } #prevBtn a, #nextBtn a{ display:block; width:30px; height:77px; background:url(/includes/sliders/images/btn_prev.gif) no-repeat 0 0; } #nextBtn a{ background:url(/includes/sliders/images/btn_next.gif) no-repeat 0 0; } /* // Easy Slider */ Actual Slider Code - (function($) { $.fn.easySlider = function(options){ // default configuration properties var defaults = { prevId: 'prevBtn', prevText: '', nextId: 'nextBtn', nextText: '', controlsShow: true, controlsBefore: '', controlsAfter: '', controlsFade: true, firstId: 'firstBtn', firstText: 'First', firstShow: false, lastId: 'lastBtn', lastText: 'Last', lastShow: false, vertical: false, speed: 800, auto: false, pause: 4000, continuous: false }; var options = $.extend(defaults, options); this.each(function() { var obj = $(this); var s = $(li, obj).length; var w = $(li, obj).width(); var h = $(li, obj).height(); obj.width(w); obj.height(h); obj.css(overflow,hidden); var ts = s-1; var t = 0; $(ul, obj).css('width',s*w); if(!options.vertical) $(li, obj).css('float','left');
[jQuery] jQuery - Ajax and Load question
Hello, I have a function that have this: $.ajax({ type: 'GET', url: 'index.php', data: 'id=' + productId + 'qtd=' + quantidade }); This piece of code is working great, but i need to know how to get the response from the specified url, for example, the response from index.php is two, i need to get that to place it inside a div, i know with load i can do that, but i want to be able to send in the response an array with some data. Hope you understand :[ Regards!
[jQuery] Re: jQuery - Ajax and Load question
Thanks for the quick replies, using $.get i can do what i want, with $.ajax i can too, except the data coming from the .php page is json encoded so in the $.get i used 'json' at the end - $.get(.., .., function(), 'json'); Is there any big difference using $.get or $.post, or just $.ajax and defining the method ( get or post ) in $.ajax? On 7 Jul, 22:53, James james.gp@gmail.com wrote: with $.ajax, you use the success callback. $.ajax({ type: 'GET', url: 'index.php', data: 'id=' + productId + 'qtd=' + quantidade, success: function(data) { alert(data); }, error: function() { alert('error occurred'); } }); On Jul 7, 11:49 am, BaBna thomas.na...@gmail.com wrote: You need to define your callback function. Maybe something like this? $.get(index.php, { id: productId , qtd: quantidade }, function(data) { doWhateverWith(data); }); On Jul 7, 10:42 pm, Glazz brunofgas...@live.com.pt wrote: Hello, I have a function that have this: $.ajax({ type: 'GET', url: 'index.php', data: 'id=' + productId + 'qtd=' + quantidade }); This piece of code is working great, but i need to know how to get the response from the specified url, for example, the response from index.php is two, i need to get that to place it inside a div, i know with load i can do that, but i want to be able to send in the response an array with some data. Hope you understand :[ Regards!
[jQuery] Re: jQuery - Ajax and Load question
Ok i got it, just need to use $.ajax({dataType : 'json'}); On 7 Jul, 23:12, Glazz brunofgas...@live.com.pt wrote: Thanks for the quick replies, using $.get i can do what i want, with $.ajax i can too, except the data coming from the .php page is json encoded so in the $.get i used 'json' at the end - $.get(.., .., function(), 'json'); Is there any big difference using $.get or $.post, or just $.ajax and defining the method ( get or post ) in $.ajax? On 7 Jul, 22:53, James james.gp@gmail.com wrote: with $.ajax, you use the success callback. $.ajax({ type: 'GET', url: 'index.php', data: 'id=' + productId + 'qtd=' + quantidade, success: function(data) { alert(data); }, error: function() { alert('error occurred'); } }); On Jul 7, 11:49 am, BaBna thomas.na...@gmail.com wrote: You need to define your callback function. Maybe something like this? $.get(index.php, { id: productId , qtd: quantidade }, function(data) { doWhateverWith(data); }); On Jul 7, 10:42 pm, Glazz brunofgas...@live.com.pt wrote: Hello, I have a function that have this: $.ajax({ type: 'GET', url: 'index.php', data: 'id=' + productId + 'qtd=' + quantidade }); This piece of code is working great, but i need to know how to get the response from the specified url, for example, the response from index.php is two, i need to get that to place it inside a div, i know with load i can do that, but i want to be able to send in the response an array with some data. Hope you understand :[ Regards!
[jQuery] jQuery - Click function + Ajax
Hi there, I have a hyperlink ( a ) after i click on that hyperlink, the script sends some data to a .php page; That works fine, but for just one hyperlink , i want to be able to have 2 or more hyperlinks in the same page using the same script. Here goes the script: $(#button).click(function(){ var element = this; var productId = $(element).attr('product'); //$(element).attr(href, javascript: void(0);); $.ajax({ type: GET, url: index.php, data: product= + productId }); }); HTML: a id=button rel=nofollow product=10 href=#testProduct 10/a a id=button rel=nofollow product=20 href=#testProduct 20/a
[jQuery] Re: jQuery - Click function + Ajax
Off course, i forgot that hehe it is working great right now ;) About that, i really don't know, sometimes i need to use it this way, but you can try to validate using W3C tools On 2 Jul, 17:55, John Newman john.newma...@gmail.com wrote: You can't have 2 elements with the same id on the same page. Instead do a class=button and change your selector to use $(a.button). I would also recommend using a href= I'm kind of doing the same thing (i have a thread about it), is it safe to put event parameters in arbitrary attribute names? i.e.: td class=trigger record=${record.ID} paramX=${paramX} paramY=$ {paramY} isn't that invalid html and rejected by some browsers? or is that normal and just fine to do? On Jul 2, 12:44 pm, Glazz brunofgas...@live.com.pt wrote: Hi there, I have a hyperlink ( a ) after i click on that hyperlink, the script sends some data to a .php page; That works fine, but for just one hyperlink , i want to be able to have 2 or more hyperlinks in the same page using the same script. Here goes the script: $(#button).click(function(){ var element = this; var productId = $(element).attr('product'); //$(element).attr(href, javascript: void(0);); $.ajax({ type: GET, url: index.php, data: product= + productId }); }); HTML: a id=button rel=nofollow product=10 href=#testProduct 10/a a id=button rel=nofollow product=20 href=#testProduct 20/a
[jQuery] Re: DivMenu
Ok thanks for your sugestions, i'm going to implement those when i get back home. Thanks again. On Jun 14, 5:51 am, Charlie charlie...@gmail.com wrote: there are several reasons this isn't working , the main reason is everything you click on is in the body,including the div you want to stay open. Events bubble up from children to parent. Even though you think you are only clicking on your div, you are also clicking body. Try this in firebug on any page that has jquery loaded $('*').click(function(){ alert(this.tagName); }); you can see the bubbling up of all tag's parents all the way to html tag as alerts will keep going off for each parent you will need a filter on your body click to stop your div closing something like: $('body').click(function(event){ if ($(event.target).is(.menu-cnts *)) { ///do nothing } else{ $('#' + divDados).hide();} }); that will stop your div closing, as for the rest of your method there are other issues there too: $(element).click(function(){ //why use an a tag? $('#' + divDados).hide();/// why hide the div you want to open? $(this).next().show(); // you created methods to identify your div by ID, but this is opening it ...your div is the next inline element to the atag // return false; }); I think you are trying to use this to open another div from another link but it sure seems you will have a much easier time using other methods than working with ID's you could add/remove classes such as class=hidden and css .hidden{ display:none} or something like: find(yourDivClass:visible).hide();// if you only intend to have one open at a time this would be easier than ID's you might consider scrapping out all the css parameters, work outside the plugin with real classes and ID's in your functions to get them working first then put them into the plugin after you know your methods work http://jsbin.com/ekaqe First click Euro (€), then a div shows up, the first problem is that if you click on the div, the div closes itself, and the other problem is, if you have 2 links to open divs they don't close itself, i need to click on the document page to close them Here is the JS: jQuery.fn.DivMenu = function(opcoes){ /** * Valores de defeito. **/ var variaveis = { 'display' : 'none', 'position' : 'absolute', 'background' : '#fff', 'border' : '1px solid #cecece', 'font-family' : 'Verdana, Arial, Helvetica, sans-serif', 'font-size' : '11px; padding: 5px; z-index: 99' }; var opcoes = $.extend({}, variaveis, opcoes); /** end **/ /** * **/ return this.each(function(){ /** * Declarar variaveis. **/ var element = this; var offset = $(element).offset(); var left = offset.left; var top = offset.top; var currentId = $(this).attr('id'); var divDados = currentId + '-dados'; /** end **/ /** * **/ $(element).click(function(){ $('#' + divDados).hide(); $(this).next ().show(); return false; }); $(document.body).click(function(){ $('#' + divDados).hide(); }); /** end **/ /** * **/ $('#' + divDados).css({ 'left' : left + 'px', 'top' : top + 15 + 'px', 'display' : opcoes['display'], 'position' : opcoes['position'], 'background' : opcoes['background'], 'border' : opcoes['border'], 'font-family' : opcoes['font-family'], 'font-size' : opcoes['font_size'] }); /** end **/ }); /** end **/ }; On 13 Jun, 14:42, Charlie charlie...@gmail.com wrote: get better response with a link to see the problem, jsbin works great , has built in script libraries including jquery Glazz wrote:nobody can help me out?- Hide quoted text - - Show quoted text -
[jQuery] Re: DivMenu
Hi, its working almost like i want, know it the divs stay's opened if i open another one, i tryed using find(yourDivClass:visible).hide(); without success. Here's a screenshot of what is happening: http://i40.tinypic.com/14916wg.png The javascript that i edited: /** * **/ $(element).click(function(){ $(this).next().show(); return false; }); //$(document.body).click(function(){ $('#' + divDados).hide(); }); $('body').click(function(event){ if(!$(event.target).is(.divmenu-dados *)) { $('#' + divDados).hide(); } }); /** end **/ My HTML: a class=divmenu id=testeEuronbsp;(#8364;)/a div class=divmenu-dados id=teste-dados ul lia name=usd href=index.php?currency=usdUS Dollarsnbsp;($)/a/li lia name=eur href=index.php? currency=eurEuronbsp;(#8364;)/a/li lia name=gbp href=index.php?currency=gbpGB Poundnbsp;(#163;)/a/li /ul /div nbsp;nbsp;|nbsp;nbsp; a class=divmenu id=currencyspan class=enEnglish/ span/a div class=divmenu-dados id=currency-dados ul lia name=usd href=index.php? currency=usdspan class=enEnglish/span/a/li lia name=eur href=index.php? currency=eurspan class=ptPortuguecirc;s/span/a/li /ul /div The css have the display: none; you have mentioned before
[jQuery] Re: DivMenu
I figured that out, just needed to put this: $(.divmenu-dados).hide(); in here $(element).click(function(){ $(.divmenu-dados).hide(); $('#' + divDados).show(); return false; }); On 14 Jun, 19:30, Glazz brunofgas...@live.com.pt wrote: Hi, its working almost like i want, know it the divs stay's opened if i open another one, i tryed using find(yourDivClass:visible).hide(); without success. Here's a screenshot of what is happening:http://i40.tinypic.com/14916wg.png The javascript that i edited: /** * **/ $(element).click(function(){ $(this).next().show(); return false; }); //$(document.body).click(function(){ $('#' + divDados).hide(); }); $('body').click(function(event){ if(!$(event.target).is(.divmenu-dados *)) { $('#' + divDados).hide(); } }); /** end **/ My HTML: a class=divmenu id=testeEuronbsp;(#8364;)/a div class=divmenu-dados id=teste-dados ul lia name=usd href=index.php?currency=usdUS Dollarsnbsp;($)/a/li lia name=eur href=index.php? currency=eurEuronbsp;(#8364;)/a/li lia name=gbp href=index.php?currency=gbpGB Poundnbsp;(#163;)/a/li /ul /div nbsp;nbsp;|nbsp;nbsp; a class=divmenu id=currencyspan class=enEnglish/ span/a div class=divmenu-dados id=currency-dados ul lia name=usd href=index.php? currency=usdspan class=enEnglish/span/a/li lia name=eur href=index.php? currency=eurspan class=ptPortuguecirc;s/span/a/li /ul /div The css have the display: none; you have mentioned before
[jQuery] Re: DivMenu
http://jsbin.com/ekaqe First click Euro (€), then a div shows up, the first problem is that if you click on the div, the div closes itself, and the other problem is, if you have 2 links to open divs they don't close itself, i need to click on the document page to close them Here is the JS: jQuery.fn.DivMenu = function(opcoes){ /** * Valores de defeito. **/ var variaveis = { 'display' : 'none', 'position': 'absolute', 'background' : '#fff', 'border' : '1px solid #cecece', 'font-family' : 'Verdana, Arial, Helvetica, sans-serif', 'font-size' : '11px; padding: 5px; z-index: 99' }; var opcoes = $.extend({}, variaveis, opcoes); /** end **/ /** * **/ return this.each(function(){ /** * Declarar variaveis. **/ var element = this; var offset = $(element).offset(); var left = offset.left; var top = offset.top; var currentId = $(this).attr('id'); var divDados = currentId + '-dados'; /** end **/ /** * **/ $(element).click(function(){ $('#' + divDados).hide(); $(this).next ().show(); return false; }); $(document.body).click(function(){ $('#' + divDados).hide(); }); /** end **/ /** * **/ $('#' + divDados).css({ 'left': left + 'px', 'top' : top + 15 + 'px', 'display' : opcoes['display'], 'position': opcoes['position'], 'background' : opcoes['background'], 'border' : opcoes['border'], 'font-family' : opcoes['font-family'], 'font-size' : opcoes['font_size'] }); /** end **/ }); /** end **/ }; On 13 Jun, 14:42, Charlie charlie...@gmail.com wrote: get better response with a link to see the problem, jsbin works great , has built in script libraries including jquery Glazz wrote:nobody can help me out?
[jQuery] [HELP] DivMenu
hi, i've a function that when i click on a link a div shows up, and it works nice, but when i click on the div itself the div closes up, and other bug is, that if i have 2 or more divs if i click on one link and click on other link the div's stays visible, how can i solve this? here is the code: jQuery.fn.DivMenu = function(opcoes){ /** * **/ var variaveis = { 'display' : 'none', 'position': 'absolute', 'background' : '#fff', 'border' : '1px solid #cecece', 'font-family' : 'Verdana, Arial, Helvetica, sans-serif', 'font-size' : '11px; padding: 5px; z-index: 99' }; var opcoes = $.extend({}, variaveis, opcoes); /** end **/ /** * **/ return this.each(function(){ /** * **/ var element = this; var offset = $(element).offset(); var left = offset.left; var top = offset.top; var currentId = $(this).attr('id'); var divDados = currentId + '-dados'; /** end **/ /** * **/ $(element).click(function(){ $('#' + divDados).hide(); $(this).next ().show(); return false; }); $(document.body).click(function(){ $('#' + divDados).hide(); }); /** end **/ /** * **/ $('#' + divDados).css({ 'left': left + 'px', 'top' : top + 15 + 'px', 'display' : opcoes['display'], 'position': opcoes['position'], 'background' : opcoes['background'], 'border' : opcoes['border'], 'font-family' : opcoes['font-family'], 'font-size' : opcoes['font_size'] }); /** end **/ }); /** end **/ }; this is my first function so be nice to me ;)
[jQuery] [HELP] DivMenu
hi, i've a function that when i click on a link a div shows up, and it works nice, but when i click on the div itself the div closes up, and other bug is, that if i have 2 or more divs if i click on one link and click on other link the div's stays visible, how can i solve this? here is the code: jQuery.fn.DivMenu = function(opcoes){ /** * **/ var variaveis = { 'display' : 'none', 'position': 'absolute', 'background' : '#fff', 'border' : '1px solid #cecece', 'font-family' : 'Verdana, Arial, Helvetica, sans-serif', 'font-size' : '11px; padding: 5px; z-index: 99' }; var opcoes = $.extend({}, variaveis, opcoes); /** end **/ /** * **/ return this.each(function(){ /** * **/ var element = this; var offset = $(element).offset(); var left = offset.left; var top = offset.top; var currentId = $(this).attr('id'); var divDados = currentId + '-dados'; /** end **/ /** * **/ $(element).click(function(){ $('#' + divDados).hide(); $(this).next ().show(); return false; }); $(document.
[jQuery] Re: Change form action based on button clicked
View this page http://www.komodomedia.com/blog/2008/07/using-jquery-to-save-form-details/ On 12 Jun, 15:25, ciupaz luigi.zambe...@gmail.com wrote: Hi all, I have a form like this: form id=my_form method=post action= Name: br / input type=text id=name name=name / input type=submit id=submit1 value=Go to page 1 / input type=submit id=submit2 value=Go to page 2 / /form how can I change my action form so the form goes to Page1.htm with click on button1 and goes to Page2.htm to click on button2, and mantein the value inserted in textbox name? Thanks a lot. Luis
[jQuery] Re: Change form action based on button clicked
Cookies?! See the link i've posted above! On 12 Jun, 15:48, ciupaz luigi.zambe...@gmail.com wrote: Thanks, it's work, and how can I recover the input text value, without using the querystring? Luis
[jQuery] Re: DivMenu
nobody can help me out?